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