Skip to content

Commit

Permalink
Prevent CMake dev warnings in Cmake >= 3.24 due to new policy
Browse files Browse the repository at this point in the history
  • Loading branch information
ptheywood authored and Robadob committed Aug 10, 2022
1 parent 3e230bc commit 31cefa0
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 1 deletion.
7 changes: 6 additions & 1 deletion cmake/dependencies/devil.cmake
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# DevIL
# Ensure that DevIL is available, either by finding DevIL, or by downloading DevIL if required (on windows)

if(UNIX)
# On Linux, if DevIL is not available the user is instructed to install it themselves.
find_package(DevIL)
Expand All @@ -9,6 +8,12 @@ if(UNIX)
"e.g. sudo apt install libdevil-dev")
endif()
elseif(WIN32)

# As the URL method is used for download, set the policy if available
if(POLICY CMP0135)
cmake_policy(SET CMP0135 NEW)
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
FetchContent_Declare(
Expand Down
4 changes: 4 additions & 0 deletions cmake/dependencies/glew.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ if(UNIX)
"e.g. sudo apt install libglew-dev")
endif ()
elseif(WIN32)
# As the URL method is used for download, set the policy if available
if(POLICY CMP0135)
cmake_policy(SET CMP0135 NEW)
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
FetchContent_Declare(
Expand Down
5 changes: 5 additions & 0 deletions cmake/dependencies/glm.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ if(NOT glm_FOUND)
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/../modules/ ${CMAKE_MODULE_PATH})
include(FetchContent)

# As the URL method is used for download, set the policy if available
if(POLICY CMP0135)
cmake_policy(SET CMP0135 NEW)
endif()

# Head of master at point BugFix for NVRTC support was merged
FetchContent_Declare(
glm
Expand Down
4 changes: 4 additions & 0 deletions cmake/dependencies/sdl2.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ if(UNIX)
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
if(POLICY CMP0135)
cmake_policy(SET CMP0135 NEW)
endif()
FetchContent_Declare(
SDL2
URL "https://www.libsdl.org/release/SDL2-devel-2.0.12-VC.zip"
Expand Down

0 comments on commit 31cefa0

Please sign in to comment.