Changeset 7908 for code/forks/sandbox_light/cmake/tools
- Timestamp:
- Feb 17, 2011, 5:47:22 AM (14 years ago)
- Location:
- code/forks/sandbox_light/cmake/tools
- Files:
-
- 10 deleted
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/forks/sandbox_light/cmake/tools/TargetUtilities.cmake
r7818 r7908 34 34 # NO_DLL_INTERFACE: Link statically with MSVC 35 35 # NO_SOURCE_GROUPS: Don't create msvc source groups 36 # MODULE: For dynamic module libraries (libraries only)37 36 # WIN32: Inherited from ADD_EXECUTABLE (executables only) 38 37 # PCH_NO_DEFAULT: Do not make precompiled header files default if … … 46 45 # SOURCE_FILES: Source files for the target 47 46 # DEFINE_SYMBOL: Sets the DEFINE_SYMBOL target property 48 # TOLUA_FILES: Files with tolua interface49 47 # PCH_FILE: Precompiled header file 50 48 # PCH_EXCLUDE: Source files to be excluded from PCH support … … 60 58 INCLUDE(CMakeDependentOption) 61 59 INCLUDE(CapitaliseName) 62 INCLUDE(GenerateToluaBindings)63 60 INCLUDE(ParseMacroArguments) 64 61 INCLUDE(SourceFileUtilities) … … 85 82 NO_INSTALL NO_VERSION ${_additional_switches}) 86 83 SET(_list_names LINK_LIBRARIES VERSION SOURCE_FILES 87 DEFINE_SYMBOL TOLUA_FILESPCH_FILE84 DEFINE_SYMBOL PCH_FILE 88 85 PCH_EXCLUDE OUTPUT_NAME) 89 86 … … 165 162 LIST(REMOVE_DUPLICATES _${_target_name}_files) 166 163 167 # TOLUA_FILES168 IF(_arg_TOLUA_FILES)169 GENERATE_TOLUA_BINDINGS(${_target_name_capitalised} _${_target_name}_files170 INPUTFILES ${_arg_TOLUA_FILES})171 ENDIF()172 173 164 # First part (pre target) of precompiled header files 174 165 IF(PCH_COMPILER_SUPPORT AND _arg_PCH_FILE) … … 258 249 ENDIF() 259 250 260 # Configure modules261 IF (_arg_MODULE)262 SET_TARGET_PROPERTIES(${_target_name} PROPERTIES263 RUNTIME_OUTPUT_DIRECTORY ${CMAKE_MODULE_OUTPUT_DIRECTORY} # Windows264 LIBRARY_OUTPUT_DIRECTORY ${CMAKE_MODULE_OUTPUT_DIRECTORY} # Unix265 )266 ADD_MODULE(${_target_name})267 # Ensure that the main program depends on the module268 SET(ORXONOX_MODULES ${ORXONOX_MODULES} ${_target_name} CACHE STRING "" FORCE)269 ENDIF()270 271 251 # Static library flags are not globally available 272 252 IF(ORXONOX_STATIC_LINKER_FLAGS) … … 306 286 # Install all targets except for static ones (executables also have SHARED in _link_mode) 307 287 IF(${_link_mode} STREQUAL "SHARED" AND NOT _arg_NO_INSTALL) 308 IF(_arg_MODULE) 309 INSTALL(TARGETS ${_target_name} 310 RUNTIME DESTINATION ${MODULE_INSTALL_DIRECTORY} 311 LIBRARY DESTINATION ${MODULE_INSTALL_DIRECTORY} 312 ) 313 ELSE() 314 INSTALL(TARGETS ${_target_name} 315 RUNTIME DESTINATION ${RUNTIME_INSTALL_DIRECTORY} 316 LIBRARY DESTINATION ${LIBRARY_INSTALL_DIRECTORY} 317 ) 318 ENDIF() 288 INSTALL(TARGETS ${_target_name} 289 RUNTIME DESTINATION ${RUNTIME_INSTALL_DIRECTORY} 290 LIBRARY DESTINATION ${LIBRARY_INSTALL_DIRECTORY} 291 ) 319 292 ENDIF() 320 293 321 294 ENDMACRO(TU_ADD_TARGET) 322 323 324 # Creates a helper file with name <name_of_the_library>${ORXONOX_MODULE_EXTENSION}325 # This helps finding dynamically loadable modules at runtime326 327 FUNCTION(ADD_MODULE _target)328 # We use the properties to get the name because the librarys name may differ from329 # the target name (for example orxonox <-> liborxonox)330 331 GET_TARGET_PROPERTY(_target_loc ${_target} LOCATION)332 GET_FILENAME_COMPONENT(_target_name ${_target_loc} NAME_WE)333 334 IF(CMAKE_CONFIGURATION_TYPES)335 FOREACH(_config ${CMAKE_CONFIGURATION_TYPES})336 SET(_module_filename ${CMAKE_MODULE_OUTPUT_DIRECTORY}/${_config}/${_target_name}${ORXONOX_MODULE_EXTENSION})337 338 FILE(WRITE ${_module_filename})339 340 INSTALL(341 FILES ${_module_filename}342 DESTINATION ${MODULE_INSTALL_DIRECTORY}343 CONFIGURATIONS ${_config}344 )345 ENDFOREACH()346 ELSE()347 SET(_module_filename ${CMAKE_MODULE_OUTPUT_DIRECTORY}/${_target_name}${ORXONOX_MODULE_EXTENSION})348 349 FILE(WRITE ${_module_filename})350 351 INSTALL(352 FILES ${_module_filename}353 DESTINATION ${MODULE_INSTALL_DIRECTORY}354 )355 ENDIF()356 ENDFUNCTION(ADD_MODULE)
Note: See TracChangeset
for help on using the changeset viewer.