Skip to content

Commit 9f92e43

Browse files
committed
only set policy if it exists
1 parent cdb3b39 commit 9f92e43

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

cmake_files/dependencies.cmake

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ endif()
1919

2020
find_package(CFitsIO REQUIRED)
2121

22-
cmake_policy(SET CMP0167 OLD)
22+
if(CMAKE_VERSION VERSION_GREATER "3.29.0")
23+
cmake_policy(SET CMP0167 NEW)
24+
endif()
2325
find_package(Boost COMPONENTS system filesystem REQUIRED)
2426

2527
find_package(yaml-cpp REQUIRED)
@@ -50,7 +52,9 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
5052
endif()
5153

5254
if(docs)
53-
cmake_policy(SET CMP0057 NEW)
55+
if(CMAKE_VERSION VERSION_GREATER "3.3.0")
56+
cmake_policy(SET CMP0057 NEW)
57+
endif()
5458
find_package(Doxygen REQUIRED dot)
5559
endif()
5660

@@ -75,7 +79,9 @@ endif()
7579

7680
# Always find open-mp, since it may be used by sopt
7781
if (openmp)
78-
cmake_policy(SET CMP0074 NEW)
82+
if(CMAKE_VERSION VERSION_GREATER "3.12.0")
83+
cmake_policy(SET CMP0074 NEW)
84+
endif()
7985
find_package(OpenMP)
8086
if (OPENMP_FOUND)
8187
# Set PURIFY_OPENMP to TRUE when OpenMP is both found and requested

0 commit comments

Comments
 (0)