Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
10 changes: 10 additions & 0 deletions cmake/dependencies/eigen.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,17 @@ FetchContent_Declare(
)
FetchContent_GetProperties(eigen)
if(NOT eigen_POPULATED)
# FetchContent_MakeAvailable() would run Eigen's CMakeLists.txt via
# add_subdirectory(), which is exactly what we're avoiding above, so we
# keep using the lower-level populate-only call. CMake >= 3.30 deprecates
# calling it directly, so pin CMP0169 to OLD in this scope to silence the
# warning without affecting the rest of the build.
cmake_policy(PUSH)
if(POLICY CMP0169)
cmake_policy(SET CMP0169 OLD)
endif()
FetchContent_Populate(eigen)
cmake_policy(POP)
endif()

# Expose a proper IMPORTED INTERFACE target. IMPORTED targets are never
Expand Down
22 changes: 22 additions & 0 deletions cmake/dependencies/sigma.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,28 @@
include_guard()
include(FetchContent)

# sigma (and the CMaize/CMakePP-Lang machinery it pulls in) is still on an
# older cmake_minimum_required(), so its dev warnings for policies introduced
# since then would otherwise leak into every project that fetches sigma
# through NWXCMake. Rather than patch sigma/CMaize's own CMakeLists.txt (not
# ours to maintain), set the CMAKE_POLICY_DEFAULT_CMP<NNNN> variables here:
# CMake reads these as the default for any policy a subdirectory leaves
# unset, and -- because this is a plain set() in an include()'d file rather
# than a function(), not a CACHE variable -- the value lives in
# get_dependencies()'s call scope and is inherited by every add_subdirectory()
# nested underneath it (sigma's own, CMaize's, cmakepp_lang's, ...).
#
# CMP0167 (FindBoost module removed): NEW is the forward-looking choice --
# Boost >= 1.70 ships its own BoostConfig.cmake, which is what actually
# resolves find_package(Boost) here regardless of this policy's setting.
set(CMAKE_POLICY_DEFAULT_CMP0167 NEW)
# CMP0152 (file(REAL_PATH) resolves symlinks before collapsing ../): OLD
# matches CMake's pre-existing behavior, which is what this vendored tree has
# always been exercised against -- switching to NEW changes the resolved
# install paths CMaize computes, unverified territory we don't need to enter
# just to silence a warning.
set(CMAKE_POLICY_DEFAULT_CMP0152 OLD)

# sigma is still on its own CMaize-based build (not yet migrated to the
# NWXCMake pipify pattern the rest of the ecosystem uses), so this pulls it
# in as a subdirectory the same way wtf.cmake does for its already-migrated
Expand Down
Loading