Changeset 5693 for code/trunk/cmake
- Timestamp:
- Aug 29, 2009, 10:19:38 PM (15 years ago)
- Location:
- code/trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
/code/branches/libraries (added) merged: 5612-5613,5615-5619,5621-5623,5625-5640,5642-5643,5647-5649,5665-5666,5685-5687,5692
- Property svn:mergeinfo changed
-
code/trunk/cmake/BuildConfig.cmake
r3330 r5693 31 31 SET(DEFAULT_LIBRARY_PATH lib) 32 32 SET(DEFAULT_ARCHIVE_PATH lib/static) 33 SET(DEFAULT_MODULE_PATH lib/modules) 33 34 SET(DEFAULT_DOC_PATH doc) 34 35 SET(DEFAULT_MEDIA_PATH media) … … 40 41 SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${DEFAULT_LIBRARY_PATH}) 41 42 SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${DEFAULT_ARCHIVE_PATH}) 43 SET(CMAKE_MODULE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${DEFAULT_MODULE_PATH}) 42 44 # Do not set doc and media, rather check in the two subdirectories 43 45 # whether they concur with the DEFAULT_..._PATH … … 70 72 ENDIF() 71 73 74 # Set the extension of the dynamic modules 75 SET(ORXONOX_MODULE_EXTENSION ".module") 72 76 73 77 ################# OGRE Plugins ################## … … 132 136 SET(ORXONOX_LIBRARY_INSTALL_PATH ${DEFAULT_LIBRARY_PATH}) 133 137 SET(ORXONOX_ARCHIVE_INSTALL_PATH ${DEFAULT_ARCHIVE_PATH}) 138 SET(ORXONOX_MODULE_INSTALL_PATH ${DEFAULT_MODULE_PATH}) 134 139 SET(ORXONOX_DOC_INSTALL_PATH ${DEFAULT_DOC_PATH}) 135 140 SET(ORXONOX_MEDIA_INSTALL_PATH ${DEFAULT_MEDIA_PATH}) … … 142 147 SET(ORXONOX_LIBRARY_INSTALL_PATH ${CMAKE_INSTALL_PREFIX}/lib/orxonox) 143 148 SET(ORXONOX_ARCHIVE_INSTALL_PATH ${CMAKE_INSTALL_PREFIX}/lib/orxonox/static) 149 SET(ORXONOX_MODULE_INSTALL_PATH ${CMAKE_INSTALL_PREFIX}/lib/orxonox/modules) 144 150 SET(ORXONOX_DOC_INSTALL_PATH ${CMAKE_INSTALL_PREFIX}/share/doc/orxonox) 145 151 SET(ORXONOX_MEDIA_INSTALL_PATH ${CMAKE_INSTALL_PREFIX}/share/orxonox) … … 152 158 SET(ORXONOX_LIBRARY_INSTALL_PATH ${CMAKE_INSTALL_PREFIX}/${DEFAULT_LIBRARY_PATH}) 153 159 SET(ORXONOX_ARCHIVE_INSTALL_PATH ${CMAKE_INSTALL_PREFIX}/${DEFAULT_ARCHIVE_PATH}) 160 SET(ORXONOX_MODULE_INSTALL_PATH ${CMAKE_INSTALL_PREFIX}/${DEFAULT_MODULE_PATH}) 154 161 SET(ORXONOX_DOC_INSTALL_PATH ${CMAKE_INSTALL_PREFIX}/${DEFAULT_DOC_PATH}) 155 162 SET(ORXONOX_MEDIA_INSTALL_PATH ${CMAKE_INSTALL_PREFIX}/${DEFAULT_MEDIA_PATH}) … … 167 174 # when building, don't use the install RPATH already 168 175 # (but later on when installing) 169 SET(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE) 176 SET(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE) 170 177 171 178 # the RPATH to be used when installing -
code/trunk/cmake/TargetUtilities.cmake
r3371 r5693 24 24 # accepts a lot more input information. Simply supply the keywords 25 25 # described below in any order you wish. 26 # The output is then stored in "_arg_ARGNAME" where ARGNAME is the the 27 # name of the switch or list. 26 28 # 27 29 # Switches: (when given --> TRUE, FALSE otherwise) … … 33 35 # NO_SOURCE_GROUPS: Don't create msvc source groups 34 36 # STATIC/SHARED: Inherited from ADD_LIBRARY 37 # MODULE: For dynamic module libraries 35 38 # WIN32: Inherited from ADD_EXECUTABLE 36 39 # PCH_NO_DEFAULT: Do not make precompiled header files default if 37 40 # specified with PCH_FILE 41 # NO_INSTALL: Do not install the target at all 42 # 38 43 # Lists: 39 44 # LINK_LIBRARIES: Redirects to TARGET_LINK_LIBRARIES … … 44 49 # PCH_FILE: Precompiled header file 45 50 # PCH_EXCLUDE: Source files to be excluded from PCH support 51 # OUTPUT_NAME: If you want a different name than the target name 46 52 # Note: 47 53 # This function also installs the target! … … 75 81 SET(_switches FIND_HEADER_FILES EXCLUDE_FROM_ALL ORXONOX_EXTERNAL 76 82 NO_DLL_INTERFACE NO_SOURCE_GROUPS ${_additional_switches} 77 PCH_NO_DEFAULT NO_INSTALL)83 PCH_NO_DEFAULT NO_INSTALL MODULE) 78 84 SET(_list_names LINK_LIBRARIES VERSION SOURCE_FILES DEFINE_SYMBOL 79 TOLUA_FILES PCH_FILE PCH_EXCLUDE )85 TOLUA_FILES PCH_FILE PCH_EXCLUDE OUTPUT_NAME) 80 86 PARSE_MACRO_ARGUMENTS("${_switches}" "${_list_names}" ${ARGN}) 81 87 … … 142 148 ENDIF() 143 149 150 # MODULE A 151 # Always create shared libraries 152 IF(_arg_MODULE) 153 SET(_arg_SHARED SHARED) 154 SET(_arg_STATIC) 155 ENDIF() 156 144 157 # Add the library/executable 145 158 IF("${_target_type}" STREQUAL "LIBRARY") … … 151 164 ENDIF() 152 165 166 # MODULE B 167 IF (_arg_MODULE) 168 SET_TARGET_PROPERTIES(${_target_name} PROPERTIES 169 RUNTIME_OUTPUT_DIRECTORY ${CMAKE_MODULE_OUTPUT_DIRECTORY} # Windows 170 LIBRARY_OUTPUT_DIRECTORY ${CMAKE_MODULE_OUTPUT_DIRECTORY} # Unix 171 ) 172 ADD_MODULE(${_target_name}) 173 ENDIF() 174 153 175 # LINK_LIBRARIES 154 176 IF(_arg_LINK_LIBRARIES) … … 168 190 ENDIF() 169 191 192 # OUTPUT_NAME 193 IF(_arg_OUTPUT_NAME) 194 SET_TARGET_PROPERTIES(${_target_name} PROPERTIES OUTPUT_NAME ${_arg_OUTPUT_NAME}) 195 ENDIF() 196 170 197 # Second part of precompiled header files 171 198 IF(PCH_COMPILER_SUPPORT AND PCH_ENABLE_${_target_name_upper} AND _arg_PCH_FILE) … … 174 201 175 202 IF(NOT _arg_STATIC AND NOT _arg_NO_INSTALL) 176 INSTALL(TARGETS ${_target_name} 177 RUNTIME DESTINATION ${ORXONOX_RUNTIME_INSTALL_PATH} 178 LIBRARY DESTINATION ${ORXONOX_LIBRARY_INSTALL_PATH} 179 #ARCHIVE DESTINATION ${ORXONOX_ARCHIVE_INSTALL_PATH} 203 IF(_arg_MODULE) 204 INSTALL(TARGETS ${_target_name} 205 RUNTIME DESTINATION ${ORXONOX_MODULE_INSTALL_PATH} 206 LIBRARY DESTINATION ${ORXONOX_MODULE_INSTALL_PATH} 207 ) 208 ELSE() 209 INSTALL(TARGETS ${_target_name} 210 RUNTIME DESTINATION ${ORXONOX_RUNTIME_INSTALL_PATH} 211 LIBRARY DESTINATION ${ORXONOX_LIBRARY_INSTALL_PATH} 212 ) 213 ENDIF() 214 ENDIF() 215 216 ENDFUNCTION(TU_ADD_TARGET) 217 218 219 # Creates a helper file with name <name_of_the_library>.module 220 # This helps finding dynamically loadable modules at runtime 221 222 FUNCTION(ADD_MODULE _target) 223 # We use the properties to get the name because the librarys name may differ from 224 # the target name (for example orxonox <-> liborxonox) 225 226 GET_TARGET_PROPERTY(_target_loc ${_target} LOCATION) 227 GET_FILENAME_COMPONENT(_target_name ${_target_loc} NAME_WE) 228 229 IF(CMAKE_CONFIGURATION_TYPES) 230 FOREACH(_config ${CMAKE_CONFIGURATION_TYPES}) 231 SET(_module_filename ${CMAKE_MODULE_OUTPUT_DIRECTORY}/${_config}/${_target_name}${ORXONOX_MODULE_EXTENSION}) 232 233 FILE(WRITE ${_module_filename}) 234 235 INSTALL( 236 FILES ${_module_filename} 237 DESTINATION ${ORXONOX_MODULE_INSTALL_PATH} 238 CONFIGURATIONS ${_config} 239 ) 240 ENDFOREACH() 241 ELSE() 242 SET(_module_filename ${CMAKE_MODULE_OUTPUT_DIRECTORY}/${_target_name}${ORXONOX_MODULE_EXTENSION}) 243 244 FILE(WRITE ${_module_filename}) 245 246 INSTALL( 247 FILES ${_module_filename} 248 DESTINATION ${ORXONOX_MODULE_INSTALL_PATH} 180 249 ) 181 250 ENDIF() 182 183 ENDFUNCTION(TU_ADD_TARGET) 251 ENDFUNCTION(ADD_MODULE)
Note: See TracChangeset
for help on using the changeset viewer.