[Orxonox-commit 5523] r10186 - in code/trunk: cmake/tools src
landauf at orxonox.net
landauf at orxonox.net
Sat Jan 10 14:35:30 CET 2015
Author: landauf
Date: 2015-01-10 14:35:30 +0100 (Sat, 10 Jan 2015)
New Revision: 10186
Modified:
code/trunk/cmake/tools/TargetUtilities.cmake
code/trunk/src/CMakeLists.txt
Log:
trying to make cmake policy settings backwards compatible
Modified: code/trunk/cmake/tools/TargetUtilities.cmake
===================================================================
--- code/trunk/cmake/tools/TargetUtilities.cmake 2015-01-10 13:22:06 UTC (rev 10185)
+++ code/trunk/cmake/tools/TargetUtilities.cmake 2015-01-10 13:35:30 UTC (rev 10186)
@@ -446,11 +446,15 @@
FUNCTION(ADD_MODULE _target)
# We use the properties to get the name because the librarys name may differ from
# the target name (for example orxonox <-> liborxonox)
-
- CMAKE_POLICY(SET CMP0026 OLD) # we only use the file's name, not its actual location, so the old policy is fine
+ IF (POLICY CMP0026)
+ CMAKE_POLICY(PUSH)
+ CMAKE_POLICY(SET CMP0026 OLD) # we only use the file's name, not its actual location, so the old policy is fine
+ ENDIF()
GET_TARGET_PROPERTY(_target_loc ${_target} LOCATION)
GET_FILENAME_COMPONENT(_target_name ${_target_loc} NAME_WE)
- CMAKE_POLICY(SET CMP0026 NEW) # set policy back to 'new'
+ IF (POLICY CMP0026)
+ CMAKE_POLICY(POP) # set policy back to original settings
+ ENDIF()
IF(CMAKE_CONFIGURATION_TYPES)
FOREACH(_config ${CMAKE_CONFIGURATION_TYPES})
Modified: code/trunk/src/CMakeLists.txt
===================================================================
--- code/trunk/src/CMakeLists.txt 2015-01-10 13:22:06 UTC (rev 10185)
+++ code/trunk/src/CMakeLists.txt 2015-01-10 13:35:30 UTC (rev 10186)
@@ -72,11 +72,16 @@
ADD_DEPENDENCIES(orxonox-main ${ORXONOX_MODULES})
# Get name to configure the run scripts
-CMAKE_POLICY(SET CMP0026 OLD) # we only use the file's name, not its actual location, so the old policy is fine
+IF (POLICY CMP0026)
+ CMAKE_POLICY(PUSH)
+ CMAKE_POLICY(SET CMP0026 OLD) # we only use the file's name, not its actual location, so the old policy is fine
+ENDIF()
GET_TARGET_PROPERTY(_exec_loc orxonox-main LOCATION)
GET_FILENAME_COMPONENT(_exec_name ${_exec_loc} NAME)
SET(ORXONOX_EXECUTABLE_NAME ${_exec_name} CACHE INTERNAL "")
-CMAKE_POLICY(SET CMP0026 NEW) # set policy back to 'new'
+IF (POLICY CMP0026)
+ CMAKE_POLICY(POP) # set policy back to original settings
+ENDIF()
# Apple Mac OS X specific build settings
More information about the Orxonox-commit
mailing list