Skip to content

Commit

Permalink
Set CMP0072 (find opengl) to NEW behavior
Browse files Browse the repository at this point in the history
(cherry picked from commit ddb6d60)
  • Loading branch information
9prady9 committed Feb 10, 2020
1 parent 5870911 commit bfb473b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ include(FGInstallDirs)
include(ForgeInternalUtils)
include(ForgePlatformSetup)

set_policies(
TYPE NEW
POLICIES CMP0072)

option(BUILD_SHARED_LIBS "Build shared/static library" ON)
option(FG_ENABLE_HUNTER "Use Hunter cmake package handler" OFF)

Expand Down
9 changes: 9 additions & 0 deletions CMakeModules/ForgeInternalUtils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,12 @@ mark_as_advanced(
CUDA_TOOLKIT_ROOT_DIR
CUDA_USE_STATIC_CUDA_RUNTIME
CUDA_rt_LIBRARY)

macro(set_policies)
cmake_parse_arguments(SP "" "TYPE" "POLICIES" ${ARGN})
foreach(_policy ${SP_POLICIES})
if(POLICY ${_policy})
cmake_policy(SET ${_policy} ${SP_TYPE})
endif()
endforeach()
endmacro()

0 comments on commit bfb473b

Please sign in to comment.