Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/script/CMakeLists.txt @ 956

Last change on this file since 956 was 946, checked in by bknecht, 16 years ago

trying to link lua into the project and start with creating an interface to lua. still does not compile. stupid cmake

File size: 2.9 KB
Line 
1PROJECT(Orxonox)
2#set some global variables, which are used throughout the project
3SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
4SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin/lib)
5
6OPTION(TESTING_ENABLED "Do you want to enable Testing")
7IF (TESTING_ENABLED)
8  ENABLE_TESTING()
9ENDIF(TESTING_ENABLED)
10
11OPTION(NETWORK_TESTING_ENABLED "Do you want to build network testing tools: i.e. chatclient chatserver and alike")
12
13#Create some verbose output
14SET(CMAKE_VERBOSE_MAKEFILE TRUE)
15
16# set boost search path
17SET(Boost_INCLUDE_DIR "/usr/include/boost/")
18
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
21IF (UNIX)
22
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)
28
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
53ENDIF (UNIX)
54
55# pipe $FLAGS to the compiler, and add some local flags. force -O2!
56SET(CMAKE_C_FLAGS "$ENV{CFLAGS} -O2 -Wall -g -ggdb")
57SET(CMAKE_CXX_FLAGS "$ENV{CXXFLAGS} -O2 -Wall -g -ggdb")
58SET(CMAKE_LD_FLAGS "$ENV{LDFLAGS}")
59
60#This sets where to look for "Find*.cmake" files
61SET(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
62#Performs the search and sets the variables
63FIND_PACKAGE(OGRE)
64FIND_PACKAGE(OIS)
65# FIND_PACKAGE(CEGUI)
66# FIND_PACKAGE(CEGUI_OGRE)
67FIND_PACKAGE(ENet)
68FIND_PACKAGE(Boost REQUIRED thread)
69FIND_PACKAGE(OpenAL)
70FIND_PACKAGE(ALUT)
71FIND_PACKAGE(OggVorbis)
72FIND_PACKAGE(ZLIB)
73FIND_PACKAGE(Lua)
74
75#Sets the search paths for the linking
76LINK_DIRECTORIES(${OGRE_LIB_DIR} ${OIS_LIB_DIR} ${CEGUI_LIB_DIR} ${CEGUI_OGRE_LIB_DIR} ${ENet_LIBRARY} ${Boost_LIBRARY_DIRS} ${Zlib_LIBRARY_DIR} ${Lua_LIBRARIES} core objects loader network weapon classHierarchy audio)
77#Sets the search path for include files
78INCLUDE_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} ${Lua_INCLUDE_DIR})
79
80#Set the execution directory
81
82#add main source dir
83ADD_SUBDIRECTORY(src)
Note: See TracBrowser for help on using the repository browser.