Changeset 8351 for code/trunk/cmake/tools/TargetUtilities.cmake
- Timestamp:
- Apr 28, 2011, 7:15:14 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/cmake/tools/TargetUtilities.cmake
r8079 r8351 43 43 # Lists: 44 44 # LINK_LIBRARIES: Redirects to TARGET_LINK_LIBRARIES 45 # LINK_LIBS_LINUX: Redirects to TARGET_LINK_LIBRARIES only on Linux 46 # LINK_LIBS_WIN32: Redirects to TARGET_LINK_LIBRARIES only on Windows 47 # LINK_LIBS_APPLE: Redirects to TARGET_LINK_LIBRARIES only on Apple 48 # LINK_LIBS_UNIX: Redirects to TARGET_LINK_LIBRARIES only on UNIX 45 49 # VERSION: Set version to the binary 46 50 # SOURCE_FILES: Source files for the target … … 53 57 # This function also installs the target! 54 58 # Prerequisistes: 55 # ORXONOX_DEFAULT_LINK , ORXONOX_CONFIG_FILES59 # ORXONOX_DEFAULT_LINK 56 60 # Parameters: 57 61 # _target_name, ARGN for the macro arguments … … 86 90 SET(_list_names LINK_LIBRARIES VERSION SOURCE_FILES 87 91 DEFINE_SYMBOL TOLUA_FILES PCH_FILE 88 PCH_EXCLUDE OUTPUT_NAME) 92 PCH_EXCLUDE OUTPUT_NAME LINK_LIBS_LINUX 93 LINK_LIBS_WIN32 LINK_LIBS_APPLE LINK_LIBS_UNIX) 89 94 90 95 PARSE_MACRO_ARGUMENTS("${_switches}" "${_list_names}" ${ARGN}) … … 104 109 MESSAGE(FATAL_ERROR "No name provided for source file compilation") 105 110 ENDIF() 106 IF(NOT _compilation_include_string)107 MESSAGE(STATUS "Warning: Empty source file compilation!")108 ENDIF()109 111 IF(NOT DISABLE_COMPILATIONS) 112 IF(NOT _compilation_include_string) 113 MESSAGE(STATUS "Warning: Empty source file compilation!") 114 ENDIF() 110 115 IF(EXISTS ${_compilation_file}) 111 116 FILE(READ ${_compilation_file} _include_string_file) … … 169 174 GENERATE_TOLUA_BINDINGS(${_target_name_capitalised} _${_target_name}_files 170 175 INPUTFILES ${_arg_TOLUA_FILES}) 176 # Workaround for XCode: The folder where the bind files are written to has 177 # to be present beforehand. 178 IF(CMAKE_CONFIGURATION_TYPES) 179 FOREACH(_dir ${CMAKE_CONFIGURATION_TYPES}) 180 FILE(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${_dir}) 181 ENDFOREACH(_dir) 182 ENDIF() 171 183 ENDIF() 172 184 … … 192 204 193 205 IF(NOT _arg_ORXONOX_EXTERNAL) 194 # Move the prereqs.h file to the configsection206 # Move the ...Prereqs.h and the PCH files to the 'Config' section 195 207 IF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${_target_name_capitalised}Prereqs.h) 196 208 SOURCE_GROUP("Config" FILES ${_target_name_capitalised}Prereqs.h) 197 209 ENDIF() 198 # Add config files to the config section199 LIST(APPEND _${_target_name}_files ${ORXONOX_CONFIG_FILES})200 SOURCE_GROUP("Config" FILES ${ORXONOX_CONFIG_FILES})210 IF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${_arg_PCH_FILE}) 211 SOURCE_GROUP("Config" FILES ${CMAKE_CURRENT_SOURCE_DIR}/${_arg_PCH_FILE}) 212 ENDIF() 201 213 ENDIF() 202 214 ENDIF() … … 217 229 IF(_arg_ORXONOX_EXTERNAL) 218 230 REMOVE_COMPILER_FLAGS("-W3 -W4" MSVC) 219 ADD_COMPILER_FLAGS("-w") 231 ADD_COMPILER_FLAGS("-w" NOT MSVC) 232 ADD_COMPILER_FLAGS("-W0" MSVC) 220 233 ENDIF() 221 234 222 235 # Don't compile header files 223 236 FOREACH(_file ${_${_target_name}_files}) 224 IF(NOT _file MATCHES "\\.(c|cc|cpp|cxx )$")237 IF(NOT _file MATCHES "\\.(c|cc|cpp|cxx|mm)$") 225 238 SET_SOURCE_FILES_PROPERTIES(${_file} PROPERTIES HEADER_FILE_ONLY TRUE) 226 239 ENDIF() … … 278 291 TARGET_LINK_LIBRARIES(${_target_name} ${_arg_LINK_LIBRARIES}) 279 292 ENDIF() 293 IF(_arg_LINK_LIBS_LINUX AND LINUX) 294 TARGET_LINK_LIBRARIES(${_target_name} ${_arg_LINK_LIBS_LINUX}) 295 ENDIF() 296 IF(_arg_LINK_LIBS_WIN32 AND WIN32) 297 TARGET_LINK_LIBRARIES(${_target_name} ${_arg_LINK_LIBS_WIN32}) 298 ENDIF() 299 IF(_arg_LINK_LIBS_APPLE AND APPLE) 300 TARGET_LINK_LIBRARIES(${_target_name} ${_arg_LINK_LIBS_APPLE}) 301 ENDIF() 302 IF(_arg_LINK_LIBS_UNIX AND UNIX) 303 TARGET_LINK_LIBRARIES(${_target_name} ${_arg_LINK_LIBS_UNIX}) 304 ENDIF() 305 306 # RPATH settings for the installation 307 IF("${_target_type}" STREQUAL "LIBRARY") 308 IF(_arg_MODULE) 309 SET(_rpath "${MODULE_RPATH}") 310 ELSE() 311 SET(_rpath "${LIBRARY_RPATH}") 312 ENDIF() 313 ELSE() 314 SET(_rpath "${RUNTIME_RPATH}") 315 ENDIF() 316 SET_TARGET_PROPERTIES(${_target_name} PROPERTIES INSTALL_RPATH "${_rpath}") 280 317 281 318 # DEFINE_SYMBOL
Note: See TracChangeset
for help on using the changeset viewer.