Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10186 for code/trunk


Ignore:
Timestamp:
Jan 10, 2015, 2:35:30 PM (9 years ago)
Author:
landauf
Message:

trying to make cmake policy settings backwards compatible

Location:
code/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/cmake/tools/TargetUtilities.cmake

    r10185 r10186  
    447447  # We use the properties to get the name because the librarys name may differ from
    448448  # the target name (for example orxonox <-> liborxonox)
    449 
    450   CMAKE_POLICY(SET CMP0026 OLD) # we only use the file's name, not its actual location, so the old policy is fine
     449  IF (POLICY CMP0026)
     450    CMAKE_POLICY(PUSH)
     451    CMAKE_POLICY(SET CMP0026 OLD) # we only use the file's name, not its actual location, so the old policy is fine
     452  ENDIF()
    451453  GET_TARGET_PROPERTY(_target_loc ${_target} LOCATION)
    452454  GET_FILENAME_COMPONENT(_target_name ${_target_loc} NAME_WE)
    453   CMAKE_POLICY(SET CMP0026 NEW) # set policy back to 'new'
     455  IF (POLICY CMP0026)
     456    CMAKE_POLICY(POP) # set policy back to original settings
     457  ENDIF()
    454458
    455459  IF(CMAKE_CONFIGURATION_TYPES)
  • code/trunk/src/CMakeLists.txt

    r10185 r10186  
    7373
    7474# Get name to configure the run scripts
    75 CMAKE_POLICY(SET CMP0026 OLD) # we only use the file's name, not its actual location, so the old policy is fine
     75IF (POLICY CMP0026)
     76  CMAKE_POLICY(PUSH)
     77  CMAKE_POLICY(SET CMP0026 OLD) # we only use the file's name, not its actual location, so the old policy is fine
     78ENDIF()
    7679GET_TARGET_PROPERTY(_exec_loc orxonox-main LOCATION)
    7780GET_FILENAME_COMPONENT(_exec_name ${_exec_loc} NAME)
    7881SET(ORXONOX_EXECUTABLE_NAME ${_exec_name} CACHE INTERNAL "")
    79 CMAKE_POLICY(SET CMP0026 NEW) # set policy back to 'new'
     82IF (POLICY CMP0026)
     83  CMAKE_POLICY(POP) # set policy back to original settings
     84ENDIF()
    8085
    8186
Note: See TracChangeset for help on using the changeset viewer.