[84] | 1 | PROJECT(Orxonox) |
---|
| 2 | |
---|
| 3 | #set some global variables, which are use throughout the project |
---|
| 4 | |
---|
| 5 | #Create some verbose output |
---|
| 6 | SET(CMAKE_VERBOSE_MAKEFILE TRUE) |
---|
| 7 | |
---|
[298] | 8 | # set eNet search path |
---|
| 9 | SET(Boost_INCLUDE_DIR "/usr/include/boost/") |
---|
| 10 | |
---|
[84] | 11 | #force-set the compile on tardis machines, as default points to g++-3.3 |
---|
| 12 | # only run this test on a lunix/unix machine |
---|
| 13 | IF (UNIX) |
---|
| 14 | FIND_PROGRAM(UNAME_CMD "uname" |
---|
| 15 | PATHS "/usr/bin /bin") |
---|
| 16 | IF(NOT UNAME_CMD) |
---|
| 17 | MESSAGE("Unable to find uname. Tardis-Check cannot be done.") |
---|
| 18 | ENDIF(NOT UNAME_CMD) |
---|
| 19 | EXECUTE_PROCESS( |
---|
| 20 | COMMAND "${UNAME_CMD}" "-n" |
---|
| 21 | RESULT_VARIABLE UNAME_RV |
---|
| 22 | ERROR_VARIABLE UNAME_EV |
---|
| 23 | OUTPUT_VARIABLE UNAME_OV) |
---|
| 24 | |
---|
| 25 | IF (NOT "${UNAME_RV}" STREQUAL "0") |
---|
| 26 | MESSAGE("ERROR: uname terminated unclean.") |
---|
| 27 | ENDIF (NOT "${UNAME_RV}" STREQUAL "0") |
---|
[303] | 28 | # check wheter we are on a tardis INCLUDEmachine |
---|
[84] | 29 | IF ("${UNAME_OV}" MATCHES "tardis") |
---|
| 30 | SET (IS_TARDIS "tardis") |
---|
| 31 | ENDIF ("${UNAME_OV}" MATCHES "tardis") |
---|
| 32 | # if on tardis change compiler |
---|
| 33 | IF (IS_TARDIS) |
---|
| 34 | MESSAGE("System is a TARDIS: Setting Compiler to g++-3.4.3") |
---|
| 35 | SET(CMAKE_CXX_COMPILER "g++-3.4.3") |
---|
[298] | 36 | # reset eNet serach path |
---|
[297] | 37 | SET(Boost_INCLUDE_DIR "/usr/pack/boost-1.34.1-sd/i686-debian-linux3.1/include/boost-1_34_1") |
---|
[84] | 38 | ENDIF(IS_TARDIS) |
---|
| 39 | ENDIF (UNIX) |
---|
| 40 | |
---|
| 41 | |
---|
| 42 | #This sets where to look for "Find*.cmake" files |
---|
| 43 | SET(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake) |
---|
| 44 | #Performs the search and sets the variables |
---|
| 45 | FIND_PACKAGE(OGRE) |
---|
| 46 | FIND_PACKAGE(OIS) |
---|
[137] | 47 | FIND_PACKAGE(CEGUI) |
---|
| 48 | FIND_PACKAGE(CEGUI_OGRE) |
---|
[293] | 49 | FIND_PACKAGE(ENet) |
---|
[297] | 50 | FIND_PACKAGE(Boost) |
---|
[334] | 51 | FIND_PACKAGE(OpenAL) |
---|
[350] | 52 | FIND_PACKAGE(ALUT) # Only for testing on my machine |
---|
[84] | 53 | |
---|
| 54 | #Sets the search paths for the linking |
---|
[350] | 55 | LINK_DIRECTORIES(${OGRE_LIB_DIR} ${OIS_LIB_DIR} ${CEGUI_LIB_DIR} ${CEGUI_OGRE_LIB_DIR} ${ENet_LIBRARY} ${OPENAL_LIB_DIR} ${ALUT_LIB_DIR} ${Boost_LIBRARY_DIRS} ${OPENAL_LIBRARY} core objects loader network weapon classHierarchy audio openal alut) |
---|
[84] | 56 | #Sets the search path for include files |
---|
[345] | 57 | INCLUDE_DIRECTORIES(${OGRE_INCLUDE_DIR} ${OIS_INCLUDE_DIR} ${CEGUI_INCLUDE_DIR} ${CEGUI_OGRE_INCLUDE_DIR} ${ENet_INCLUDE_DIR} ${Boost_INCLUDE_DIRS} ${OPENAL_INCLUDE_DIR}) |
---|
[84] | 58 | |
---|
| 59 | #add main source dir |
---|
| 60 | ADD_SUBDIRECTORY(src) |
---|
| 61 | |
---|