[341] | 1 | PROJECT(Orxonox) |
---|
[376] | 2 | #set some global variables, which are used throughout the project |
---|
[341] | 3 | |
---|
[727] | 4 | OPTION(TESTING_ENABLED "Do you want to enable Testing") |
---|
| 5 | IF (TESTING_ENABLED) |
---|
| 6 | ENABLE_TESTING() |
---|
| 7 | ENDIF(TESTING_ENABLED) |
---|
| 8 | |
---|
[341] | 9 | #Create some verbose output |
---|
| 10 | SET(CMAKE_VERBOSE_MAKEFILE TRUE) |
---|
| 11 | |
---|
[376] | 12 | # set boost search path |
---|
[341] | 13 | SET(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 |
---|
| 17 | IF (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] | 49 | ENDIF (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] | 53 | SET(CMAKE_C_FLAGS "$ENV{CFLAGS} -O2 -Wall -g -ggdb") |
---|
[565] | 54 | #SET(CMAKE_CXX_FLAGS "$ENV{CXXFLAGS} -O2 -Wall -g -ggdb") |
---|
[571] | 55 | SET(CMAKE_CXX_FLAGS "$ENV{CXXFLAGS} -O2 -Wall -g -ggdb") |
---|
[386] | 56 | SET(CMAKE_LD_FLAGS "$ENV{LDFLAGS}") |
---|
[341] | 57 | |
---|
[382] | 58 | |
---|
[341] | 59 | #This sets where to look for "Find*.cmake" files |
---|
| 60 | SET(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake) |
---|
| 61 | #Performs the search and sets the variables |
---|
| 62 | FIND_PACKAGE(OGRE) |
---|
| 63 | FIND_PACKAGE(OIS) |
---|
| 64 | FIND_PACKAGE(CEGUI) |
---|
| 65 | FIND_PACKAGE(CEGUI_OGRE) |
---|
| 66 | FIND_PACKAGE(ENet) |
---|
| 67 | FIND_PACKAGE(Boost) |
---|
[389] | 68 | FIND_PACKAGE(OpenAL) |
---|
| 69 | FIND_PACKAGE(ALUT) |
---|
[402] | 70 | FIND_PACKAGE(OggVorbis) |
---|
[539] | 71 | FIND_PACKAGE(ZLIB) |
---|
[341] | 72 | |
---|
[389] | 73 | #Sets the search paths for the linking |
---|
[538] | 74 | LINK_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] | 76 | INCLUDE_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 |
---|
| 79 | ADD_SUBDIRECTORY(src) |
---|