Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 1071


Ignore:
Timestamp:
Apr 15, 2008, 1:40:54 PM (17 years ago)
Author:
rgrieder
Message:
  • restructured root CMLs and exported tardis check to cmake/CheckTardis.cmake
  • not tested yet ;)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/CMakeLists.txt

    r1070 r1071  
    11PROJECT(Orxonox)
    2 #set some global variables, which are used throughout the project
    3 SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
    4 SET(LIBRARY_OUTPUT_PATH    ${PROJECT_BINARY_DIR}/bin/lib)
     2
     3#This sets where to look for modules (e.g. "Find*.cmake" files)
     4SET(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
     5
     6#Check whether we are on a tardis box
     7INCLUDE(CheckTardis)
     8
     9
     10############## Testing options ##################
    511
    612OPTION(TESTING_ENABLED "Do you want to enable Testing")
     
    1117OPTION(NETWORK_TESTING_ENABLED "Do you want to build network testing tools: i.e. chatclient chatserver and alike")
    1218
    13 #Create some verbose output
    14 SET(CMAKE_VERBOSE_MAKEFILE TRUE)
    1519
    16 # set boost search path
    17 SET(Boost_INCLUDE_DIR "/usr/include/boost/")
     20########## Compiler/Linker options ##############
    1821
    19 # force-set the compile on tardis machines, as default points to g++-3.3
    20 # only run this test on a lunix/unix machine
    21 IF (UNIX)
     22# if on tardis change compiler and reset boost include directory
     23IF(IS_TARDIS)
     24  MESSAGE("System is a TARDIS: Setting Compiler to g++-4.1.1")
     25  # force-set the compiler on tardis machines, as default points to g++-3.3
     26  SET(CMAKE_CXX_COMPILER "g++-4.1.1")
     27  # reset Boost serach path
     28  SET(Boost_INCLUDE_DIR "/usr/pack/boost-1.34.1-sd/i686-debian-linux3.1/include")
     29ELSE (IS_TARDIS)
     30  SET(Boost_INCLUDE_DIR "/usr/include/boost")
     31ENDIF(IS_TARDIS)
    2232
    23   FIND_PROGRAM(UNAME_CMD "uname"
    24   PATHS "/usr/bin /bin")
    25   IF(NOT UNAME_CMD)
    26     MESSAGE(ERROR "Unable to find uname. Tardis-Check cannot be done.")
    27   ENDIF(NOT UNAME_CMD)
     33#set binary output directories
     34SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
     35SET(LIBRARY_OUTPUT_PATH    ${PROJECT_BINARY_DIR}/bin/lib)
    2836
    29   # run uname -n to get nodename
    30   EXECUTE_PROCESS(
    31   COMMAND "${UNAME_CMD}" "-n"
    32   RESULT_VARIABLE UNAME_RV
    33   ERROR_VARIABLE UNAME_EV
    34   OUTPUT_VARIABLE UNAME_OV)
    35 
    36   IF (NOT "${UNAME_RV}" STREQUAL "0")
    37     MESSAGE(ERROR "ERROR: uname terminated unclean.")
    38   ENDIF (NOT "${UNAME_RV}" STREQUAL "0")
    39 
    40   # check wheter we are on a tardis machine
    41   IF ("${UNAME_OV}" MATCHES "tardis")
    42     SET (IS_TARDIS ON)
    43   ENDIF ("${UNAME_OV}" MATCHES "tardis")
    44 
    45   # if on tardis change compiler
    46   IF(IS_TARDIS)
    47     MESSAGE("System is a TARDIS: Setting Compiler to g++-4.1.1")
    48     SET(CMAKE_CXX_COMPILER "g++-4.1.1")
    49     # reset Boost serach path
    50     SET(Boost_INCLUDE_DIR "/usr/pack/boost-1.34.1-sd/i686-debian-linux3.1/include")
    51   ENDIF(IS_TARDIS)
    52 
    53 ENDIF (UNIX)
    54 
    55 # pipe $FLAGS to the compiler, and add some local flags. force -O2!
     37# global compiler/linker flags. force -O2!
    5638SET(CMAKE_C_FLAGS "$ENV{CFLAGS} -O2 -Wall -g -ggdb")
    5739SET(CMAKE_CXX_FLAGS "$ENV{CXXFLAGS} -O2 -Wall -g -ggdb")
     
    5941SET(CMAKE_EXE_LINKER_FLAGS " --no-undefined")
    6042SET(CMAKE_SHARED_LINKER_FLAGS " --no-undefined")
    61 #SET(CMAKE_MODULE_LINKER_FLAGS " --no-undefined")
     43SET(CMAKE_MODULE_LINKER_FLAGS " --no-undefined")
    6244
    63 #This sets where to look for "Find*.cmake" files
    64 SET(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
     45#Create verbose makefile output when compiling
     46SET(CMAKE_VERBOSE_MAKEFILE TRUE)
     47
     48
     49############### Library finding #################
     50
    6551#Performs the search and sets the variables
    6652FIND_PACKAGE(OGRE)
     
    7662FIND_PACKAGE(Lua)
    7763
    78 #Sets the search paths for the linking
     64#Set the search paths for the linking
    7965LINK_DIRECTORIES(
    8066  ${OGRE_LIB_DIR}
    8167  ${OIS_LIB_DIR}
    82   ${CEGUI_LIB_DIR} ${CEGUI_OGRE_LIB_DIR}
     68#  ${CEGUI_LIB_DIR} ${CEGUI_OGRE_LIB_DIR}
    8369  ${ENet_LIBRARY}
    8470  ${Boost_LIBRARY_DIRS}
     
    8874)
    8975
    90 #Sets the search path for include files
     76#Set the search paths for include files
    9177INCLUDE_DIRECTORIES(
    9278  ${OGRE_INCLUDE_DIR}
    9379  ${OIS_INCLUDE_DIR}
    94   ${CEGUI_INCLUDE_DIR} ${CEGUI_OGRE_INCLUDE_DIR}
     80#  ${CEGUI_INCLUDE_DIR} ${CEGUI_OGRE_INCLUDE_DIR}
    9581  ${ENet_INCLUDE_DIR}
    9682  ${Boost_INCLUDE_DIRS}
    97   ${OPENAL_INCLUDE_DIR} ${ALUT_INCLUDE_DIR} ${VORBIS_INCLUDE_DIR} ${OGG_INCLUDE_DIR}
     83#  ${OPENAL_INCLUDE_DIR} ${ALUT_INCLUDE_DIR} ${VORBIS_INCLUDE_DIR} ${OGG_INCLUDE_DIR}
    9884  ${Lua_INCLUDE_DIR}
    9985)
    10086
    101 #Set the execution directory
     87
     88################ Source files ###################
    10289
    10390#add main source dir
Note: See TracChangeset for help on using the changeset viewer.