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>
This commit is contained in:
parent
ae38a70d1e
commit
f2e9dc5530
|
@ -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
|
||||
|
||||
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
|
||||
|
||||
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
|
||||
|
|
Loading…
Reference in New Issue