Changeset 5626 for code/branches/libraries/cmake
- Timestamp:
- Aug 11, 2009, 10:22:55 PM (15 years ago)
- Location:
- code/branches/libraries/cmake
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/libraries/cmake/BuildConfig.cmake
r5625 r5626 172 172 # when building, don't use the install RPATH already 173 173 # (but later on when installing) 174 SET(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE) 174 SET(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE) 175 175 176 176 # the RPATH to be used when installing -
code/branches/libraries/cmake/TargetUtilities.cmake
r5615 r5626 35 35 # NO_SOURCE_GROUPS: Don't create msvc source groups 36 36 # STATIC/SHARED: Inherited from ADD_LIBRARY 37 # PLUGIN: For dynamic plugin libraries 37 38 # WIN32: Inherited from ADD_EXECUTABLE 38 39 # PCH_NO_DEFAULT: Do not make precompiled header files default if … … 80 81 SET(_switches FIND_HEADER_FILES EXCLUDE_FROM_ALL ORXONOX_EXTERNAL 81 82 NO_DLL_INTERFACE NO_SOURCE_GROUPS ${_additional_switches} 82 PCH_NO_DEFAULT NO_INSTALL)83 PCH_NO_DEFAULT NO_INSTALL PLUGIN) 83 84 SET(_list_names LINK_LIBRARIES VERSION SOURCE_FILES DEFINE_SYMBOL 84 85 TOLUA_FILES PCH_FILE PCH_EXCLUDE OUTPUT_NAME) … … 147 148 ENDIF() 148 149 150 # PLUGIN A 151 IF(_arg_PLUGIN) 152 SET(_arg_PLUGIN MODULE) 153 SET(_arg_SHARED) 154 SET(_arg_STATIC) 155 ENDIF() 156 149 157 # Add the library/executable 150 158 IF("${_target_type}" STREQUAL "LIBRARY") 151 ADD_LIBRARY(${_target_name} ${_arg_STATIC} ${_arg_SHARED} 159 ADD_LIBRARY(${_target_name} ${_arg_STATIC} ${_arg_SHARED} ${_arg_PLUGIN} 152 160 ${_arg_EXCLUDE_FROM_ALL} ${_${_target_name}_files}) 153 161 ELSE() 154 162 ADD_EXECUTABLE(${_target_name} ${_arg_WIN32} ${_arg_EXCLUDE_FROM_ALL} 155 163 ${_${_target_name}_files}) 164 ENDIF() 165 166 # PLUGIN B 167 IF (_arg_PLUGIN) 168 SET_TARGET_PROPERTIES(${_target_name} PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_PLUGIN_OUTPUT_DIRECTORY}) 169 SET_TARGET_PROPERTIES(${_target_name} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_PLUGIN_OUTPUT_DIRECTORY}) 170 ADD_PLUGIN(${_target_name}) 156 171 ENDIF() 157 172 … … 174 189 175 190 # OUTPUT_NAME 176 IF(_arg_OUTPUT_NAME 191 IF(_arg_OUTPUT_NAME) 177 192 SET_TARGET_PROPERTIES(${_target_name} PROPERTIES OUTPUT_NAME ${_arg_OUTPUT_NAME}) 178 193 ENDIF() … … 184 199 185 200 IF(NOT _arg_STATIC AND NOT _arg_NO_INSTALL) 201 SET(_library_destination ${ORXONOX_LIBRARY_INSTALL_PATH}) 202 IF (_arg_PLUGIN) 203 SET(_library_destination ${ORXONOX_PLUGIN_INSTALL_PATH}) 204 ENDIF() 205 186 206 INSTALL(TARGETS ${_target_name} 187 207 RUNTIME DESTINATION ${ORXONOX_RUNTIME_INSTALL_PATH} 188 LIBRARY DESTINATION ${ ORXONOX_LIBRARY_INSTALL_PATH}208 LIBRARY DESTINATION ${_library_destination} 189 209 #ARCHIVE DESTINATION ${ORXONOX_ARCHIVE_INSTALL_PATH} 190 210 ) … … 192 212 193 213 ENDFUNCTION(TU_ADD_TARGET) 214 215 216 # Creates a helper file with name <name_of_the_library>.plugin 217 # This helps finding dynamically loadable plugins at runtime 218 219 FUNCTION(ADD_PLUGIN _name) 220 # We use the properties to get the name because the librarys name may differ from 221 # the targets name (for example orxonox <-> liborxonox) 222 223 GET_TARGET_PROPERTY(_target_loc ${_name} LOCATION) 224 GET_FILENAME_COMPONENT(_target_name ${_target_loc} NAME_WE) 225 226 SET(_plugin_filename "${CMAKE_PLUGIN_OUTPUT_DIRECTORY}/${_target_name}.plugin") 227 228 FILE(WRITE ${_plugin_filename}) 229 230 INSTALL( 231 FILES ${_plugin_filename} 232 DESTINATION ${ORXONOX_PLUGIN_INSTALL_PATH} 233 ) 234 ENDFUNCTION(ADD_PLUGIN)
Note: See TracChangeset
for help on using the changeset viewer.