Skip to content

CMPs: only set policy if it exists #353

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Sep 26, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions cmake_files/dependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ endif()

find_package(CFitsIO REQUIRED)

cmake_policy(SET CMP0167 OLD)
if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.29.0")
cmake_policy(SET CMP0167 NEW)
endif()
find_package(Boost COMPONENTS system filesystem REQUIRED)

find_package(yaml-cpp REQUIRED)
Expand Down Expand Up @@ -50,7 +52,9 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
endif()

if(docs)
cmake_policy(SET CMP0057 NEW)
if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.3.0")
cmake_policy(SET CMP0057 NEW)
endif()
find_package(Doxygen REQUIRED dot)
endif()

Expand All @@ -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_EQUAL "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
Expand Down