Skip to content
Permalink
Browse files

cmake: check for policy CMP0077 existence

Check `if(POLICY CMP0077)` before trying to set it, because setting a
policy a version of cmake does not know about is an error.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
  • Loading branch information
rkitover committed Mar 26, 2019
1 parent ae38a70 commit f2e9dc55309643492bf65534b2d9123f4af20927
Showing with 8 additions and 2 deletions.
  1. +4 −1 CMakeLists.txt
  2. +4 −1 src/wx/CMakeLists.txt
@@ -1,7 +1,10 @@
if(COMMAND cmake_policy)
cmake_policy(SET CMP0003 NEW) # link to full path of libs
cmake_policy(SET CMP0005 NEW) # escapes in add_definitions
cmake_policy(SET CMP0077 NEW) # use vars for options

if(POLICY CMP0077)
cmake_policy(SET CMP0077 NEW) # use vars for options
endif()

if(NOT CMAKE_VERSION VERSION_LESS 3.0)
cmake_policy(SET CMP0043 NEW) # for wxWidgets, use generator expressions
@@ -3,7 +3,10 @@
if(COMMAND cmake_policy)
cmake_policy(SET CMP0003 NEW) # link to full path of libs
cmake_policy(SET CMP0005 NEW) # escapes in add_definitions
cmake_policy(SET CMP0077 NEW) # use vars for options

if(POLICY CMP0077)
cmake_policy(SET CMP0077 NEW) # use vars for options
endif()

if(NOT CMAKE_VERSION VERSION_LESS 3.0)
cmake_policy(SET CMP0043 NEW) # for wxWidgets, use generator expressions

0 comments on commit f2e9dc5

Please sign in to comment.
You can’t perform that action at this time.