diff --git a/CMakeLists.txt b/CMakeLists.txt index 04b106ce..fd551f15 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -163,7 +163,12 @@ if (NIFTI_BUILD_TESTING ) include(FetchContent) # fetch data a configure time to simplify tests # If new or changed data is needed, add that data to the https://github.com/NIFTI-Imaging/nifti-test-data repo # make a new release, and then update the URL and hash (shasum -a 256 ). - cmake_policy(SET CMP0169 OLD) + # CMP0169 (deprecating FetchContent_Populate) only exists from CMake 3.30; + # setting it unconditionally is a hard error on every earlier release, + # including the CMake 3.28 that Ubuntu 24.04 ships. + if(POLICY CMP0169) + cmake_policy(SET CMP0169 OLD) + endif() FetchContent_Declare( fetch_testing_data URL https://github.com/NIFTI-Imaging/nifti-test-data/archive/v3.0.2.tar.gz URL_HASH SHA256=5dafec078151018da7aaf3c941bd31f246f590bc34fa3fef29ce77a773db16a6