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