Changeset 2612 for code/branches
- Timestamp:
- Jan 29, 2009, 10:04:38 PM (16 years ago)
- Location:
- code/branches/buildsystem2
- Files:
-
- 2 edited
- 4 copied
- 4 moved
Legend:
- Unmodified
- Added
- Removed
-
code/branches/buildsystem2/CMakeLists.txt
r2599 r2612 16 16 SET(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake) 17 17 18 # Set binary output directories 19 SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) 20 SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) 21 SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) 18 # Library Config 19 INCLUDE(LibraryConfig) 22 20 23 # Set Debug build to default when not having multi-config generator like msvc 24 IF(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) 25 SET(CMAKE_BUILD_TYPE "Debug") 26 ENDIF(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) 21 # Build Config 22 INCLUDE(BuildConfig) 27 23 28 ############## Platform Config ################## 29 30 # Configure platform specific options 31 INCLUDE(ConfigPlatforms) 32 33 ################ Test options ################### 34 35 OPTION(ENABLE_TESTS "Enable build tests.") 36 IF(ENABLE_TESTS) 37 ENABLE_TESTING() 38 ENDIF(ENABLE_TESTS) 39 40 OPTION(NETWORK_TESTING_ENABLED "Build network testing tools: i.e. chatclient chatserver and alike.") 41 OPTION(NETWORKTRAFFIC_TESTING_ENABLED "Build dummyserver4 and dummyclient4.") 42 43 ############### Library finding ################# 44 45 # Performs the search and sets the variables 46 47 # Expand the next statement if newer boost versions than 1.36.1 are released 48 SET(Boost_ADDITIONAL_VERSIONS 1.37 1.37.0 CACHE STRING "") 49 FIND_PACKAGE(Boost 1.34 REQUIRED thread filesystem) 50 # With MSVC, automatic linking is performed for boost. So wee need to tell 51 # the linker where to find them. Also note that when running FindBoost for the 52 # first time, it will set ${Boost_LIBRARIES} to "" but afterwards to the libs. 53 IF (MSVC) 54 LINK_DIRECTORIES(${Boost_LIBRARY_DIRS}) 55 ENDIF (MSVC) 56 FIND_PACKAGE(OGRE REQUIRED) 57 FIND_PACKAGE(CEGUI REQUIRED) 58 FIND_PACKAGE(ENet REQUIRED) 59 FIND_PACKAGE(OpenAL REQUIRED) 60 FIND_PACKAGE(ALUT REQUIRED) 61 FIND_PACKAGE(OggVorbis REQUIRED) 62 FIND_PACKAGE(ZLIB REQUIRED) 63 FIND_PACKAGE(DirectX REQUIRED) 64 65 # Require Lua 5.0 or 5.1 66 FIND_PACKAGE(Lua50 QUIET) 67 IF(NOT LUA50_FOUND) 68 # Remove variables set by Lua50 and try with Lua51 69 SET(LUA_INCLUDE_DIR) 70 SET(LUA_LIBRARY_lua) 71 SET(LUA_LIBRARY_lualib) 72 SET(LUA_LIBRARIES) 73 FIND_PACKAGE(Lua51 REQUIRED) 74 ENDIF(NOT LUA50_FOUND) 75 # Determine Lua version (Lua50 may also find Lua51) 76 FILE(STRINGS "${LUA_INCLUDE_DIR}/lua.h" LUA_VERSION REGEX "LUA_VERSION") 77 STRING(REGEX REPLACE "^.*\"Lua (.*)\".*$" "\\1" LUA_VERSION "${LUA_VERSION}") 78 79 # QUIET: Don't require the whole tcl rat tail 80 FIND_PACKAGE(TCL QUIET) 81 IF(NOT TCL_FOUND) 82 MESSAGE(FATAL_ERROR "Tcl was not found.") 83 ENDIF(NOT TCL_FOUND) 84 85 # Hide variables created by CMake FindXX scripts 86 MARK_AS_ADVANCED( 87 LUA_LIBRARY_lua 88 LUA_LIBRARY_lualib 89 OPENAL_INCLUDE_DIR 90 OPENAL_LIBRARY 91 ) 92 93 ############### Orxonox Source ################## 94 24 # Creates the actual project 95 25 ADD_SUBDIRECTORY(src) 96 26 -
code/branches/buildsystem2/cmake/BuildConfig.cmake
r2611 r2612 25 25 # ... 26 26 # 27 28 # If you want to set specific options for your platform, simply29 # create a file called "ConfigUser.cmake" in the binary folder30 # (see at the bottom of the file)31 27 32 ############ Misc Default Options ############### 28 ################ Misc Options ################### 29 30 # Set binary output directories 31 SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) 32 SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) 33 SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) 34 35 # Set Debug build to default when not having multi-config generator like msvc 36 IF(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) 37 SET(CMAKE_BUILD_TYPE "Debug") 38 ENDIF(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) 33 39 34 40 # When searching for debug libraries, this is appended to the libarary name … … 55 61 ENDIF(WIN32) 56 62 63 # Check the plugins and determine the plugin folder 64 # You can give a hint by setting the environment variable ENV{OGRE_PLUGIN_DIR} 65 INCLUDE(CheckOGREPlugins) 57 66 58 ###### Default Compiler/Linker Options ##########59 # Most people use GCC to compile orxonox, so use that as default60 67 61 SET(CMAKE_C_FLAGS "$ENV{CFLAGS} ${ORXONOX_WARNING_FLAGS} -fPIC") 62 SET(CMAKE_CXX_FLAGS "$ENV{CXXFLAGS} ${ORXONOX_WARNING_FLAGS} -fPIC") 63 # These flags are added to the flags above 64 SET(CMAKE_C_FLAGS_DEBUG " -g -ggdb") 65 SET(CMAKE_CXX_FLAGS_DEBUG " -g -ggdb") 66 SET(CMAKE_C_FLAGS_RELEASE "-O3 -DNDEBUG") 67 SET(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG") 68 SET(CMAKE_C_FLAGS_RELWITHDEBINFO "-O2 -g -ggdb -DNDEBUG") 69 SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g -ggdb -DNDEBUG") 70 SET(CMAKE_C_FLAGS_MINSIZEREL "-Os -DNDEBUG") 71 SET(CMAKE_CXX_FLAGS_MINSIZEREL "-Os -DNDEBUG") 68 ############## Compiler Config ################## 69 INCLUDE(BuildConfigGCC) 70 INCLUDE(BuildConfigMSVC) 71 # User can create his own file if required 72 IF(EXISTS ${CMAKE_BINARY_DIR}/BuildConfigUser.cmake) 73 INCLUDE(${CMAKE_BINARY_DIR}/BuildConfigUser) 74 ENDIF(EXISTS ${CMAKE_BINARY_DIR}/BuildConfigUser.cmake) 72 75 73 SET(CMAKE_LD_FLAGS "$ENV{LDFLAGS}") 74 SET(CMAKE_EXE_LINKER_FLAGS " --no-undefined") 75 SET(CMAKE_SHARED_LINKER_FLAGS " --no-undefined") 76 SET(CMAKE_MODULE_LINKER_FLAGS " --no-undefined") 76 77 ################ Test options ################### 78 79 OPTION(ENABLE_TESTS "Enable build tests.") 80 IF(ENABLE_TESTS) 81 ENABLE_TESTING() 82 ENDIF(ENABLE_TESTS) 83 84 OPTION(NETWORK_TESTING_ENABLED "Build network testing tools: i.e. chatclient chatserver and alike.") 85 OPTION(NETWORKTRAFFIC_TESTING_ENABLED "Build dummyserver4 and dummyclient4.") 86 87 88 ################### Macros ###################### 77 89 78 90 # Also define macros to easily extend the compiler flags … … 88 100 ENDIF(${_cond}) 89 101 ENDMACRO(ADD_C_FLAGS _flag) 90 91 ########## Plaform Specific Config ##############92 93 # Set the platform specific options and paths94 INCLUDE(ConfigTardis)95 INCLUDE(ConfigMSVC)96 INCLUDE(ConfigMinGW)97 # User can create his own file if required98 IF(EXISTS ${CMAKE_BINARY_DIR}/ConfigUser.cmake)99 INCLUDE(${CMAKE_BINARY_DIR}/ConfigUser)100 ENDIF(EXISTS ${CMAKE_BINARY_DIR}/ConfigUser.cmake) -
code/branches/buildsystem2/cmake/BuildConfigGCC.cmake
r2611 r2612 25 25 # ... 26 26 # 27 28 # If you want to set specific options for your platform, simply29 # create a file called "ConfigUser.cmake" in the binary folder30 # (see at the bottom of the file)31 32 ############ Misc Default Options ###############33 34 # When searching for debug libraries, this is appended to the libarary name35 SET(LIBRARY_DEBUG_POSTFIX "_d")36 # Sets where to find the binary directory of external libraries37 SET(ORXONOX_LIBRARY_BIN_DIR ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})38 # Working directory for the tolua parser. Adjust for windows because lua.dll has to be there!39 SET(TOLUA_PARSER_WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})40 41 OPTION(EXTRA_WARNINGS "Enable some extra warnings (heavily pollutes the output)")42 IF(EXTRA_WARNINGS)43 SET(ORXONOX_WARNING_FLAGS "-Wextra --Wno-unsued-parameter")44 ELSE(EXTRA_WARNINGS)45 SET(ORXONOX_WARNING_FLAGS "-Wall")46 ENDIF(EXTRA_WARNINGS)47 48 SET(ORXONOX_MEDIA_DIRECTORY "${CMAKE_SOURCE_DIR}/../media")49 # More plugins: Plugin_BSPSceneManager, Plugin_OctreeSceneManager50 # Render systems may be optional, but at least one has to be found in FindOgre51 SET(OGRE_PLUGINS RenderSystem_GL RenderSystem_Direct3D9 Plugin_ParticleFX)52 IF(WIN32)53 # CG program manager is probably DirectX related (not available under unix)54 LIST(APPEND OGRE_PLUGINS Plugin_CgProgramManager)55 ENDIF(WIN32)56 57 27 58 28 ###### Default Compiler/Linker Options ########## … … 75 45 SET(CMAKE_SHARED_LINKER_FLAGS " --no-undefined") 76 46 SET(CMAKE_MODULE_LINKER_FLAGS " --no-undefined") 77 78 # Also define macros to easily extend the compiler flags79 # Additional argument is a condition80 MACRO(ADD_CXX_FLAGS _flag _cond)81 IF(${_cond})82 SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${_flag}")83 ENDIF(${_cond})84 ENDMACRO(ADD_CXX_FLAGS _flag)85 MACRO(ADD_C_FLAGS _flag)86 IF(${_cond})87 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${_flag}")88 ENDIF(${_cond})89 ENDMACRO(ADD_C_FLAGS _flag)90 91 ########## Plaform Specific Config ##############92 93 # Set the platform specific options and paths94 INCLUDE(ConfigTardis)95 INCLUDE(ConfigMSVC)96 INCLUDE(ConfigMinGW)97 # User can create his own file if required98 IF(EXISTS ${CMAKE_BINARY_DIR}/ConfigUser.cmake)99 INCLUDE(${CMAKE_BINARY_DIR}/ConfigUser)100 ENDIF(EXISTS ${CMAKE_BINARY_DIR}/ConfigUser.cmake) -
code/branches/buildsystem2/cmake/BuildConfigMSVC.cmake
r2611 r2612 32 32 33 33 IF (MSVC) 34 MESSAGE(STATUS "Running on MSVC. Using customized paths and options.")35 36 ###################### Libraries ########################37 38 # Determine library directory39 IF(EXISTS ${CMAKE_SOURCE_DIR}/dependencies/orxonox_vc8)40 SET(MSVC_LIBRARY_DIR "${CMAKE_SOURCE_DIR}/dependencies/orxonox_vc8")41 ELSEIF(EXISTS ${CMAKE_SOURCE_DIR}/../lib_dist/vc8/dependencies/orxonox_vc8)42 SET(MSVC_LIBRARY_DIR "${CMAKE_SOURCE_DIR}/../lib_dist/vc8/dependencies/orxonox_vc8")43 ELSE(EXISTS ${CMAKE_SOURCE_DIR}/dependencies/orxonox_vc8)44 MESSAGE(FATAL_ERROR "Could not find dependency directory for the Visual Studio libraries")45 ENDIF(EXISTS ${CMAKE_SOURCE_DIR}/dependencies/orxonox_vc8)46 SET(ORXONOX_LIBRARY_BIN_DIR ${MSVC_LIBRARY_DIR}/bin)47 48 # Set variables for the include directories and the libraries49 # Note: When setting ENV${} variables, make sure to use quotes when50 # having multiple directories.51 SET(ENV{BOOST_ROOT} ${MSVC_LIBRARY_DIR}/boost-1.35.0)52 SET(ENV{CEGUIDIR} ${MSVC_LIBRARY_DIR}/cegui-0.6.1)53 SET(ENV{ENETDIR} ${MSVC_LIBRARY_DIR}/enet-1.2)54 SET(ENV{ALUTDIR} ${MSVC_LIBRARY_DIR}/freealut-1.1.0)55 SET(ENV{OGGDIR} ${MSVC_LIBRARY_DIR}/libogg-1.1.3)56 SET(ENV{VORBISDIR} ${MSVC_LIBRARY_DIR}/libvorbis-1.2.0)57 SET(ENV{OPENALDIR} ${MSVC_LIBRARY_DIR}/openal-1.1)58 SET(ENV{LUA_DIR} ${MSVC_LIBRARY_DIR}/lua-5.1.3)59 SET(ENV{OGRE_HOME} "${MSVC_LIBRARY_DIR}/ogre-1.4.9;${ORXONOX_LIBRARY_BIN_DIR}")60 SET(TCL_INCLUDE_PATH ${MSVC_LIBRARY_DIR}/tcl-8.5.2/include)61 SET(TCL_LIBRARY ${MSVC_LIBRARY_DIR}/tcl-8.5.2/lib/tcl85t.lib)62 # Do some hacking to avoid "Tclsh not found" message63 SET(TCL_TCLSH ${MSVC_LIBRARY_DIR}/tcl-8.5.2/lib/tcl85t.lib)64 SET(ZLIB_INCLUDE_DIR ${MSVC_LIBRARY_DIR}/zlib-1.2.3/include)65 SET(ZLIB_LIBRARY optimized ${MSVC_LIBRARY_DIR}/zlib-1.2.3/lib/zlib.lib66 debug ${MSVC_LIBRARY_DIR}/zlib-1.2.3/lib/zlib_d.lib)67 SET(ZLIB_FOUND TRUE)68 34 69 35 #################### Compiler Flags ##################### … … 122 88 SET(CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL "${MSVC_LINKER_FLAGS_RELEASE}") 123 89 124 ######################### Misc ##########################125 126 # Set tolua working directory because lua.dll is not where tolua is127 SET(TOLUA_PARSER_WORKING_DIRECTORY ${ORXONOX_LIBRARY_BIN_DIR})128 90 ENDIF (MSVC) -
code/branches/buildsystem2/cmake/CheckOGREPlugins.cmake
r2611 r2612 1 # Find OGRE includes and library2 #3 # This module defines4 # OGRE_INCLUDE_DIR5 # OGRE_LIBRARY, the library to link against to use OGRE.6 # OGRE_FOUND, If false, do not try to use OGRE7 #8 # Copyright © 2007, Matt Williams9 # Modified by Nicolas Schlumberger to make it work on the Tardis-Infrastucture of the ETH Zurich10 #11 # Redistribution and use is allowed according to the terms of the BSD license.12 #13 # Several changes and additions by Fabian 'x3n' Landau14 # Lots of simplifications by Adrian Friedli15 # Plugin checking by Reto Grieder16 # > www.orxonox.net <17 18 INCLUDE(FindPackageHandleStandardArgs)19 INCLUDE(HandleLibraryTypes)20 21 FIND_PATH(OGRE_INCLUDE_DIR Ogre.h22 PATHS $ENV{OGRE_HOME} /usr/local /usr23 PATH_SUFFIXES include include/OGRE24 )25 FIND_LIBRARY(OGRE_LIBRARY_OPTIMIZED26 NAMES OgreMain27 PATHS $ENV{OGRE_HOME} /usr/local /usr28 PATH_SUFFIXES lib bin/Release bin/release Release release29 )30 FIND_LIBRARY(OGRE_LIBRARY_DEBUG31 NAMES OgreMain${LIBRARY_DEBUG_POSTFIX}32 PATHS $ENV{OGRE_HOME} /usr/local /usr33 PATH_SUFFIXES lib bin/Debug bin/debug Debug debug34 )35 36 FIND_PACKAGE_HANDLE_STANDARD_ARGS(OGRE DEFAULT_MSG37 OGRE_LIBRARY_OPTIMIZED38 OGRE_INCLUDE_DIR39 )40 41 # Set optimized and debug libraries42 HandleLibraryTypes(OGRE)43 44 ###############################################45 # Also make sure we have the required plugins #46 ###############################################47 48 1 IF(WIN32) 49 2 # On Windows we need only *.dll, not *.lib. Especially the MSVC generator doesn't look for *.dll … … 116 69 STRING(REPLACE ";" ", " OGRE_PLUGINS_RELEASE "${OGRE_PLUGINS_RELEASE}") 117 70 STRING(REPLACE ";" ", " OGRE_PLUGINS_DEBUG "${OGRE_PLUGINS_DEBUG}") 118 119 120 MARK_AS_ADVANCED(121 OGRE_LIBRARY122 OGRE_LIBRARY_OPTIMIZED123 OGRE_LIBRARY_DEBUG124 OGRE_INCLUDE_DIR125 ) -
code/branches/buildsystem2/cmake/FindOGRE.cmake
r2594 r2612 42 42 HandleLibraryTypes(OGRE) 43 43 44 ###############################################45 # Also make sure we have the required plugins #46 ###############################################47 48 IF(WIN32)49 # On Windows we need only *.dll, not *.lib. Especially the MSVC generator doesn't look for *.dll50 SET(CMAKE_FIND_LIBRARY_SUFFIXES_STORED ${CMAKE_FIND_LIBRARY_SUFFIXES})51 SET(CMAKE_FIND_LIBRARY_SUFFIXES .dll)52 ENDIF(WIN32)53 SET(CMAKE_FIND_LIBRARY_PREFIXES_STORED "${CMAKE_FIND_LIBRARY_PREFIXES}")54 SET(CMAKE_FIND_LIBRARY_PREFIXES "")55 56 SET(OGRE_RENDER_SYSTEM_FOUND FALSE)57 FOREACH(_plugin ${OGRE_PLUGINS})58 FIND_LIBRARY(OGRE_PLUGIN_${_plugin}_OPTIMIZED59 NAMES ${_plugin}60 PATHS $ENV{OGRE_HOME} /usr/local /usr61 PATH_SUFFIXES lib lib/OGRE bin bin/Release bin/release Release release62 )63 FIND_LIBRARY(OGRE_PLUGIN_${_plugin}_DEBUG64 NAMES ${_plugin}${LIBRARY_DEBUG_POSTFIX}65 PATHS $ENV{OGRE_HOME} /usr/local /usr66 PATH_SUFFIXES lib lib/OGRE bin bin/Debug bin/debug Debug debug67 )68 # We only need at least one render system. Check at the end69 IF(NOT ${_plugin} MATCHES "RenderSystem")70 IF(NOT OGRE_PLUGIN_${_plugin}_OPTIMIZED)71 MESSAGE(FATAL_ERROR "Could not find OGRE plugin named ${_plugin}")72 ENDIF(NOT OGRE_PLUGIN_${_plugin}_OPTIMIZED)73 ELSEIF(OGRE_PLUGIN_${_plugin}_OPTIMIZED)74 SET(OGRE_RENDER_SYSTEM_FOUND TRUE)75 ENDIF(NOT ${_plugin} MATCHES "RenderSystem")76 77 IF(OGRE_PLUGIN_${_plugin}_OPTIMIZED)78 # If debug version is not available, release will do as well79 IF(NOT OGRE_PLUGIN_${_plugin}_DEBUG)80 SET(OGRE_PLUGIN_${_plugin}_DEBUG ${OGRE_PLUGIN_${_plugin}_OPTIMIZED} CACHE STRING "" FORCE)81 ENDIF(NOT OGRE_PLUGIN_${_plugin}_DEBUG)82 MARK_AS_ADVANCED(OGRE_PLUGIN_${_plugin}_OPTIMIZED OGRE_PLUGIN_${_plugin}_DEBUG)83 84 ### Set variables to configure orxonox.ini correctly afterwards in bin/ ###85 # Check and set the folders86 GET_FILENAME_COMPONENT(_release_folder ${OGRE_PLUGIN_${_plugin}_OPTIMIZED} PATH)87 IF(OGRE_PLUGINS_FOLDER_RELEASE AND NOT OGRE_PLUGINS_FOLDER_RELEASE STREQUAL _release_folder)88 MESSAGE(FATAL_ERROR "Ogre release plugins have to be in the same folder!")89 ENDIF(OGRE_PLUGINS_FOLDER_RELEASE AND NOT OGRE_PLUGINS_FOLDER_RELEASE STREQUAL _release_folder)90 SET(OGRE_PLUGINS_FOLDER_RELEASE ${_release_folder})91 GET_FILENAME_COMPONENT(_debug_folder ${OGRE_PLUGIN_${_plugin}_DEBUG} PATH)92 IF(OGRE_PLUGINS_FOLDER_DEBUG AND NOT OGRE_PLUGINS_FOLDER_DEBUG STREQUAL _debug_folder)93 MESSAGE(FATAL_ERROR "Ogre debug plugins have to be in the same folder!")94 ENDIF(OGRE_PLUGINS_FOLDER_DEBUG AND NOT OGRE_PLUGINS_FOLDER_DEBUG STREQUAL _debug_folder)95 SET(OGRE_PLUGINS_FOLDER_DEBUG ${_debug_folder})96 97 # Create a list with the plugins for relase and debug configurations98 LIST(APPEND OGRE_PLUGINS_RELEASE ${_plugin})99 IF(OGRE_PLUGIN_${_plugin}_DEBUG)100 LIST(APPEND OGRE_PLUGINS_DEBUG ${_plugin}${LIBRARY_DEBUG_POSTFIX})101 ELSE(OGRE_PLUGIN_${_plugin}_DEBUG)102 LIST(APPEND OGRE_PLUGINS_DEBUG ${_plugin})103 ENDIF(OGRE_PLUGIN_${_plugin}_DEBUG)104 ENDIF(OGRE_PLUGIN_${_plugin}_OPTIMIZED)105 ENDFOREACH(_plugin)106 IF(NOT OGRE_RENDER_SYSTEM_FOUND)107 MESSAGE(FATAL_ERROR "Could not find an OGRE render system plugin")108 ENDIF(NOT OGRE_RENDER_SYSTEM_FOUND)109 IF(WIN32)110 # Restore previous settings (see above before FOREACH)111 SET(CMAKE_FIND_LIBRARY_SUFFIXES "${CMAKE_FIND_LIBRARY_SUFFIXES_STORED}")112 ENDIF(WIN32)113 SET(CMAKE_FIND_LIBRARY_PREFIXES "${CMAKE_FIND_LIBRARY_PREFIXES_STORED}")114 115 # List has to be comma separated for orxonox.ini116 STRING(REPLACE ";" ", " OGRE_PLUGINS_RELEASE "${OGRE_PLUGINS_RELEASE}")117 STRING(REPLACE ";" ", " OGRE_PLUGINS_DEBUG "${OGRE_PLUGINS_DEBUG}")118 119 120 44 MARK_AS_ADVANCED( 121 45 OGRE_LIBRARY -
code/branches/buildsystem2/cmake/LibraryConfig.cmake
r2611 r2612 1 PROJECT(Orxonox C CXX) 2 3 CMAKE_MINIMUM_REQUIRED(VERSION 2.6 FATAL_ERROR) 4 5 SET(ORXONOX_VERSION_MAJOR 0) 6 SET(ORXONOX_VERSION_MINOR 1) 7 SET(ORXONOX_VERSION_PATCH 0) 8 SET(ORXONOX_VERSION 0.1.0) 9 10 # Keep devs from using the root directory as binary directory (messes up the source tree) 11 IF(${CMAKE_CURRENT_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_BINARY_DIR}) 12 MESSAGE(FATAL_ERROR "Do not use the root directory as CMake output directory! mkdir build; cd build; cmake ..") 13 ENDIF(${CMAKE_CURRENT_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_BINARY_DIR}) 14 15 # This sets where to look for modules (e.g. "Find*.cmake" files) 16 SET(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake) 17 18 # Set binary output directories 19 SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) 20 SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) 21 SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) 22 23 # Set Debug build to default when not having multi-config generator like msvc 24 IF(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) 25 SET(CMAKE_BUILD_TYPE "Debug") 26 ENDIF(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) 27 28 ############## Platform Config ################## 29 30 # Configure platform specific options 31 INCLUDE(ConfigPlatforms) 32 33 ################ Test options ################### 34 35 OPTION(ENABLE_TESTS "Enable build tests.") 36 IF(ENABLE_TESTS) 37 ENABLE_TESTING() 38 ENDIF(ENABLE_TESTS) 39 40 OPTION(NETWORK_TESTING_ENABLED "Build network testing tools: i.e. chatclient chatserver and alike.") 41 OPTION(NETWORKTRAFFIC_TESTING_ENABLED "Build dummyserver4 and dummyclient4.") 42 43 ############### Library finding ################# 1 INCLUDE(LibraryConfigMinGW) 2 INCLUDE(LibraryConfigMSVC) 3 INCLUDE(LibraryConfigTardis) 44 4 45 5 # Performs the search and sets the variables … … 90 50 OPENAL_LIBRARY 91 51 ) 92 93 ############### Orxonox Source ##################94 95 ADD_SUBDIRECTORY(src)96 97 # Configure the binary output directory98 ADD_SUBDIRECTORY(bin-config) -
code/branches/buildsystem2/cmake/LibraryConfigMSVC.cmake
r2611 r2612 67 67 SET(ZLIB_FOUND TRUE) 68 68 69 #################### Compiler Flags #####################70 71 # /MD Minimal Rebuild72 # /RTC1 Both basic runtime checks73 # /MD[d] Multithreaded [debug] DLL74 # /Zi Program Database75 # /ZI Program Database for Edit & Continue76 # /WX Warning Level X77 # /wdX Disable specific warning X78 SET(MSVC_CL_FLAGS "79 /D WIN32 /D __WIN32__ /D _WIN32 /D _WINDOWS80 /D BOOST_ALL_DYN_LINK81 /D OIS_DYNAMIC_LIB82 /D ZLIB_WINAPI83 /D LUA_BUILD_AS_DLL84 /D _CRT_SECURE_NO_WARNINGS85 /W386 /EHsc87 /wd452288 /wd425189 /wd480090 ")91 SET(CMAKE_C_FLAGS "${MSVC_CL_FLAGS}")92 SET(CMAKE_CXX_FLAGS "${MSVC_CL_FLAGS}")93 94 # Note: ${CMAKE_C_FLAGS} get added to the specific ones95 SET(MSVC_CL_FLAGS_DEBUG "/MDd /Od /Zi /Gm /RTC1")96 SET(MSVC_CL_FLAGS_RELEASE "/MD /MP2 /D TOLUA_RELEASE")97 SET(CMAKE_C_FLAGS_DEBUG "${MSVC_CL_FLAGS_DEBUG}")98 SET(CMAKE_CXX_FLAGS_DEBUG "${MSVC_CL_FLAGS_DEBUG}")99 SET(CMAKE_C_FLAGS_RELEASE "${MSVC_CL_FLAGS_RELEASE} /O2")100 SET(CMAKE_CXX_FLAGS_RELEASE "${MSVC_CL_FLAGS_RELEASE} /O2")101 SET(CMAKE_C_FLAGS_RELWITHDEBINFO "${MSVC_CL_FLAGS_RELEASE} /O2 /Zi")102 SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${MSVC_CL_FLAGS_RELEASE} /O2 /Zi")103 SET(CMAKE_C_FLAGS_MINSIZEREL "${MSVC_CL_FLAGS_RELEASE} /O1")104 SET(CMAKE_CXX_FLAGS_MINSIZEREL "${MSVC_CL_FLAGS_RELEASE} /O1")105 106 ##################### Linker Flags ######################107 108 SET(MSVC_LINKER_FLAGS "")109 SET(CMAKE_EXE_LINKER_FLAGS "${MSVC_LINKER_FLAGS}")110 SET(CMAKE_SHARED_LINKER_FLAGS "${MSVC_LINKER_FLAGS}")111 112 # Note: ${CMAKE_EXE_LINKER_FLAGS} get added to the specific ones113 SET(MSVC_LINKER_FLAGS_DEBUG "/INCREMENTAL:YES")114 SET(MSVC_LINKER_FLAGS_RELEASE "/INCREMENTAL:NO /OPT:REF /OPT:ICF")115 SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${MSVC_LINKER_FLAGS_DEBUG}")116 SET(CMAKE_SHARED_LINKER_FLAGS_DEBUG "${MSVC_LINKER_FLAGS_DEBUG}")117 SET(CMAKE_EXE_LINKER_FLAGS_RELEASE "${MSVC_LINKER_FLAGS_RELEASE}")118 SET(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${MSVC_LINKER_FLAGS_RELEASE}")119 SET(CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO "${MSVC_LINKER_FLAGS_RELEASE}")120 SET(CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO "${MSVC_LINKER_FLAGS_RELEASE}")121 SET(CMAKE_EXE_LINKER_FLAGS_MINSIZEREL "${MSVC_LINKER_FLAGS_RELEASE}")122 SET(CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL "${MSVC_LINKER_FLAGS_RELEASE}")123 124 69 ######################### Misc ########################## 125 70
Note: See TracChangeset
for help on using the changeset viewer.