Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/trunk/CMakeLists.txt @ 1070

Last change on this file since 1070 was 1070, checked in by rgrieder, 16 years ago
  • moved "—no-undefined" linker flag to root CMLs
  • removed library directories for our own libs from root CMLs (might not work)
  • removed warning in Hud.cc (float instead of integer)
File size: 3.1 KB
Line 
1PROJECT(Orxonox)
2#set some global variables, which are used throughout the project
3SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
4SET(LIBRARY_OUTPUT_PATH    ${PROJECT_BINARY_DIR}/bin/lib)
5
6OPTION(TESTING_ENABLED "Do you want to enable Testing")
7IF (TESTING_ENABLED)
8  ENABLE_TESTING()
9ENDIF(TESTING_ENABLED)
10
11OPTION(NETWORK_TESTING_ENABLED "Do you want to build network testing tools: i.e. chatclient chatserver and alike")
12
13#Create some verbose output
14SET(CMAKE_VERBOSE_MAKEFILE TRUE)
15
16# set boost search path
17SET(Boost_INCLUDE_DIR "/usr/include/boost/")
18
19# force-set the compile on tardis machines, as default points to g++-3.3
20# only run this test on a lunix/unix machine
21IF (UNIX)
22
23  FIND_PROGRAM(UNAME_CMD "uname"
24  PATHS "/usr/bin /bin")
25  IF(NOT UNAME_CMD)
26    MESSAGE(ERROR "Unable to find uname. Tardis-Check cannot be done.")
27  ENDIF(NOT UNAME_CMD)
28
29  # run uname -n to get nodename
30  EXECUTE_PROCESS(
31  COMMAND "${UNAME_CMD}" "-n"
32  RESULT_VARIABLE UNAME_RV
33  ERROR_VARIABLE UNAME_EV
34  OUTPUT_VARIABLE UNAME_OV)
35
36  IF (NOT "${UNAME_RV}" STREQUAL "0")
37    MESSAGE(ERROR "ERROR: uname terminated unclean.")
38  ENDIF (NOT "${UNAME_RV}" STREQUAL "0")
39
40  # check wheter we are on a tardis machine
41  IF ("${UNAME_OV}" MATCHES "tardis")
42    SET (IS_TARDIS ON)
43  ENDIF ("${UNAME_OV}" MATCHES "tardis")
44
45  # if on tardis change compiler
46  IF(IS_TARDIS)
47    MESSAGE("System is a TARDIS: Setting Compiler to g++-4.1.1")
48    SET(CMAKE_CXX_COMPILER "g++-4.1.1")
49    # reset Boost serach path
50    SET(Boost_INCLUDE_DIR "/usr/pack/boost-1.34.1-sd/i686-debian-linux3.1/include")
51  ENDIF(IS_TARDIS)
52
53ENDIF (UNIX)
54
55# pipe $FLAGS to the compiler, and add some local flags. force -O2!
56SET(CMAKE_C_FLAGS "$ENV{CFLAGS} -O2 -Wall -g -ggdb")
57SET(CMAKE_CXX_FLAGS "$ENV{CXXFLAGS} -O2 -Wall -g -ggdb")
58SET(CMAKE_LD_FLAGS "$ENV{LDFLAGS}")
59SET(CMAKE_EXE_LINKER_FLAGS " --no-undefined")
60SET(CMAKE_SHARED_LINKER_FLAGS " --no-undefined")
61#SET(CMAKE_MODULE_LINKER_FLAGS " --no-undefined")
62
63#This sets where to look for "Find*.cmake" files
64SET(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
65#Performs the search and sets the variables
66FIND_PACKAGE(OGRE)
67FIND_PACKAGE(OIS)
68# FIND_PACKAGE(CEGUI)
69# FIND_PACKAGE(CEGUI_OGRE)
70FIND_PACKAGE(ENet)
71FIND_PACKAGE(Boost REQUIRED thread)
72FIND_PACKAGE(OpenAL)
73FIND_PACKAGE(ALUT)
74FIND_PACKAGE(OggVorbis)
75FIND_PACKAGE(ZLIB)
76FIND_PACKAGE(Lua)
77
78#Sets the search paths for the linking
79LINK_DIRECTORIES(
80  ${OGRE_LIB_DIR}
81  ${OIS_LIB_DIR}
82  ${CEGUI_LIB_DIR} ${CEGUI_OGRE_LIB_DIR}
83  ${ENet_LIBRARY}
84  ${Boost_LIBRARY_DIRS}
85  ${Zlib_LIBRARY_DIR}
86  ${Lua_LIBRARIES}
87#  core objects loader network weapon classHierarchy audio
88)
89
90#Sets the search path for include files
91INCLUDE_DIRECTORIES(
92  ${OGRE_INCLUDE_DIR}
93  ${OIS_INCLUDE_DIR}
94  ${CEGUI_INCLUDE_DIR} ${CEGUI_OGRE_INCLUDE_DIR}
95  ${ENet_INCLUDE_DIR}
96  ${Boost_INCLUDE_DIRS}
97  ${OPENAL_INCLUDE_DIR} ${ALUT_INCLUDE_DIR} ${VORBIS_INCLUDE_DIR} ${OGG_INCLUDE_DIR}
98  ${Lua_INCLUDE_DIR}
99)
100
101#Set the execution directory
102
103#add main source dir
104ADD_SUBDIRECTORY(src)
Note: See TracBrowser for help on using the repository browser.