Changeset 11692 for code/trunk/cmake
- Timestamp:
- Jan 3, 2018, 1:43:20 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/cmake/tools/TargetUtilities.cmake
r10716 r11692 469 469 470 470 471 # Creates a helper file with name < name_of_the_library>.<extension>471 # Creates a helper file with name <target_name>.<extension> and content <filename_of_the_library> 472 472 # This helps finding dynamically loadable modules or plugins at runtime 473 473 474 474 FUNCTION(ADD_MODULE_OR_PLUGIN _target_name _output_dir _install_dir _extension) 475 # We use the properties to get the name because the librarys name may differ from476 # the target name (for example orxonox <-> liborxonox)477 IF (POLICY CMP0026)478 CMAKE_POLICY(PUSH)479 CMAKE_POLICY(SET CMP0026 OLD) # we only use the file's name, not its actual location, so the old policy is fine480 ENDIF()481 GET_TARGET_PROPERTY(_target_loc ${_target_name} LOCATION)482 GET_FILENAME_COMPONENT(_target_filename ${_target_loc} NAME_WE)483 IF (POLICY CMP0026)484 CMAKE_POLICY(POP) # set policy back to original settings485 ENDIF()486 475 487 476 IF(CMAKE_CONFIGURATION_TYPES) 488 477 FOREACH(_config ${CMAKE_CONFIGURATION_TYPES}) 489 SET(_helper_filename ${_output_dir}/${_config}/${_target_ filename}${_extension})490 491 FILE( WRITE ${_helper_filename} ${_target_name})478 SET(_helper_filename ${_output_dir}/${_config}/${_target_name}${_extension}) 479 480 FILE(GENERATE OUTPUT ${_helper_filename} CONTENT $<TARGET_FILE_NAME:${_target_name}>) 492 481 493 482 INSTALL( … … 498 487 ENDFOREACH() 499 488 ELSE() 500 SET(_helper_filename ${_output_dir}/${_target_ filename}${_extension})501 502 FILE( WRITE ${_helper_filename} ${_target_name})489 SET(_helper_filename ${_output_dir}/${_target_name}${_extension}) 490 491 FILE(GENERATE OUTPUT ${_helper_filename} CONTENT $<TARGET_FILE_NAME:${_target_name}>) 503 492 504 493 INSTALL(
Note: See TracChangeset
for help on using the changeset viewer.