Skip to content

Commit

Permalink
CMake: Short term fix for policy CMP0169
Browse files Browse the repository at this point in the history
Sets policy CMP0169 to OLD to prevent dev warnings related to FetchContent_Populate(<name>).

This needs fixing propperly for longer term support, see #1223
  • Loading branch information
ptheywood committed Sep 4, 2024
1 parent 4e02604 commit 14233ee
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 1 deletion.
4 changes: 4 additions & 0 deletions cmake/dependencies/Jitify.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/modules/ ${CMAKE_MODULE_PATH})
include(FetchContent)
cmake_policy(SET CMP0079 NEW)
# Temporary CMake >= 3.30 fix https://github.com/FLAMEGPU/FLAMEGPU2/issues/1223
if(POLICY CMP0169)
cmake_policy(SET CMP0169 OLD)
endif()

# Change the source-dir to allow inclusion via jitify/jitify.hpp rather than jitify.hpp
FetchContent_Declare(
Expand Down
4 changes: 4 additions & 0 deletions cmake/dependencies/Thrust.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/modules/ ${CMAKE_MODULE_PATH})

include(FetchContent)
cmake_policy(SET CMP0079 NEW)
# Temporary CMake >= 3.30 fix https://github.com/FLAMEGPU/FLAMEGPU2/issues/1223
if(POLICY CMP0169)
cmake_policy(SET CMP0169 OLD)
endif()

# Set the minimum supported cub/thrust version, and the version to fetch
# Thrust minimum version to 1.16 to avoid windows.h related issues and pull in bug fixes, but fetch the most recent 1.x release otherwise (at the time of writing).
Expand Down
4 changes: 4 additions & 0 deletions cmake/dependencies/Tinyxml2.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/modules/ ${CMAKE_MODULE_PATH})
include(FetchContent)

cmake_policy(SET CMP0079 NEW)
# Temporary CMake >= 3.30 fix https://github.com/FLAMEGPU/FLAMEGPU2/issues/1223
if(POLICY CMP0169)
cmake_policy(SET CMP0169 OLD)
endif()

# Change the source_dir to allow inclusion via tinyxml2/tinyxml2.h rather than tinyxml2.h
FetchContent_Declare(
Expand Down
4 changes: 4 additions & 0 deletions cmake/dependencies/flamegpu2-visualiser.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/modules/ ${CMAKE_MODULE_PATH})
include(FetchContent)
cmake_policy(SET CMP0079 NEW)
# Temporary CMake >= 3.30 fix https://github.com/FLAMEGPU/FLAMEGPU2/issues/1223
if(POLICY CMP0169)
cmake_policy(SET CMP0169 OLD)
endif()

# Set the visualiser repo and tag to use unless overridden by the user.
set(DEFAULT_FLAMEGPU_VISUALISATION_GIT_VERSION "flamegpu-2.0.0-rc.1")
Expand Down
4 changes: 4 additions & 0 deletions cmake/dependencies/glm.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
if(POLICY CMP0135)
cmake_policy(SET CMP0135 NEW)
endif()
# Temporary CMake >= 3.30 fix https://github.com/FLAMEGPU/FLAMEGPU2/issues/1223
if(POLICY CMP0169)
cmake_policy(SET CMP0169 OLD)
endif()

set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/modules/ ${CMAKE_MODULE_PATH})
include(FetchContent)
Expand Down
4 changes: 4 additions & 0 deletions cmake/dependencies/googletest.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/modules/ ${CMAKE_MODULE_PATH})
include(FetchContent)
cmake_policy(SET CMP0079 NEW)
# Temporary CMake >= 3.30 fix https://github.com/FLAMEGPU/FLAMEGPU2/issues/1223
if(POLICY CMP0169)
cmake_policy(SET CMP0169 OLD)
endif()

FetchContent_Declare(
googletest
Expand Down
4 changes: 4 additions & 0 deletions cmake/dependencies/rapidjson.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/modules/ ${CMAKE_MODULE_PATH})
include(FetchContent)
include(ExternalProject)
cmake_policy(SET CMP0079 NEW)
# Temporary CMake >= 3.30 fix https://github.com/FLAMEGPU/FLAMEGPU2/issues/1223
if(POLICY CMP0169)
cmake_policy(SET CMP0169 OLD)
endif()

# a95e013b97ca6523f32da23f5095fcc9dd6067e5 is the last commit before a change which breaks our method of finding rapid json without running a cmake install first.
# but we also need to patch this to avoid a cmake >= 3.26.4 deprecation, but this is handled manually post-population
Expand Down
5 changes: 4 additions & 1 deletion swig/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
# Minimum CMake version 3.18 for CUDA --std=c++17
cmake_minimum_required(VERSION 3.18...3.25 FATAL_ERROR)
include(FetchContent)

# Temporary CMake >= 3.30 fix https://github.com/FLAMEGPU/FLAMEGPU2/issues/1223
if(POLICY CMP0169)
cmake_policy(SET CMP0169 OLD)
endif()

# Set some policy behaviours for SWIG

Expand Down

0 comments on commit 14233ee

Please sign in to comment.