Changeset 9473 for code/branches/testing/src/SourceConfig.cmake
- Timestamp:
- Nov 29, 2012, 5:49:02 PM (12 years ago)
- File:
-
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
code/branches/testing/src/SourceConfig.cmake
r9470 r9473 26 26 # Required macros and functions 27 27 INCLUDE(FlagUtilities) 28 INCLUDE(TargetUtilities)29 30 # Configure the two headers and set some options31 INCLUDE(OrxonoxConfig.cmake)32 28 33 29 ####### Library Behaviour (dependencies) ######## … … 148 144 SET(TOLUA_PARSER_HOOK_SCRIPT ${CMAKE_CURRENT_SOURCE_DIR}/libraries/core/ToluaInterfaceHook.lua) 149 145 SET(TOLUA_PARSER_DEPENDENCIES ${TOLUA_PARSER_DEPENDENCIES} ${TOLUA_PARSER_HOOK_SCRIPT}) 150 151 ################ Sub Directories ################152 153 ADD_SUBDIRECTORY(external)154 ADD_SUBDIRECTORY(libraries)155 ADD_SUBDIRECTORY(orxonox)156 SET(ORXONOX_MODULES CACHE INTERNAL "")157 ADD_SUBDIRECTORY(modules)158 159 ################## Executable ###################160 161 INCLUDE_DIRECTORIES(162 ${CMAKE_CURRENT_SOURCE_DIR}/libraries163 ${CMAKE_CURRENT_SOURCE_DIR}/orxonox164 )165 166 # Translate argument167 IF(ORXONOX_USE_WINMAIN)168 SET(ORXONOX_WIN32 WIN32)169 ENDIF()170 171 SET(ORXONOX_MAIN_FILES Orxonox.cc)172 173 # Add special source file for OS X174 IF(APPLE)175 LIST(APPEND ORXONOX_MAIN_FILES OrxonoxMac.mm)176 ENDIF()177 178 ORXONOX_ADD_EXECUTABLE(orxonox-main179 # When defined as WIN32 this removes the console window on Windows180 ${ORXONOX_WIN32}181 LINK_LIBRARIES182 orxonox183 SOURCE_FILES184 ${ORXONOX_MAIN_FILES}185 OUTPUT_NAME orxonox186 )187 # Main executable should depend on all modules188 ADD_DEPENDENCIES(orxonox-main ${ORXONOX_MODULES})189 190 # Get name to configure the run scripts191 GET_TARGET_PROPERTY(_exec_loc orxonox-main LOCATION)192 GET_FILENAME_COMPONENT(_exec_name ${_exec_loc} NAME)193 SET(ORXONOX_EXECUTABLE_NAME ${_exec_name} CACHE INTERNAL "")194 195 196 # When using Visual Studio we want to use the output directory as working197 # directory and we also want to specify where the external dlls198 # (lua, ogre, etc.) are. The problem hereby is that these information cannot199 # be specified in CMake because they are not stored in the actual project file.200 # This workaround will create a configured *.vcproj.user file that holds the201 # right values. When starting the solution for the first time,202 # these get written to the *vcproj.yourPCname.yourname.user203 IF(MSVC)204 IF(CMAKE_CL_64)205 SET(MSVC_PLATFORM "x64")206 ELSE()207 SET(MSVC_PLATFORM "Win32")208 ENDIF()209 IF(MSVC10)210 CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/orxonox-main.vcxproj.user.in" "${CMAKE_CURRENT_BINARY_DIR}/orxonox-main.vcxproj.user")211 ELSE()212 STRING(REGEX REPLACE "^Visual Studio ([0-9][0-9]?).*$" "\\1"213 VISUAL_STUDIO_VERSION_SIMPLE "${CMAKE_GENERATOR}")214 CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/orxonox-main.vcproj.user.in" "${CMAKE_CURRENT_BINARY_DIR}/orxonox-main.vcproj.user")215 ENDIF()216 ENDIF(MSVC)217 218 # Apple Mac OS X specific build settings219 IF(APPLE)220 # On Apple we need to link to AppKit and Foundation frameworks221 TARGET_LINK_LIBRARIES(orxonox-main222 "-framework AppKit"223 "-framework Foundation"224 )225 226 # Post-build step for the creation of the Dev-App bundle227 INCLUDE(PrepareDevBundle)228 ADD_CUSTOM_COMMAND(229 TARGET orxonox-main230 POST_BUILD231 # Copy the executable into the Orxonox.app232 COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/${ORXONOX_EXECUTABLE_NAME}" "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/${PROJECT_NAME}.app/Contents/MacOS"233 # Copy the dev-build marker file to Orxonox.app234 COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/orxonox_dev_build.keep_me" "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/${PROJECT_NAME}.app/Contents/MacOS"235 # Create a shortcut of the application to the root of the build tree236 COMMAND ${CMAKE_COMMAND} -E create_symlink "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/${PROJECT_NAME}.app" "${CMAKE_BINARY_DIR}/${PROJECT_NAME}.app"237 )238 ENDIF(APPLE)239 240 #################### Doxygen ####################241 242 # Prepare include paths for Doxygen. This is necessary to display243 # the correct path to use when including a file, e.g.244 # core/XMLPort.h instead of src/core/XMLPort.h245 246 INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/modules)247 GET_DIRECTORY_PROPERTY(_temp INCLUDE_DIRECTORIES)248 # Replace ';' by spaces249 STRING(REPLACE ";" " " _temp "${_temp}")250 SET(DOXYGEN_INCLUDE_DIRECTORIES "${_temp}" PARENT_SCOPE)
Note: See TracChangeset
for help on using the changeset viewer.