Changeset 2590
- Timestamp:
- Jan 12, 2009, 5:06:56 PM (16 years ago)
- Location:
- code/branches/buildsystem2
- Files:
-
- 6 added
- 4 deleted
- 6 edited
- 4 copied
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
code/branches/buildsystem2/bin/CMakeLists.txt
r2584 r2590 1 SET(CONFIG_FILES 1 SET(COMMON_CONFIG_FILES 2 orxonox.ini 2 3 def_keybindings.ini 3 4 def_masterKeybindings.ini … … 11 12 # OGRE can't find fonts to display config screen on Tardis, 12 13 # so providing default config file here (bug). 13 SET(CONFIG_FILES ${CONFIG_FILES} 14 linux/run-script 15 tardis/orxonox.ini 16 tardis/ogre.cfg 17 ) 18 19 ELSEIF(UNIX) 20 SET(CONFIG_FILES ${CONFIG_FILES} 21 linux/run-script 22 linux/orxonox.ini 23 ) 14 SET(ADDITIONAL_CONFIG_FILES "ogre.cfg") 24 15 ENDIF(TARDIS) 25 16 26 IF(MINGW) 27 SET(CONFIG_FILES ${CONFIG_FILES} 28 "mingw/orxonox.ini" 29 "mingw/orxonox.bat" 30 ) 31 ENDIF(MINGW) 17 SET(CONFIG_FILES ${COMMON_CONFIG_FILES} ${ADDITIONAL_CONFIG_FILES}) 32 18 33 FOREACH(_FILE ${CONFIG_FILES}) 34 GET_FILENAME_COMPONENT(_filename ${_FILE} NAME) 35 IF (NOT EXISTS ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${_filename}) 36 CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/${_FILE} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${_filename} COPYONLY) 37 ENDIF (NOT EXISTS ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${_filename}) 38 ENDFOREACH(_FILE) 19 # Copy config files to all Visual Studio output directories 20 IF(CMAKE_CONFIGURATION_TYPES) 21 SET(BUILD_CONFIGS ${CMAKE_CONFIGURATION_TYPES}) 22 ELSE(CMAKE_CONFIGURATION_TYPES) 23 SET(CONFIG_OUT_PATHS_REL ".") 24 SET(BUILD_CONFIGS ${CMAKE_BUILD_TYPE}) 25 ENDIF(CMAKE_CONFIGURATION_TYPES) 26 27 FOREACH(_build_config ${BUILD_CONFIGS}) 28 FOREACH(_file_name ${CONFIG_FILES}) 29 # Is there an extra file in bin/Debug or bin/Release? 30 IF(${_build_config} MATCHES "Rel") 31 SET(_build_config_short "Release") 32 ELSE(${_build_config} MATCHES "Rel") 33 SET(_build_config_short "Debug") 34 ENDIF(${_build_config} MATCHES "Rel") 35 IF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${_build_config_short}/${_file_name}) 36 SET(_in_file ${CMAKE_CURRENT_SOURCE_DIR}/${_build_config_short}/${_file_name}) 37 ELSE(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${_build_config_short}/${_file_name}) 38 SET(_in_file ${CMAKE_CURRENT_SOURCE_DIR}/${_file_name}) 39 ENDIF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${_build_config_short}/${_file_name}) 40 41 # Copy to the folder named like the build config for Visual Studio 42 IF(CMAKE_CONFIGURATION_TYPES) 43 SET(_out_file ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${_build_config}/${_file_name}) 44 ELSE(CMAKE_CONFIGURATION_TYPES) 45 SET(_out_file ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${_file_name}) 46 ENDIF(CMAKE_CONFIGURATION_TYPES) 47 # Only copy if target file doesn't exist. This may result in problems but 48 # otherwise we might delete the a user's config 49 IF (NOT EXISTS ${_out_file}) 50 CONFIGURE_FILE(${_in_file} ${_out_file} @ONLY) 51 ENDIF (NOT EXISTS ${_out_file}) 52 ENDFOREACH(_file_name) 53 ENDFOREACH(_build_config) 54 55 # Create a run script for both Windows and Linux in the source root path if 56 # CMake is not used to create multi-configuration project files 57 IF(NOT CMAKE_CONFIGURATION_TYPES) 58 IF(WIN32) 59 SET(RUN_SCRIPT ${ADDITIONAL_CONFIG_FILES} "run.bat") 60 ELSE(UNIX) 61 SET(RUN_SCRIPT ${ADDITIONAL_CONFIG_FILES} "run") 62 ENDIF(WIN32) 63 IF (NOT EXISTS ${CMAKE_SOURCE_DIR}/${RUN_SCRIPT}) 64 CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/${RUN_SCRIPT} ${CMAKE_SOURCE_DIR}/${RUN_SCRIPT} @ONLY) 65 ENDIF (NOT EXISTS ${CMAKE_SOURCE_DIR}/${RUN_SCRIPT}) 66 ENDIF(NOT CMAKE_CONFIGURATION_TYPES) -
code/branches/buildsystem2/bin/run
r2582 r2590 1 1 #!/bin/sh 2 # convenience script for starting orxonox 2 # convenience script for starting orxonox on Linux 3 3 4 cd build/bin && exec ./run-script$@4 cd @EXECUTABLE_OUTPUT_PATH@ && exec ./@ORXONOX_EXECUTABLE_NAME@ $@ -
code/branches/buildsystem2/bin/run.bat
r2582 r2590 1 title Orxonox2 path ..\..\libs;%path%3 orxonox.exe 1 title @PROJECT_NAME@ 2 path @ORXONOX_LIBRARY_BIN_DIR@;%path% 3 @ORXONOX_EXECUTABLE_NAME@ 4 4 pause -
code/branches/buildsystem2/cmake/ConfigMSVC.cmake
r2588 r2590 44 44 MESSAGE(FATAL_ERROR "Could not find dependency directory for the Visual Studio libraries") 45 45 ENDIF(EXISTS ${CMAKE_SOURCE_DIR}/dependencies/orxonox_vc8) 46 SET(ORXONOX_LIBRARY_BIN_DIR ${MSVC_LIBRARY_DIR}/bin) 46 47 47 48 # Set variables for the include directories and the libraries … … 56 57 SET(ENV{OPENALDIR} ${MSVC_LIBRARY_DIR}/openal-1.1) 57 58 SET(ENV{LUA_DIR} ${MSVC_LIBRARY_DIR}/lua-5.1.3) 58 SET(ENV{OGRE_HOME} "${MSVC_LIBRARY_DIR}/ogre-1.4.9;${ MSVC_LIBRARY_DIR}/bin")59 SET(ENV{OGRE_HOME} "${MSVC_LIBRARY_DIR}/ogre-1.4.9;${ORXONOX_LIBRARY_BIN_DIR}") 59 60 SET(TCL_INCLUDE_PATH ${MSVC_LIBRARY_DIR}/tcl-8.5.2/include) 60 61 SET(TCL_LIBRARY ${MSVC_LIBRARY_DIR}/tcl-8.5.2/lib/tcl85t.lib) … … 126 127 127 128 # Set tolua working directory because lua.dll is not where tolua is 128 SET(TOLUA_PARSER_WORKING_DIRECTORY ${ MSVC_LIBRARY_DIR}/bin)129 SET(TOLUA_PARSER_WORKING_DIRECTORY ${ORXONOX_LIBRARY_BIN_DIR}) 129 130 ENDIF (MSVC) -
code/branches/buildsystem2/cmake/ConfigMinGW.cmake
r2583 r2590 42 42 MESSAGE(FATAL_ERROR "Could not find dependency directory for the MinGW libraries") 43 43 ENDIF(EXISTS ${CMAKE_SOURCE_DIR}/libs) 44 44 SET(ORXONOX_LIBRARY_BIN_DIR ${MINGW_LIBRARY_DIR}) 45 45 46 46 # Note: When setting ENV${} variables, make sure to use quotes when -
code/branches/buildsystem2/cmake/ConfigPlatforms.cmake
r2588 r2590 34 34 # When searching for debug libraries, this is appended to the libarary name 35 35 SET(LIBRARY_DEBUG_POSTFIX "_d") 36 # Sets where to find the binary directory of external libraries 37 SET(ORXONOX_LIBRARY_BIN_DIR ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) 36 38 # Working directory for the tolua parser. Adjust for windows because lua.dll has to be there! 37 39 SET(TOLUA_PARSER_WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) -
code/branches/buildsystem2/src/orxonox/CMakeLists.txt
r2588 r2590 25 25 26 26 ADD_EXECUTABLE(orxonox ${ORXONOX_SRC_FILES}) 27 GET_TARGET_PROPERTY(_exec_loc orxonox LOCATION) 28 GET_FILENAME_COMPONENT(_exec_name ${_exec_loc} NAME) 29 SET(ORXONOX_EXECUTABLE_NAME ${_exec_name} CACHE STRING "") 30 MARK_AS_ADVANCED(ORXONOX_EXECUTABLE_NAME) 27 31 28 32 IF(NETWORKTRAFFIC_TESTING_ENABLED) … … 52 56 ) 53 57 58 # When using Visual Studio we want to use the output directory as working 59 # directory and we also want to specify where the external dlls 60 # (lua, ogre, etc.) are. The problem hereby is that these information cannot 61 # be specified in CMake because they are not stored in the actual project file. 62 # This workaround will create a configured *.vcproj.user file that holds the 63 # right values. When starting the solution for the first time, 64 # these get written to the *vcproj.yourPCname.yourname.user 65 IF(MSVC) 66 IF(CMAKE_CL_64) 67 SET(MSVC_PLATFORM "x64") 68 ELSE(CMAKE_CL_64) 69 SET(MSVC_PLATFORM "Win32") 70 ENDIF(CMAKE_CL_64) 71 CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/orxonox.vcproj.user" "${CMAKE_CURRENT_BINARY_DIR}/orxonox.vcproj.user") 72 ENDIF(MSVC) 73 54 74 IF (NOT WIN32) 55 75 INSTALL(TARGETS orxonox RUNTIME DESTINATION bin) -
code/branches/buildsystem2/visual_studio/vc8/orxonox.vcproj
r2569 r2590 77 77 Name="VCPostBuildEventTool" 78 78 Description="Copying default configuration files..." 79 CommandLine="for %%a in ($( RootDir)\bin\msvc\$(SolutionName)\$(ConfigurationName)\*) do replace %%a $(OutDir). /A >nul
for %%a in ($(RootDir)\bin\*) do replace %%a $(OutDir). /A >nul
"79 CommandLine="for %%a in ($(SolutionDir)\bin\$(ConfigurationName)\*) do replace %%a $(OutDir). /A >nul
for %%a in ($(RootDir)\bin\*) do replace %%a $(OutDir). /A >nul
" 80 80 /> 81 81 </Configuration> … … 142 142 Name="VCPostBuildEventTool" 143 143 Description="Copying default configuration files..." 144 CommandLine="for %%a in ($( RootDir)\bin\msvc\$(SolutionName)\$(ConfigurationName)\*) do replace %%a $(OutDir). /A >nul
for %%a in ($(RootDir)\bin\*) do replace %%a $(OutDir). /A >nul
"144 CommandLine="for %%a in ($(SolutionDir)\bin\$(ConfigurationName)\*) do replace %%a $(OutDir). /A >nul
for %%a in ($(RootDir)\bin\*) do replace %%a $(OutDir). /A >nul
" 145 145 /> 146 146 </Configuration>
Note: See TracChangeset
for help on using the changeset viewer.