Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

Last change on this file since 729 was 728, checked in by nicolasc, 17 years ago
  • various cleanup
  • improved readability in PI
  • fixed iterator in language
File size: 2.6 KB
RevLine 
[341]1PROJECT(Orxonox)
[376]2#set some global variables, which are used throughout the project
[341]3
[727]4OPTION(TESTING_ENABLED "Do you want to enable Testing")
5IF (TESTING_ENABLED)
6ENABLE_TESTING()
7ENDIF(TESTING_ENABLED)
8
[341]9#Create some verbose output
10SET(CMAKE_VERBOSE_MAKEFILE TRUE)
11
[376]12# set boost search path
[341]13SET(Boost_INCLUDE_DIR "/usr/include/boost/")
14
[354]15# force-set the compile on tardis machines, as default points to g++-3.3
[341]16# only run this test on a lunix/unix machine
17IF (UNIX)
[354]18
[341]19  FIND_PROGRAM(UNAME_CMD "uname"
[354]20  PATHS "/usr/bin /bin")
[341]21  IF(NOT UNAME_CMD)
[354]22    MESSAGE("Unable to find uname. Tardis-Check cannot be done.")
[341]23  ENDIF(NOT UNAME_CMD)
[354]24
25  # run uname -n to get nodename
[341]26  EXECUTE_PROCESS(
[354]27  COMMAND "${UNAME_CMD}" "-n"
28  RESULT_VARIABLE UNAME_RV
29  ERROR_VARIABLE UNAME_EV
30  OUTPUT_VARIABLE UNAME_OV)
[341]31
32  IF (NOT "${UNAME_RV}" STREQUAL "0")
[354]33    MESSAGE("ERROR: uname terminated unclean.")
[341]34  ENDIF (NOT "${UNAME_RV}" STREQUAL "0")
[354]35
36  # check wheter we are on a tardis machine
[341]37  IF ("${UNAME_OV}" MATCHES "tardis")
38    SET (IS_TARDIS "tardis")
39  ENDIF ("${UNAME_OV}" MATCHES "tardis")
[354]40
[341]41  # if on tardis change compiler
42  IF (IS_TARDIS)
[354]43    MESSAGE("System is a TARDIS: Setting Compiler to g++-4.1.1")
44    SET(CMAKE_CXX_COMPILER "g++-4.1.1")
45    # reset eNet serach path
[466]46    SET(Boost_INCLUDE_DIR "/usr/pack/boost-1.34.1-sd/i686-debian-linux3.1/include")
[341]47  ENDIF(IS_TARDIS)
[354]48
[341]49ENDIF (UNIX)
50
[386]51# pipe $FLAGS to the compiler, and add some local flags. force -O2!
[565]52#SET(CMAKE_C_FLAGS "$ENV{CFLAGS} -O2 -Wall -g -ggdb")
[386]53SET(CMAKE_C_FLAGS "$ENV{CFLAGS} -O2 -Wall -g -ggdb")
[565]54#SET(CMAKE_CXX_FLAGS "$ENV{CXXFLAGS} -O2 -Wall -g -ggdb")
[571]55SET(CMAKE_CXX_FLAGS "$ENV{CXXFLAGS} -O2 -Wall -g -ggdb")
[386]56SET(CMAKE_LD_FLAGS "$ENV{LDFLAGS}")
[341]57
[382]58
[341]59#This sets where to look for "Find*.cmake" files
60SET(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
61#Performs the search and sets the variables
62FIND_PACKAGE(OGRE)
63FIND_PACKAGE(OIS)
64FIND_PACKAGE(CEGUI)
65FIND_PACKAGE(CEGUI_OGRE)
66FIND_PACKAGE(ENet)
67FIND_PACKAGE(Boost)
[389]68FIND_PACKAGE(OpenAL)
69FIND_PACKAGE(ALUT)
[402]70FIND_PACKAGE(OggVorbis)
[539]71FIND_PACKAGE(ZLIB)
[341]72
[389]73#Sets the search paths for the linking
[538]74LINK_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)
[341]75#Sets the search path for include files
[538]76INCLUDE_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})
[341]77
78#add main source dir
79ADD_SUBDIRECTORY(src)
Note: See TracBrowser for help on using the repository browser.