Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

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