Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/network2/CMakeLists.txt @ 1100

Last change on this file since 1100 was 1098, checked in by rgrieder, 17 years ago

merged network branch into new network2 branch (from trunk)

File size: 2.8 KB
Line 
1PROJECT(Orxonox)
2
3#This sets where to look for modules (e.g. "Find*.cmake" files)
4SET(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
5
6#Check whether we are on a tardis box
7INCLUDE(CheckTardis)
8
9
10############## Testing options ##################
11
12OPTION(TESTING_ENABLED "Do you want to enable Testing")
13IF (TESTING_ENABLED)
14  ENABLE_TESTING()
15ENDIF(TESTING_ENABLED)
16
17OPTION(NETWORK_TESTING_ENABLED "Do you want to build network testing tools: i.e. chatclient chatserver and alike")
18
19
20########## Compiler/Linker options ##############
21
22# if on tardis change compiler and reset boost include directory
23IF(IS_TARDIS)
24  MESSAGE("System is a TARDIS: Setting Compiler to g++-4.1.1")
25  # force-set the compiler on tardis machines, as default points to g++-3.3
26  SET(CMAKE_CXX_COMPILER "g++-4.1.1")
27  # reset Boost serach path
28  SET(Boost_INCLUDE_DIR "/usr/pack/boost-1.34.1-sd/i686-debian-linux3.1/include")
29ELSE (IS_TARDIS)
30  SET(Boost_INCLUDE_DIR "/usr/include/boost")
31ENDIF(IS_TARDIS)
32
33#set binary output directories
34SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
35SET(LIBRARY_OUTPUT_PATH    ${PROJECT_BINARY_DIR}/bin/lib)
36
37# global compiler/linker flags. force -O2!
38SET(CMAKE_C_FLAGS "$ENV{CFLAGS} -O0 -Wall -g -ggdb")
39SET(CMAKE_CXX_FLAGS "$ENV{CXXFLAGS} -O0 -Wall -g -ggdb")
40SET(CMAKE_LD_FLAGS "$ENV{LDFLAGS}")
41SET(CMAKE_EXE_LINKER_FLAGS " --no-undefined")
42SET(CMAKE_SHARED_LINKER_FLAGS " --no-undefined")
43SET(CMAKE_MODULE_LINKER_FLAGS " --no-undefined")
44
45#Create verbose makefile output when compiling
46SET(CMAKE_VERBOSE_MAKEFILE TRUE)
47
48
49############### Library finding #################
50
51#Performs the search and sets the variables
52FIND_PACKAGE(OGRE)
53FIND_PACKAGE(OIS)
54# FIND_PACKAGE(CEGUI)
55# FIND_PACKAGE(CEGUI_OGRE)
56FIND_PACKAGE(ENet)
57FIND_PACKAGE(Boost REQUIRED thread)
58FIND_PACKAGE(OpenAL)
59FIND_PACKAGE(ALUT)
60FIND_PACKAGE(OggVorbis)
61FIND_PACKAGE(ZLIB)
62FIND_PACKAGE(Lua)
63
64#Set the search paths for the linking
65LINK_DIRECTORIES(
66  ${OGRE_LIB_DIR}
67  ${OIS_LIB_DIR}
68#  ${CEGUI_LIB_DIR} ${CEGUI_OGRE_LIB_DIR}
69  ${ENet_LIBRARY}
70  ${Boost_LIBRARY_DIRS}
71  ${Zlib_LIBRARY_DIR}
72)
73
74#Set the search paths for include files
75INCLUDE_DIRECTORIES(
76  ${OGRE_INCLUDE_DIR}
77  ${OIS_INCLUDE_DIR}
78#  ${CEGUI_INCLUDE_DIR} ${CEGUI_OGRE_INCLUDE_DIR}
79  ${ENet_INCLUDE_DIR}
80  ${Boost_INCLUDE_DIRS}
81  ${OPENAL_INCLUDE_DIR} ${ALUT_INCLUDE_DIR} ${VORBIS_INCLUDE_DIR} ${OGG_INCLUDE_DIR}
82  ${Lua_INCLUDE_DIR}
83)
84
85
86################ Source files ###################
87
88#At first, build lua
89MESSAGE(STATUS "\n******************* Building tolua... ******************\n\n")
90EXECUTE_PROCESS(COMMAND ./tolua-build)
91MESSAGE(STATUS "\n\n******************* Building tolua done ****************\n")
92
93#generate lua bind source files
94EXECUTE_PROCESS(COMMAND bin/./tolua-exec-script)
95
96#add main source dir
97ADD_SUBDIRECTORY(src)
98
Note: See TracBrowser for help on using the repository browser.