From 9f92e4309739af205bc9676266ff7bb3b3e65bbf Mon Sep 17 00:00:00 2001 From: Christian Gutschow Date: Thu, 26 Sep 2024 11:38:43 +0100 Subject: [PATCH 1/3] only set policy if it exists --- cmake_files/dependencies.cmake | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/cmake_files/dependencies.cmake b/cmake_files/dependencies.cmake index c17d2036a..820994ab6 100644 --- a/cmake_files/dependencies.cmake +++ b/cmake_files/dependencies.cmake @@ -19,7 +19,9 @@ endif() find_package(CFitsIO REQUIRED) -cmake_policy(SET CMP0167 OLD) +if(CMAKE_VERSION VERSION_GREATER "3.29.0") + cmake_policy(SET CMP0167 NEW) +endif() find_package(Boost COMPONENTS system filesystem REQUIRED) find_package(yaml-cpp REQUIRED) @@ -50,7 +52,9 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Linux") endif() if(docs) - cmake_policy(SET CMP0057 NEW) + if(CMAKE_VERSION VERSION_GREATER "3.3.0") + cmake_policy(SET CMP0057 NEW) + endif() find_package(Doxygen REQUIRED dot) endif() @@ -75,7 +79,9 @@ endif() # Always find open-mp, since it may be used by sopt if (openmp) - cmake_policy(SET CMP0074 NEW) + if(CMAKE_VERSION VERSION_GREATER "3.12.0") + cmake_policy(SET CMP0074 NEW) + endif() find_package(OpenMP) if (OPENMP_FOUND) # Set PURIFY_OPENMP to TRUE when OpenMP is both found and requested From 777008acd3da4351b7cbc2480cf040981062a440 Mon Sep 17 00:00:00 2001 From: Christian Gutschow Date: Thu, 26 Sep 2024 11:43:33 +0100 Subject: [PATCH 2/3] should greater or equal, d'oh --- cmake_files/dependencies.cmake | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cmake_files/dependencies.cmake b/cmake_files/dependencies.cmake index 820994ab6..cfafe3403 100644 --- a/cmake_files/dependencies.cmake +++ b/cmake_files/dependencies.cmake @@ -19,7 +19,7 @@ endif() find_package(CFitsIO REQUIRED) -if(CMAKE_VERSION VERSION_GREATER "3.29.0") +if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.29.0") cmake_policy(SET CMP0167 NEW) endif() find_package(Boost COMPONENTS system filesystem REQUIRED) @@ -52,7 +52,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Linux") endif() if(docs) - if(CMAKE_VERSION VERSION_GREATER "3.3.0") + if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.3.0") cmake_policy(SET CMP0057 NEW) endif() find_package(Doxygen REQUIRED dot) @@ -79,7 +79,7 @@ endif() # Always find open-mp, since it may be used by sopt if (openmp) - if(CMAKE_VERSION VERSION_GREATER "3.12.0") + if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.12.0") cmake_policy(SET CMP0074 NEW) endif() find_package(OpenMP) From e8d8790066be9bb3f77468e89709199d38cf2fbb Mon Sep 17 00:00:00 2001 From: Christian Gutschow Date: Thu, 26 Sep 2024 12:05:53 +0100 Subject: [PATCH 3/3] fix version --- cmake_files/dependencies.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake_files/dependencies.cmake b/cmake_files/dependencies.cmake index cfafe3403..3a020482f 100644 --- a/cmake_files/dependencies.cmake +++ b/cmake_files/dependencies.cmake @@ -19,7 +19,7 @@ endif() find_package(CFitsIO REQUIRED) -if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.29.0") +if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.30.0") cmake_policy(SET CMP0167 NEW) endif() find_package(Boost COMPONENTS system filesystem REQUIRED)