Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/physics/CMakeLists.txt @ 2036

Last change on this file since 2036 was 1920, checked in by rgrieder, 16 years ago

First attempt to find ODE on a tardis box.

  • Property svn:eol-style set to native
File size: 3.7 KB
RevLine 
[1505]1PROJECT(Orxonox)
2
3cmake_minimum_required(VERSION 2.4)
4
[1776]5IF (COMMAND cmake_policy)
[1505]6  cmake_policy(SET CMP0003 NEW)
[1776]7ENDIF (COMMAND cmake_policy)
[1505]8
[1872]9# Allow for simple IF constructs (makes code a lot more readable)
10#SET(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS true)
11
[1776]12# This sets where to look for modules (e.g. "Find*.cmake" files)
[1505]13SET(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
14
[1776]15# Check whether we are on a tardis box
[1505]16INCLUDE(CheckTardis)
17
18
19############## Testing options ##################
20
21OPTION(TESTING_ENABLED "Do you want to enable Testing")
22IF (TESTING_ENABLED)
23  ENABLE_TESTING()
24ENDIF(TESTING_ENABLED)
25
[1776]26OPTION (NETWORK_TESTING_ENABLED "Do you want to build network testing tools: i.e. chatclient chatserver and alike")
27OPTION (NETWORKTRAFFIC_TESTING_ENABLED "Do you want to build dummyserver4 and dummyclient4")
[1505]28
29
30########## Compiler/Linker options ##############
31
32# if on tardis change compiler and reset boost include directory
33IF(IS_TARDIS)
34  MESSAGE("System is a TARDIS: Setting Compiler to g++-4.1.1")
[1776]35  # Force-set the compiler on tardis machines, as default points to g++-3.3
[1505]36  SET(CMAKE_CXX_COMPILER "g++-4.1.1")
[1776]37  # Reset Boost serach path
[1505]38  SET(Boost_INCLUDE_DIR "/usr/pack/boost-1.34.1-sd/i686-debian-linux3.1/include")
39ELSE (IS_TARDIS)
[1776]40  IF (NOT WIN32)
41    SET(Boost_INCLUDE_DIR "/usr/include/boost")
42  ENDIF (NOT WIN32)
[1505]43ENDIF(IS_TARDIS)
44
[1776]45# Set binary output directories
[1505]46SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)
47SET(LIBRARY_OUTPUT_PATH    ${PROJECT_SOURCE_DIR}/bin/lib)
48
[1776]49# Global compiler/linker flags. force -O2!
[1874]50SET(CMAKE_C_FLAGS "$ENV{CFLAGS} -O0 -Wall -g -ggdb")
51SET(CMAKE_CXX_FLAGS "$ENV{CXXFLAGS} -O0 -Wall -g -ggdb")
[1889]52#SET(CMAKE_C_FLAGS "$ENV{CFLAGS} -O3 -s")
53#SET(CMAKE_CXX_FLAGS "$ENV{CXXFLAGS} -O3 -s")
[1505]54
55SET(CMAKE_LD_FLAGS "$ENV{LDFLAGS}")
56SET(CMAKE_EXE_LINKER_FLAGS " --no-undefined")
57SET(CMAKE_SHARED_LINKER_FLAGS " --no-undefined")
58SET(CMAKE_MODULE_LINKER_FLAGS " --no-undefined")
59
[1776]60# Use 'cmake -D make_verb:1 path' to get verbose make output when compiling
[1505]61IF (MAKE_VERB)
62 SET(CMAKE_VERBOSE_MAKEFILE TRUE)
63ENDIF (MAKE_VERB)
64
65
66############### Library finding #################
67
[1776]68# Uncomment the following line if you want the include and library paths to be shown
69# Alternatively use the "-D VERBOSE_FIND:BOOL=true" option when executing cmake
70
71# SET (VERBOSE_FIND true)
72
[1872]73# Set the library directory when using precompiled tarballs for the dependencies under windows
74IF (WIN32)
75  IF (MSVC)
76    IF ($ENV{ORXONOX_DEV})
77      SET (DEPENDENCY_DIR ${CMAKE_SOURCE_DIR}/../lib_dist/dependencies/)
78    ELSE ($ENV{ORXONOX_DEV})
79      SET (DEPENDENCY_DIR ${CMAKE_SOURCE_DIR}/dependencies/)
80    ENDIF ($ENV{ORXONOX_DEV})
81    SET(Boost_LIB_SUFFIX_DEBUG vc80-mt-gd-1_35)
82  ENDIF (MSVC)
83ENDIF (WIN32)
84MESSAGE(STATUS ${DEPENDENCY_DIR})
85
[1776]86# Performs the search and sets the variables
[1505]87FIND_PACKAGE(OGRE)
[1755]88FIND_PACKAGE(CEGUI)
[1505]89# FIND_PACKAGE(CEGUI_OGRE)
90FIND_PACKAGE(ENet)
[1535]91FIND_PACKAGE(Boost REQUIRED thread filesystem)
[1505]92FIND_PACKAGE(OpenAL)
93FIND_PACKAGE(ALUT)
94FIND_PACKAGE(OggVorbis)
95FIND_PACKAGE(ZLIB)
[1810]96#FIND_PACKAGE(Lua)
[1505]97FIND_PACKAGE(TCL)
98FIND_PACKAGE(DirectX)
[1920]99FIND_PACKAGE(ODE)
[1505]100
[1776]101# Set the search paths for the linking
[1505]102LINK_DIRECTORIES(
103  ${OGRE_LIB_DIR}
[1776]104  ${CEGUI_LIB_DIR}
[1810]105#  ${CEGUI_SCRIPT_LIB_DIR}
[1776]106#  ${CEGUI_OGRE_LIB_DIR}
[1505]107  ${ENet_LIBRARY}
108  ${Boost_LIBRARY_DIRS}
109  ${Zlib_LIBRARY_DIR}
110  ${TCL_LIBRARY}
[1920]111  ${ODE_LIB_DIR}
[1505]112)
113
[1776]114# Set the search paths for include files
[1505]115INCLUDE_DIRECTORIES(
116  ${OGRE_INCLUDE_DIR}
[1776]117  ${CEGUI_INCLUDE_DIR}
118#  ${CEGUI_OGRE_INCLUDE_DIR}
[1505]119  ${ENet_INCLUDE_DIR}
120  ${Boost_INCLUDE_DIRS}
121  ${OPENAL_INCLUDE_DIR}
122  ${ALUT_INCLUDE_DIR}
123  ${VORBIS_INCLUDE_DIR}
124  ${OGG_INCLUDE_DIR}
[1810]125#  ${Lua_INCLUDE_DIR}
[1505]126  ${TCL_INCLUDE_PATH}
127  ${DirectX_INCLUDE_DIR}
128  ${ZLIB_INCLUDE_DIR}
[1920]129  ${ODE_INCLUDE_DIR}
[1505]130)
131
[1776]132# Add main source dir
[1505]133ADD_SUBDIRECTORY(src)
134
Note: See TracBrowser for help on using the repository browser.