Changeset 2588
- Timestamp:
- Jan 12, 2009, 4:18:11 PM (16 years ago)
- Location:
- code/branches/buildsystem2
- Files:
-
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/buildsystem2/CMakeLists.txt
r2583 r2588 45 45 SET(Boost_ADDITIONAL_VERSIONS 1.37 1.37.0 CACHE STRING "") 46 46 FIND_PACKAGE(Boost 1.34 REQUIRED thread filesystem) 47 # With MSVC, automatic linking is performed for boost. So wee need to tell 48 # the linker where to find them. Also note that when running FindBoost for the 49 # first time, it will set ${Boost_LIBRARIES} to "" but afterwards to the libs. 50 IF (MSVC) 51 LINK_DIRECTORIES(${Boost_LIBRARY_DIRS}) 52 ENDIF (MSVC) 47 53 FIND_PACKAGE(OGRE REQUIRED) 48 54 FIND_PACKAGE(CEGUI REQUIRED) -
code/branches/buildsystem2/cmake/ConfigMSVC.cmake
r2585 r2588 26 26 # 27 27 28 ############## MSVC config################29 # Set the library director y when using precompiled tarballs for30 # the dependencies under windows (MSVC)31 ########################################### 28 ###################### MSVC config ######################## 29 # Set the library directories and special options when 30 # using Visual Studio. 31 ########################################################### 32 32 33 33 IF (MSVC) 34 34 MESSAGE(STATUS "Running on MSVC. Using customized paths and options.") 35 36 ###################### Libraries ######################## 35 37 36 38 # Determine library directory … … 54 56 SET(ENV{OPENALDIR} ${MSVC_LIBRARY_DIR}/openal-1.1) 55 57 SET(ENV{LUA_DIR} ${MSVC_LIBRARY_DIR}/lua-5.1.3) 56 SET(ENV{OGRE_HOME} "${MSVC_LIBRARY_DIR}/ogre-1.4.9;${ ORXONOX_LIBRARY_BIN_DIR}")58 SET(ENV{OGRE_HOME} "${MSVC_LIBRARY_DIR}/ogre-1.4.9;${MSVC_LIBRARY_DIR}/bin") 57 59 SET(TCL_INCLUDE_PATH ${MSVC_LIBRARY_DIR}/tcl-8.5.2/include) 58 60 SET(TCL_LIBRARY ${MSVC_LIBRARY_DIR}/tcl-8.5.2/lib/tcl85t.lib) … … 66 68 SET(ZLIB_FOUND TRUE) 67 69 70 #################### Compiler Flags ##################### 68 71 69 # Set standard compiler flags 70 SET(CMAKE_C_FLAGS "$ENV{CFLAGS} ${ORXONOX_WARNING_FLAGS} -fPIC") 71 SET(CMAKE_CXX_FLAGS "$ENV{CXXFLAGS} ${ORXONOX_WARNING_FLAGS} -fPIC") 72 # These flags are added to the flags above 73 SET(CMAKE_C_FLAGS_DEBUG " -g -ggdb") 74 SET(CMAKE_CXX_FLAGS_DEBUG " -g -ggdb") 75 SET(CMAKE_C_FLAGS_RELEASE "-O3 -DNDEBUG") 76 SET(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG") 77 SET(CMAKE_C_FLAGS_RELWITHDEBINFO "-O2 -g -ggdb -DNDEBUG") 78 SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g -ggdb -DNDEBUG") 79 SET(CMAKE_C_FLAGS_MINSIZEREL "-Os -DNDEBUG") 80 SET(CMAKE_CXX_FLAGS_MINSIZEREL "-Os -DNDEBUG") 72 # /MD Minimal Rebuild 73 # /RTC1 Both basic runtime checks 74 # /MD[d] Multithreaded [debug] DLL 75 # /Zi Program Database 76 # /ZI Program Database for Edit & Continue 77 # /WX Warning Level X 78 # /wdX Disable specific warning X 79 SET(MSVC_CL_FLAGS " 80 /D WIN32 /D __WIN32__ /D _WIN32 /D _WINDOWS 81 /D BOOST_ALL_DYN_LINK 82 /D OIS_DYNAMIC_LIB 83 /D ZLIB_WINAPI 84 /D LUA_BUILD_AS_DLL 85 /D _CRT_SECURE_NO_WARNINGS 86 /W3 87 /EHsc 88 /wd4522 89 /wd4251 90 /wd4800 91 ") 92 SET(CMAKE_C_FLAGS "${MSVC_CL_FLAGS}") 93 SET(CMAKE_CXX_FLAGS "${MSVC_CL_FLAGS}") 81 94 82 # Linker flags 83 SET(CMAKE_LD_FLAGS "$ENV{LDFLAGS}") 84 SET(CMAKE_EXE_LINKER_FLAGS " --no-undefined") 85 SET(CMAKE_SHARED_LINKER_FLAGS " --no-undefined") 86 SET(CMAKE_MODULE_LINKER_FLAGS " --no-undefined") 95 # Note: ${CMAKE_C_FLAGS} get added to the specific ones 96 SET(MSVC_CL_FLAGS_DEBUG "/MDd /Od /Zi /Gm /RTC1") 97 SET(MSVC_CL_FLAGS_RELEASE "/MD /MP2 /D TOLUA_RELEASE") 98 SET(CMAKE_C_FLAGS_DEBUG "${MSVC_CL_FLAGS_DEBUG}") 99 SET(CMAKE_CXX_FLAGS_DEBUG "${MSVC_CL_FLAGS_DEBUG}") 100 SET(CMAKE_C_FLAGS_RELEASE "${MSVC_CL_FLAGS_RELEASE} /O2") 101 SET(CMAKE_CXX_FLAGS_RELEASE "${MSVC_CL_FLAGS_RELEASE} /O2") 102 SET(CMAKE_C_FLAGS_RELWITHDEBINFO "${MSVC_CL_FLAGS_RELEASE} /O2 /Zi") 103 SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${MSVC_CL_FLAGS_RELEASE} /O2 /Zi") 104 SET(CMAKE_C_FLAGS_MINSIZEREL "${MSVC_CL_FLAGS_RELEASE} /O1") 105 SET(CMAKE_CXX_FLAGS_MINSIZEREL "${MSVC_CL_FLAGS_RELEASE} /O1") 106 107 ##################### Linker Flags ###################### 108 109 SET(MSVC_LINKER_FLAGS "") 110 SET(CMAKE_EXE_LINKER_FLAGS "${MSVC_LINKER_FLAGS}") 111 SET(CMAKE_SHARED_LINKER_FLAGS "${MSVC_LINKER_FLAGS}") 112 113 # Note: ${CMAKE_EXE_LINKER_FLAGS} get added to the specific ones 114 SET(MSVC_LINKER_FLAGS_DEBUG "/INCREMENTAL:YES") 115 SET(MSVC_LINKER_FLAGS_RELEASE "/INCREMENTAL:NO /OPT:REF /OPT:ICF") 116 SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${MSVC_LINKER_FLAGS_DEBUG}") 117 SET(CMAKE_SHARED_LINKER_FLAGS_DEBUG "${MSVC_LINKER_FLAGS_DEBUG}") 118 SET(CMAKE_EXE_LINKER_FLAGS_RELEASE "${MSVC_LINKER_FLAGS_RELEASE}") 119 SET(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${MSVC_LINKER_FLAGS_RELEASE}") 120 SET(CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO "${MSVC_LINKER_FLAGS_RELEASE}") 121 SET(CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO "${MSVC_LINKER_FLAGS_RELEASE}") 122 SET(CMAKE_EXE_LINKER_FLAGS_MINSIZEREL "${MSVC_LINKER_FLAGS_RELEASE}") 123 SET(CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL "${MSVC_LINKER_FLAGS_RELEASE}") 87 124 88 125 ######################### Misc ########################## -
code/branches/buildsystem2/cmake/ConfigPlatforms.cmake
r2585 r2588 70 70 SET(CMAKE_MODULE_LINKER_FLAGS " --no-undefined") 71 71 72 # Also define macros to easily extend the compiler flags 73 # Additional argument is a condition 74 MACRO(ADD_CXX_FLAGS _flag _cond) 75 IF(${_cond}) 76 SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${_flag}") 77 ENDIF(${_cond}) 78 ENDMACRO(ADD_CXX_FLAGS _flag) 79 MACRO(ADD_C_FLAGS _flag) 80 IF(${_cond}) 81 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${_flag}") 82 ENDIF(${_cond}) 83 ENDMACRO(ADD_C_FLAGS _flag) 84 72 85 ########## Plaform Specific Config ############## 73 86 -
code/branches/buildsystem2/src/CMakeLists.txt
r2583 r2588 37 37 38 38 # Set special macro symbols across all libraries 39 SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DTIXML_USE_TICPP") 39 ADD_CXX_FLAGS("-DTIXML_USE_TICPP" TRUE) 40 ADD_C_FLAGS("-DTIXML_USE_TICPP" TRUE) 40 41 41 42 # Include macros -
code/branches/buildsystem2/src/audio/CMakeLists.txt
r2583 r2588 6 6 ) 7 7 8 IF (WIN32) 8 ADD_CXX_FLAGS("-wd4244" MSVC) 9 10 IF (MINGW) 9 11 ADD_LIBRARY( audio ${AUDIO_SRC_FILES} ) 10 ELSE ( WIN32)12 ELSE (MINGW) 11 13 ADD_LIBRARY( audio SHARED ${AUDIO_SRC_FILES} ) 12 ENDIF ( WIN32)14 ENDIF (MINGW) 13 15 16 SET_TARGET_PROPERTIES(audio PROPERTIES DEFINE_SYMBOL "AUDIO_SHARED_BUILD") 14 17 TARGET_LINK_LIBRARIES( audio 15 18 ${OPENAL_LIBRARY} -
code/branches/buildsystem2/src/ceguilua-0.5.0/ceguilua/CMakeLists.txt
r2579 r2588 6 6 ) 7 7 8 ADD_CXX_FLAGS("-wd4996" MSVC) 9 8 10 ADD_LIBRARY( ceguilua_orxonox SHARED ${CEGUILUA_SRC_FILES} ) 9 11 12 SET_TARGET_PROPERTIES(ceguilua_orxonox PROPERTIES DEFINE_SYMBOL "CEGUILUA_EXPORTS") 10 13 TARGET_LINK_LIBRARIES(ceguilua_orxonox 11 14 tolualib_orxonox -
code/branches/buildsystem2/src/ceguilua-0.6.1/ceguilua/CMakeLists.txt
r2579 r2588 6 6 ) 7 7 8 ADD_CXX_FLAGS("-wd4996" MSVC) 9 8 10 ADD_LIBRARY( ceguilua_orxonox SHARED ${CEGUILUA_SRC_FILES} ) 9 11 12 SET_TARGET_PROPERTIES(ceguilua_orxonox PROPERTIES DEFINE_SYMBOL "CEGUILUA_EXPORTS") 10 13 TARGET_LINK_LIBRARIES(ceguilua_orxonox 11 14 tolualib_orxonox -
code/branches/buildsystem2/src/core/CMakeLists.txt
r2579 r2588 51 51 ADD_LIBRARY(core SHARED ${CORE_SRC_FILES}) 52 52 53 SET_TARGET_PROPERTIES(core PROPERTIES DEFINE_SYMBOL "CORE_SHARED_BUILD") 53 54 TARGET_LINK_LIBRARIES(core 54 55 ${OGRE_LIBRARY} -
code/branches/buildsystem2/src/cpptcl/CMakeLists.txt
r2579 r2588 1 ADD_LIBRARY(cpptcl_orxonox SHARED CppTcl.cc) 1 IF(MSVC) 2 ADD_LIBRARY(cpptcl_orxonox STATIC CppTcl.cc) 3 ELSE(MSVC) 4 ADD_LIBRARY(cpptcl_orxonox SHARED CppTcl.cc) 5 ENDIF(MSVC) 2 6 3 7 TARGET_LINK_LIBRARIES(cpptcl_orxonox -
code/branches/buildsystem2/src/network/CMakeLists.txt
r2583 r2588 18 18 19 19 WRITE_SOURCE_FILES(NETWORK_SRC_FILES) 20 IF(WIN32) 20 21 IF(MINGW) 21 22 ADD_LIBRARY( network ${NETWORK_SRC_FILES} ) 22 ELSE( WIN32)23 ELSE(MINGW) 23 24 ADD_LIBRARY( network SHARED ${NETWORK_SRC_FILES} ) 24 ENDIF( WIN32)25 ENDIF(MINGW) 25 26 26 TARGET_LINK_LIBRARIES( network 27 SET_TARGET_PROPERTIES(network PROPERTIES DEFINE_SYMBOL "NETWORK_SHARED_BUILD") 28 TARGET_LINK_LIBRARIES(network 27 29 ${ZLIB_LIBRARY} 28 30 ${ENET_LIBRARY} -
code/branches/buildsystem2/src/ogreceguirenderer/CMakeLists.txt
r2583 r2588 7 7 ADD_LIBRARY(ogreceguirenderer_orxonox SHARED ${SRC_FILES}) 8 8 9 SET_TARGET_PROPERTIES(ogreceguirenderer_orxonox PROPERTIES DEFINE_SYMBOL "OGRE_GUIRENDERER_EXPORTS") 9 10 TARGET_LINK_LIBRARIES(ogreceguirenderer_orxonox 10 11 ${OGRE_LIBRARY} -
code/branches/buildsystem2/src/ois/CMakeLists.txt
r2579 r2588 39 39 40 40 ADD_LIBRARY( ois_orxonox SHARED ${OIS_SRC_FILES} ) 41 SET_TARGET_PROPERTIES(ois_orxonox PROPERTIES DEFINE_SYMBOL "OIS_NONCLIENT_BUILD") 41 42 42 43 IF(WIN32) -
code/branches/buildsystem2/src/orxonox/CMakeLists.txt
r2579 r2588 20 20 # Not using precompiled header files: Avoid dependencies 21 21 INCLUDE_DIRECTORIES(pch/nopch) 22 23 # Enlarge heap size for precompiled header files 24 ADD_CXX_FLAGS("-Zm200" MSVC) 22 25 23 26 ADD_EXECUTABLE(orxonox ${ORXONOX_SRC_FILES}) -
code/branches/buildsystem2/src/tinyxml/CMakeLists.txt
r2579 r2588 7 7 ) 8 8 9 ADD_LIBRARY(tinyxml_orxonox SHARED ${TINYXML_SRC_FILES}) 9 IF(MSVC) 10 ADD_LIBRARY(tinyxml_orxonox STATIC ${TINYXML_SRC_FILES}) 11 ELSE(MSVC) 12 ADD_LIBRARY(tinyxml_orxonox SHARED ${TINYXML_SRC_FILES}) 13 ENDIF(MSVC) 10 14 11 15 IF (NOT WIN32) -
code/branches/buildsystem2/src/tolua/CMakeLists.txt
r2583 r2588 1 ADD_C_FLAGS("-wd4996" MSVC) 2 1 3 ADD_LIBRARY(tolualib_orxonox SHARED 2 4 tolua_event.c … … 6 8 tolua_to.c 7 9 ) 10 SET_TARGET_PROPERTIES(tolualib_orxonox PROPERTIES DEFINE_SYMBOL "TOLUA_SHARED_BUILD") 8 11 TARGET_LINK_LIBRARIES(tolualib_orxonox ${LUA_LIBRARY}) 9 12 -
code/branches/buildsystem2/src/util/CMakeLists.txt
r2579 r2588 14 14 15 15 ADD_LIBRARY(util SHARED ${UTIL_SRC_FILES}) 16 SET_TARGET_PROPERTIES(util PROPERTIES DEFINE_SYMBOL "UTIL_SHARED_BUILD") 16 17 TARGET_LINK_LIBRARIES(util ${OGRE_LIBRARY}) 17 18
Note: See TracChangeset
for help on using the changeset viewer.