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