Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/FICN/CMakeLists.txt @ 388

Last change on this file since 388 was 386, checked in by nicolasc, 17 years ago

some *FLAGS tweaking

File size: 2.2 KB
Line 
1PROJECT(Orxonox)
2#set some global variables, which are used throughout the project
3
4#Create some verbose output
5SET(CMAKE_VERBOSE_MAKEFILE TRUE)
6
7# set boost search path
8SET(Boost_INCLUDE_DIR "/usr/include/boost/")
9
10# force-set the compile on tardis machines, as default points to g++-3.3
11# only run this test on a lunix/unix machine
12IF (UNIX)
13
14  FIND_PROGRAM(UNAME_CMD "uname"
15  PATHS "/usr/bin /bin")
16  IF(NOT UNAME_CMD)
17    MESSAGE("Unable to find uname. Tardis-Check cannot be done.")
18  ENDIF(NOT UNAME_CMD)
19
20  # run uname -n to get nodename
21  EXECUTE_PROCESS(
22  COMMAND "${UNAME_CMD}" "-n"
23  RESULT_VARIABLE UNAME_RV
24  ERROR_VARIABLE UNAME_EV
25  OUTPUT_VARIABLE UNAME_OV)
26
27  IF (NOT "${UNAME_RV}" STREQUAL "0")
28    MESSAGE("ERROR: uname terminated unclean.")
29  ENDIF (NOT "${UNAME_RV}" STREQUAL "0")
30
31  # check wheter we are on a tardis machine
32  IF ("${UNAME_OV}" MATCHES "tardis")
33    SET (IS_TARDIS "tardis")
34  ENDIF ("${UNAME_OV}" MATCHES "tardis")
35
36  # if on tardis change compiler
37  IF (IS_TARDIS)
38    MESSAGE("System is a TARDIS: Setting Compiler to g++-4.1.1")
39    SET(CMAKE_CXX_COMPILER "g++-4.1.1")
40    # reset eNet serach path
41    SET(Boost_INCLUDE_DIR "/usr/pack/boost-1.34.1-sd/i686-debian-linux3.1/include/boost-1_34_1")
42  ENDIF(IS_TARDIS)
43
44ENDIF (UNIX)
45
46# pipe $FLAGS to the compiler, and add some local flags. force -O2!
47SET(CMAKE_C_FLAGS "$ENV{CFLAGS} -O2 -Wall -g -ggdb")
48SET(CMAKE_CXX_FLAGS "$ENV{CXXFLAGS} -O2 -Wall -g -ggdb")
49SET(CMAKE_LD_FLAGS "$ENV{LDFLAGS}")
50
51
52#This sets where to look for "Find*.cmake" files
53SET(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
54
55#Performs the search and sets the variables
56FIND_PACKAGE(OGRE)
57FIND_PACKAGE(OIS)
58FIND_PACKAGE(CEGUI)
59FIND_PACKAGE(CEGUI_OGRE)
60FIND_PACKAGE(ENet)
61FIND_PACKAGE(Boost)
62
63#Sets the search paths for the linker
64LINK_DIRECTORIES(
65  ${OGRE_LIB_DIR}
66  ${OIS_LIB_DIR}
67  ${CEGUI_LIB_DIR}
68  ${CEGUI_OGRE_LIB_DIR}
69  ${ENet_LIBRARY}
70  ${Boost_LIBRARY_DIRS}
71)
72
73#Sets the search path for include files
74INCLUDE_DIRECTORIES(
75  ${OGRE_INCLUDE_DIR}
76  ${OIS_INCLUDE_DIR}
77  ${CEGUI_INCLUDE_DIR}
78  ${CEGUI_OGRE_INCLUDE_DIR}
79  ${ENet_INCLUDE_DIR}
80  ${Boost_INCLUDE_DIRS}
81)
82
83
84#add main source dir
85ADD_SUBDIRECTORY(src)
Note: See TracBrowser for help on using the repository browser.