Skip to content

Commit

Permalink
CMake: Shrot term fix for CMakeFetchContent setting CMP0135 to OLD
Browse files Browse the repository at this point in the history
  • Loading branch information
ptheywood committed Aug 29, 2024
1 parent 8afc40e commit 3befb59
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 5 deletions.
8 changes: 6 additions & 2 deletions cmake/dependencies/devil.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,14 @@ if(UNIX)
"e.g. sudo apt install libdevil-dev")
endif()
elseif(WIN32)

include(FetchContent)
# As the URL method is used for download, set the policy if available
if(POLICY CMP0135)
cmake_policy(SET CMP0135 NEW)
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()

# On windows, always download manually. There are issues with find_package and multi-config generators where a release library will be found, but no debug library, which can break things.
Expand Down
5 changes: 5 additions & 0 deletions cmake/dependencies/glew.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,15 @@ if(UNIX)
"e.g. sudo apt install libglew-dev")
endif ()
elseif(WIN32)
include(FetchContent)
# As the URL method is used for download, set the policy if available
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()
# On windows, always download manually. There are issues with find_package and multi-config generators where a release library will be found, but no debug library, which can break things.
# Declare source properties
# This mirror is linked from the official Glew website, and more stable than SourceForge
Expand Down
7 changes: 6 additions & 1 deletion cmake/dependencies/glm.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,14 @@
# glm #
#######

include(FetchContent)
# As the URL method is used for download, set the policy if available
if(POLICY CMP0135)
cmake_policy(SET CMP0135 NEW)
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})
Expand Down
10 changes: 8 additions & 2 deletions cmake/dependencies/imgui.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,15 @@

set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/modules/ ${CMAKE_MODULE_PATH})
include(FetchContent)

cmake_policy(SET CMP0079 NEW)

# As the URL method is used for download, set the policy if available
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()
# Change the source_dir to allow inclusion via imgui/imgui.h rather than imgui.h
FetchContent_Declare(
imgui
Expand Down
6 changes: 6 additions & 0 deletions cmake/dependencies/sdl2.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,15 @@ elseif(WIN32)
# On windows, always download manually. There are issues with find_package and multi-config generators where a release library will be found, but no debug library, which can break things.
# Declare source properties
# As the URL method is used for download, set the policy if available
include(FetchContent)
# As the URL method is used for download, set the policy if available
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()
FetchContent_Declare(
SDL2
URL "https://www.libsdl.org/release/SDL2-devel-2.0.12-VC.zip"
Expand Down

0 comments on commit 3befb59

Please sign in to comment.