Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/buildsystem/CMakeLists.txt @ 2276

Last change on this file since 2276 was 2260, checked in by rgrieder, 16 years ago

Added NDEBUG and _DEBUG macros to all builds. This removes all asserts from the release versions.

  • Property svn:eol-style set to native
File size: 2.4 KB
Line 
1PROJECT(Orxonox)
2
3CMAKE_MINIMUM_REQUIRED(VERSION 2.6 FATAL_ERROR)
4
5# This sets where to look for modules (e.g. "Find*.cmake" files)
6SET(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
7
8# Check for special include paths
9INCLUDE(CheckTardis)
10INCLUDE(CheckOrxonoxWinDeps)
11
12################ Test options ###################
13
14OPTION(ENABLE_TESTS "Enable build tests.")
15IF(ENABLE_TESTS)
16  ENABLE_TESTING()
17ENDIF(ENABLE_TESTS)
18
19OPTION(NETWORK_TESTING_ENABLED "Build network testing tools: i.e. chatclient chatserver and alike.")
20OPTION(NETWORKTRAFFIC_TESTING_ENABLED "Build dummyserver4 and dummyclient4.")
21
22########## Compiler/Linker options ##############
23
24# Set binary output directories
25SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
26SET(LIBRARY_OUTPUT_PATH    ${PROJECT_BINARY_DIR}/bin)
27MARK_AS_ADVANCED(EXECUTABLE_OUTPUT_PATH LIBRARY_OUTPUT_PATH)
28
29# Compiler/Linker flags.
30IF(NOT CMAKE_BUILD_TYPE)
31  SET(CMAKE_BUILD_TYPE "Debug")
32ENDIF(NOT CMAKE_BUILD_TYPE)
33SET(CMAKE_C_FLAGS   "$ENV{CFLAGS}   -Wall -Wextra -Wno-unused-parameter")
34SET(CMAKE_CXX_FLAGS "$ENV{CXXFLAGS} -Wall -Wextra -Wno-unused-parameter")
35SET(CMAKE_C_FLAGS_DEBUG            "-g -D_DEBUG -ggdb")
36SET(CMAKE_CXX_FLAGS_DEBUG          "-g -D_DEBUG -ggdb")
37SET(CMAKE_C_FLAGS_RELEASE          "-O3 -DNDEBUG")
38SET(CMAKE_CXX_FLAGS_RELEASE        "-O3 -DNDEBUG")
39SET(CMAKE_C_FLAGS_RELWITHDEBINFO   "-O2 -DNDEBUG -g -ggdb")
40SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -DNDEBUG -g -ggdb")
41SET(CMAKE_C_FLAGS_MINSIZEREL       "-Os -DNDEBUG")
42SET(CMAKE_CXX_FLAGS_MINSIZEREL     "-Os -DNDEBUG")
43
44SET(CMAKE_LD_FLAGS "$ENV{LDFLAGS}")
45SET(CMAKE_EXE_LINKER_FLAGS " --no-undefined")
46SET(CMAKE_SHARED_LINKER_FLAGS " --no-undefined")
47SET(CMAKE_MODULE_LINKER_FLAGS " --no-undefined")
48
49############### Library finding #################
50
51# Performs the search and sets the variables
52FIND_PACKAGE(OGRE REQUIRED)
53FIND_PACKAGE(CEGUI REQUIRED)
54# CEGUI_OGRE included in source
55#FIND_PACKAGE(CEGUI_OGRE REQUIRED)
56FIND_PACKAGE(ENet REQUIRED)
57FIND_PACKAGE(Boost 1.34 REQUIRED thread filesystem)
58FIND_PACKAGE(OpenAL REQUIRED)
59FIND_PACKAGE(ALUT REQUIRED)
60FIND_PACKAGE(OggVorbis REQUIRED)
61FIND_PACKAGE(ZLIB REQUIRED)
62FIND_PACKAGE(DirectX REQUIRED)
63FIND_PACKAGE(Lua50 REQUIRED)
64#FIND_PACKAGE(Lua51 QUIET)
65
66#don't require the whole tcl rat tail
67FIND_PACKAGE(TCL QUIET)
68IF(NOT TCL_FOUND)
69    MESSAGE(FATAL_ERROR "Tcl not found.")
70ENDIF(NOT TCL_FOUND)
71
72# Add main source dir
73ADD_SUBDIRECTORY(src)
74ADD_SUBDIRECTORY(bin)
Note: See TracBrowser for help on using the repository browser.