Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/archive/tutorialHS08/CMakeLists.txt @ 8804

Last change on this file since 8804 was 1810, checked in by rgrieder, 16 years ago

merged ceguilua branch back to trunk

  • Property svn:eol-style set to native
File size: 3.1 KB
Line 
1PROJECT(Orxonox)
2
3cmake_minimum_required(VERSION 2.4)
4
5IF (COMMAND cmake_policy)
6  cmake_policy(SET CMP0003 NEW)
7ENDIF (COMMAND cmake_policy)
8
9# This sets where to look for modules (e.g. "Find*.cmake" files)
10SET(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
11
12# Check whether we are on a tardis box
13INCLUDE(CheckTardis)
14
15
16############## Testing options ##################
17
18OPTION(TESTING_ENABLED "Do you want to enable Testing")
19IF (TESTING_ENABLED)
20  ENABLE_TESTING()
21ENDIF(TESTING_ENABLED)
22
23OPTION (NETWORK_TESTING_ENABLED "Do you want to build network testing tools: i.e. chatclient chatserver and alike")
24OPTION (NETWORKTRAFFIC_TESTING_ENABLED "Do you want to build dummyserver4 and dummyclient4")
25
26
27########## Compiler/Linker options ##############
28
29# if on tardis change compiler and reset boost include directory
30IF(IS_TARDIS)
31  MESSAGE("System is a TARDIS: Setting Compiler to g++-4.1.1")
32  # Force-set the compiler on tardis machines, as default points to g++-3.3
33  SET(CMAKE_CXX_COMPILER "g++-4.1.1")
34  # Reset Boost serach path
35  SET(Boost_INCLUDE_DIR "/usr/pack/boost-1.34.1-sd/i686-debian-linux3.1/include")
36ELSE (IS_TARDIS)
37  IF (NOT WIN32)
38    SET(Boost_INCLUDE_DIR "/usr/include/boost")
39  ENDIF (NOT WIN32)
40ENDIF(IS_TARDIS)
41
42# Set binary output directories
43SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)
44SET(LIBRARY_OUTPUT_PATH    ${PROJECT_SOURCE_DIR}/bin/lib)
45
46# Global compiler/linker flags. force -O2!
47SET(CMAKE_C_FLAGS "$ENV{CFLAGS} -O0 -Wall -g -ggdb")
48SET(CMAKE_CXX_FLAGS "$ENV{CXXFLAGS} -O0 -Wall -g -ggdb")
49#SET(CMAKE_C_FLAGS "$ENV{CFLAGS} -O3")
50#SET(CMAKE_CXX_FLAGS "$ENV{CXXFLAGS} -O3")
51
52SET(CMAKE_LD_FLAGS "$ENV{LDFLAGS}")
53SET(CMAKE_EXE_LINKER_FLAGS " --no-undefined")
54SET(CMAKE_SHARED_LINKER_FLAGS " --no-undefined")
55SET(CMAKE_MODULE_LINKER_FLAGS " --no-undefined")
56
57# Use 'cmake -D make_verb:1 path' to get verbose make output when compiling
58IF (MAKE_VERB)
59 SET(CMAKE_VERBOSE_MAKEFILE TRUE)
60ENDIF (MAKE_VERB)
61
62
63############### Library finding #################
64
65# Uncomment the following line if you want the include and library paths to be shown
66# Alternatively use the "-D VERBOSE_FIND:BOOL=true" option when executing cmake
67
68# SET (VERBOSE_FIND true)
69
70# Performs the search and sets the variables
71FIND_PACKAGE(OGRE)
72FIND_PACKAGE(CEGUI)
73# FIND_PACKAGE(CEGUI_OGRE)
74FIND_PACKAGE(ENet)
75FIND_PACKAGE(Boost REQUIRED thread filesystem)
76FIND_PACKAGE(OpenAL)
77FIND_PACKAGE(ALUT)
78FIND_PACKAGE(OggVorbis)
79FIND_PACKAGE(ZLIB)
80#FIND_PACKAGE(Lua)
81FIND_PACKAGE(TCL)
82FIND_PACKAGE(DirectX)
83
84# Set the search paths for the linking
85LINK_DIRECTORIES(
86  ${OGRE_LIB_DIR}
87  ${CEGUI_LIB_DIR}
88#  ${CEGUI_SCRIPT_LIB_DIR}
89#  ${CEGUI_OGRE_LIB_DIR}
90  ${ENet_LIBRARY}
91  ${Boost_LIBRARY_DIRS}
92  ${Zlib_LIBRARY_DIR}
93  ${TCL_LIBRARY}
94)
95
96# Set the search paths for include files
97INCLUDE_DIRECTORIES(
98  ${OGRE_INCLUDE_DIR}
99  ${CEGUI_INCLUDE_DIR}
100#  ${CEGUI_OGRE_INCLUDE_DIR}
101  ${ENet_INCLUDE_DIR}
102  ${Boost_INCLUDE_DIRS}
103  ${OPENAL_INCLUDE_DIR}
104  ${ALUT_INCLUDE_DIR}
105  ${VORBIS_INCLUDE_DIR}
106  ${OGG_INCLUDE_DIR}
107#  ${Lua_INCLUDE_DIR}
108  ${TCL_INCLUDE_PATH}
109  ${DirectX_INCLUDE_DIR}
110  ${ZLIB_INCLUDE_DIR}
111)
112
113# Add main source dir
114ADD_SUBDIRECTORY(src)
115
Note: See TracBrowser for help on using the repository browser.