Changeset 5664 for code/branches/resource2/src
- Timestamp:
- Aug 20, 2009, 11:49:37 PM (15 years ago)
- Location:
- code/branches/resource2/src
- Files:
-
- 1 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
code/branches/resource2/src/CMakeLists.txt
r3368 r5664 17 17 # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 18 # 19 # 20 # Author: 21 # Reto Grieder 22 # Description: 23 # Configures the compilers and sets build options. 24 # 19 25 20 ################ Various Options ################ 21 22 # various macro includes 26 # Required macros and functions 23 27 INCLUDE(FlagUtilities) 24 28 INCLUDE(TargetUtilities) 25 29 30 # Configure the two headers and set some options 31 INCLUDE(OrxonoxConfig.cmake) 32 33 ################ Library Defines ################ 34 35 # Disable Boost auto linking completely 36 ADD_COMPILER_FLAGS("-DBOOST_ALL_NO_LIB") 37 38 # If no defines are specified, these libs get linked statically 39 ADD_COMPILER_FLAGS("-DBOOST_ALL_DYN_LINK" WIN32 LINK_BOOST_DYNAMIC) 40 ADD_COMPILER_FLAGS("-DENET_DLL" WIN32 LINK_ENET_DYNAMIC) 41 ADD_COMPILER_FLAGS("-DLUA_BUILD_AS_DLL" WIN32 LINK_LUA_DYNAMIC) 42 ADD_COMPILER_FLAGS("-DOIS_DYNAMIC_LIB") 43 ADD_COMPILER_FLAGS("-DZLIB_DLL" WIN32 LINK_ZLIB_DYNAMIC) 44 # If no defines are specified, these libs get linked dynamically 45 ADD_COMPILER_FLAGS("-DCEGUI_STATIC" WIN32 NOT LINK_CEGUI_DYNAMIC) 46 ADD_COMPILER_FLAGS("-DOGRE_STATIC_LIB" WIN32 NOT LINK_OGRE_DYNAMIC) 47 ADD_COMPILER_FLAGS("-DSTATIC_BUILD" WIN32 NOT LINK_TCL_DYNAMIC) 48 26 49 # Use TinyXML++ 27 50 ADD_COMPILER_FLAGS("-DTIXML_USE_TICPP") 28 # OIS dynamic linking requires macro definition, at least for Windows29 ADD_COMPILER_FLAGS("-DOIS_DYNAMIC_LIB")30 31 ################ OrxonoxConfig.h ################32 33 # Check endianness34 INCLUDE(TestBigEndian)35 TEST_BIG_ENDIAN(ORXONOX_BIG_ENDIAN)36 IF(NOT ORXONOX_BIG_ENDIAN)37 SET(ORXONOX_LITTLE_ENDIAN TRUE)38 ENDIF()39 40 # 32/64 bit system check41 IF(CMAKE_SIZEOF_VOID_P EQUAL 8)42 SET(ORXONOX_ARCH_64 TRUE)43 ELSE()44 SET(ORXONOX_ARCH_32 TRUE)45 ENDIF()46 47 # Platforms48 SET(ORXONOX_PLATFORM_WINDOWS ${WIN32})49 SET(ORXONOX_PLATFORM_APPLE ${APPLE})50 SET(ORXONOX_PLATFORM_UNIX ${UNIX})51 IF(UNIX AND NOT APPLE)52 SET(ORXONOX_PLATFORM_LINUX TRUE)53 ENDIF()54 55 # Check __forceinline56 IF(MSVC)57 INCLUDE(CheckCXXSourceCompiles)58 SET(_source "int main() { return 0; } __forceinline void test() { return; }")59 CHECK_CXX_SOURCE_COMPILES("${_source}" HAVE_FORCEINLINE)60 ENDIF(MSVC)61 62 # Check ciso646 include (literal operators)63 INCLUDE(CheckIncludeFileCXX)64 CHECK_INCLUDE_FILE_CXX(iso646.h HAVE_ISO646_H)65 66 # XCode and Visual Studio support multiple configurations. In order to tell the67 # which one we have to define the macros separately for each configuration68 ADD_COMPILER_FLAGS("-DCMAKE_BUILD_TYPE=Debug" Debug)69 ADD_COMPILER_FLAGS("-DCMAKE_BUILD_TYPE=Release" Release)70 ADD_COMPILER_FLAGS("-DCMAKE_BUILD_TYPE=RelWithDebInfo" RelWithDebInfo)71 ADD_COMPILER_FLAGS("-DCMAKE_BUILD_TYPE=MinSizeRel" MinSizeRel)72 73 SET(GENERATED_FILE_COMMENT74 "DO NOT EDIT THIS FILE! <br>75 It has been automatically generated by CMake from OrxonoxConfig.h.in")76 # Copy and configure OrxonoxConfig which gets included in every file77 CONFIGURE_FILE(OrxonoxConfig.h.in ${CMAKE_CURRENT_BINARY_DIR}/OrxonoxConfig.h)78 # This file only gets included by very few classes to avoid a large recompilation79 CONFIGURE_FILE(SpecialConfig.h.in ${CMAKE_CURRENT_BINARY_DIR}/SpecialConfig.h)80 81 SET(ORXONOX_CONFIG_FILES82 ${CMAKE_CURRENT_BINARY_DIR}/OrxonoxConfig.h83 ${CMAKE_CURRENT_SOURCE_DIR}/OrxonoxConfig.h.in84 ${CMAKE_CURRENT_BINARY_DIR}/SpecialConfig.h85 ${CMAKE_CURRENT_SOURCE_DIR}/SpecialConfig.h.in86 )87 51 88 52 ############## Include Directories ############## -
code/branches/resource2/src/OrxonoxConfig.cmake
r5662 r5664 17 17 # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 18 # 19 # 20 # Author: 21 # Reto Grieder 22 # Description: 23 # Configures the header files OrxonoxConfig.h and SpecialConfig.h 24 # and sets some other options. All the build related options should be 25 # found and set here if possible. 26 # 19 27 20 ################ Various Options################28 #################### Options #################### 21 29 22 # various macro includes 23 INCLUDE(FlagUtilities) 24 INCLUDE(TargetUtilities) 30 # Default linking is SHARED 31 SET(ORXONOX_DEFAULT_LINK SHARED) 25 32 26 # Use TinyXML++ 27 ADD_COMPILER_FLAGS("-DTIXML_USE_TICPP") 28 # OIS dynamic linking requires macro definition, at least for Windows 29 ADD_COMPILER_FLAGS("-DOIS_DYNAMIC_LIB") 33 # Use, i.e. don't skip the full RPATH for the build tree 34 SET(CMAKE_SKIP_BUILD_RPATH FALSE) 30 35 31 ################ OrxonoxConfig.h ################ 36 # Global switch to disable Precompiled Header Files 37 IF(PCH_COMPILER_SUPPORT) 38 OPTION(PCH_ENABLE "Global PCH switch" TRUE) 39 ENDIF() 40 41 # Enable expensive optimisations: use this for a binary release build 42 OPTION(ORXONOX_RELEASE "Enable when building restributable releases" FALSE) 43 44 # Use WinMain() or main()? 45 IF(WIN32) 46 OPTION(ORXONOX_USE_WINMAIN "Use WinMain (doesn't show console) or main" FALSE) 47 ENDIF() 48 49 ################ Platform Config ################ 32 50 33 51 # Check endianness … … 60 78 ENDIF(MSVC) 61 79 62 # Check ciso646include (literal operators)80 # Check iso646.h include (literal operators) 63 81 INCLUDE(CheckIncludeFileCXX) 64 82 CHECK_INCLUDE_FILE_CXX(iso646.h HAVE_ISO646_H) 65 83 66 # XCode and Visual Studio support multiple configurations. In order to tell the67 # which one we have to define the macros separatelyfor each configuration84 # XCode and Visual Studio support multiple configurations. In order to tell 85 # about the active one we have to define the macro for each configuration 68 86 ADD_COMPILER_FLAGS("-DCMAKE_BUILD_TYPE=Debug" Debug) 69 87 ADD_COMPILER_FLAGS("-DCMAKE_BUILD_TYPE=Release" Release) 70 88 ADD_COMPILER_FLAGS("-DCMAKE_BUILD_TYPE=RelWithDebInfo" RelWithDebInfo) 71 89 ADD_COMPILER_FLAGS("-DCMAKE_BUILD_TYPE=MinSizeRel" MinSizeRel) 90 91 ############## Configured Headers ############### 72 92 73 93 SET(GENERATED_FILE_COMMENT … … 85 105 ${CMAKE_CURRENT_SOURCE_DIR}/SpecialConfig.h.in 86 106 ) 87 88 ############## Include Directories ##############89 90 # Set the search paths for include files91 INCLUDE_DIRECTORIES(92 # External93 ${OGRE_INCLUDE_DIR}94 ${CEGUI_INCLUDE_DIR}95 ${ENET_INCLUDE_DIR}96 ${Boost_INCLUDE_DIRS}97 ${OPENAL_INCLUDE_DIRS}98 ${ALUT_INCLUDE_DIR}99 ${VORBIS_INCLUDE_DIR}100 ${OGG_INCLUDE_DIR}101 ${LUA_INCLUDE_DIR}102 ${TCL_INCLUDE_PATH}103 ${DIRECTX_INCLUDE_DIR}104 ${ZLIB_INCLUDE_DIR}105 ${VLD_INCLUDE_DIR}106 107 # All library includes are prefixed with the path to avoid conflicts108 ${CMAKE_CURRENT_SOURCE_DIR}109 # Bullet headers really need the include directory110 ${CMAKE_CURRENT_SOURCE_DIR}/bullet111 # OIS headers need the root dir as well112 ${CMAKE_CURRENT_SOURCE_DIR}/ois113 # Convenience directory114 ${CMAKE_CURRENT_SOURCE_DIR}/orxonox115 # OrxonoxConfig.h116 ${CMAKE_CURRENT_BINARY_DIR}117 # Tolua bind files for Core118 ${CMAKE_CURRENT_BINARY_DIR}/core/${CMAKE_CFG_INTDIR}119 # Tolua bind files for Orxonox120 ${CMAKE_CURRENT_BINARY_DIR}/orxonox/${CMAKE_CFG_INTDIR}121 )122 123 124 ################ Sub Directories ################125 126 # Third party libraries127 ADD_SUBDIRECTORY(tolua)128 129 # Include CEGUILua if not requested otherwise130 IF(CEGUILUA_USE_INTERNAL_LIBRARY)131 IF(NOT IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/ceguilua/ceguilua-${CEGUI_VERSION})132 MESSAGE(FATAL_ERROR "CEGUILua version not found in src folder. Update list of supported versions in LibraryConfig.cmake!")133 ENDIF()134 135 INCLUDE_DIRECTORIES(ceguilua/ceguilua-${CEGUI_VERSION})136 ADD_SUBDIRECTORY(ceguilua)137 ENDIF()138 139 ADD_SUBDIRECTORY(bullet)140 ADD_SUBDIRECTORY(cpptcl)141 ADD_SUBDIRECTORY(ogreceguirenderer)142 ADD_SUBDIRECTORY(ois)143 ADD_SUBDIRECTORY(tinyxml)144 145 # Orxonox code146 ADD_SUBDIRECTORY(util)147 ADD_SUBDIRECTORY(core)148 ADD_SUBDIRECTORY(network)149 ADD_SUBDIRECTORY(orxonox)
Note: See TracChangeset
for help on using the changeset viewer.