Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/trunk/CMakeLists.txt @ 1214

Last change on this file since 1214 was 1214, checked in by landauf, 16 years ago

merged console-branch back to trunk.
IMPORTANT: update your media directory!

you need TCL to compile. TCL is available here: http://www.tcl.tk/
another option is to check out https://svn.orxonox.net/ogre/tcl8.5.2/ and compile it by yourself. makefiles are in the 'macosx', 'unix' and 'win' subfolders.
FindTCL.cmake searches in the usual locations and in ../libs/tcl8.5.2/

the orxonox console can be activated with numpad-enter. whatever you enter will be parsed by TCL. if TCL doesn't know a command, it gets executed by orxonox.

simple tcl commands are: "puts text" to write "text" into the console, "expr 1+1" to calculate the result of the given expression. just try it by yourself with "puts [expr 1+1]".
[x] means: evaluate x and use the returnvalue as an argument. in this case the returned value is "2" and the resulting command therefore "puts 2".

you can combine orxonox and tcl commands. a simple orxonox command is "log text" that writes text into the console and the logfile. test it with "log [expr 1+1]" to write "2" into all output channels of orxonox. something more advanced: "log [clock seconds]" writes the seconds since 1970 into the logfile. feel free to combine both: "log [clock seconds]: 1+1 is [expr 1+1]"

TCL uses variables. to set a new variable, use "set varname value". you can use the variable wherever you want with $varname. with this we can make the above command a bit more elegant:
set myexpression 1+1
log [clock seconds]: $myexpression is [expr $myexpression]

read more about tcl in the wiki: http://wiki.tcl.tk/

File size: 2.7 KB
Line 
1PROJECT(Orxonox)
2
3cmake_minimum_required(VERSION 2.4)
4
5if(COMMAND cmake_policy)
6  cmake_policy(SET CMP0003 NEW)
7endif(COMMAND cmake_policy)
8
9#This sets where to look for modules (e.g. "Find*.cmake" files)
10SET(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
11
12#Check whether we are on a tardis box
13INCLUDE(CheckTardis)
14
15
16############## Testing options ##################
17
18OPTION(TESTING_ENABLED "Do you want to enable Testing")
19IF (TESTING_ENABLED)
20  ENABLE_TESTING()
21ENDIF(TESTING_ENABLED)
22
23OPTION(NETWORK_TESTING_ENABLED "Do you want to build network testing tools: i.e. chatclient chatserver and alike")
24
25
26########## Compiler/Linker options ##############
27
28# if on tardis change compiler and reset boost include directory
29IF(IS_TARDIS)
30  MESSAGE("System is a TARDIS: Setting Compiler to g++-4.1.1")
31  # force-set the compiler on tardis machines, as default points to g++-3.3
32  SET(CMAKE_CXX_COMPILER "g++-4.1.1")
33  # reset Boost serach path
34  SET(Boost_INCLUDE_DIR "/usr/pack/boost-1.34.1-sd/i686-debian-linux3.1/include")
35ELSE (IS_TARDIS)
36  SET(Boost_INCLUDE_DIR "/usr/include/boost")
37ENDIF(IS_TARDIS)
38
39#set binary output directories
40SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)
41SET(LIBRARY_OUTPUT_PATH    ${PROJECT_SOURCE_DIR}/bin/lib)
42
43# global compiler/linker flags. force -O2!
44SET(CMAKE_C_FLAGS "$ENV{CFLAGS} -O2 -Wall -g -ggdb")
45SET(CMAKE_CXX_FLAGS "$ENV{CXXFLAGS} -O2 -Wall -g -ggdb")
46SET(CMAKE_LD_FLAGS "$ENV{LDFLAGS}")
47SET(CMAKE_EXE_LINKER_FLAGS " --no-undefined")
48SET(CMAKE_SHARED_LINKER_FLAGS " --no-undefined")
49SET(CMAKE_MODULE_LINKER_FLAGS " --no-undefined")
50
51#use 'cmake -D make_verb:1 path' to get verbose make output when compiling
52IF (MAKE_VERB)
53 SET(CMAKE_VERBOSE_MAKEFILE TRUE)
54ENDIF (MAKE_VERB)
55
56
57############### Library finding #################
58
59#Performs the search and sets the variables
60FIND_PACKAGE(OGRE)
61FIND_PACKAGE(OIS)
62# FIND_PACKAGE(CEGUI)
63# FIND_PACKAGE(CEGUI_OGRE)
64FIND_PACKAGE(ENet)
65FIND_PACKAGE(Boost REQUIRED thread)
66FIND_PACKAGE(OpenAL)
67FIND_PACKAGE(ALUT)
68FIND_PACKAGE(OggVorbis)
69FIND_PACKAGE(ZLIB)
70FIND_PACKAGE(Lua)
71FIND_PACKAGE(TCL)
72
73#Set the search paths for the linking
74LINK_DIRECTORIES(
75  ${OGRE_LIB_DIR}
76  ${OIS_LIB_DIR}
77#  ${CEGUI_LIB_DIR} ${CEGUI_OGRE_LIB_DIR}
78  ${ENet_LIBRARY}
79  ${Boost_LIBRARY_DIRS}
80  ${Zlib_LIBRARY_DIR}
81  ${TCL_LIBRARY}
82)
83
84#Set the search paths for include files
85INCLUDE_DIRECTORIES(
86  ${OGRE_INCLUDE_DIR}
87  ${OIS_INCLUDE_DIR}
88#  ${CEGUI_INCLUDE_DIR} ${CEGUI_OGRE_INCLUDE_DIR}
89  ${ENet_INCLUDE_DIR}
90  ${Boost_INCLUDE_DIRS}
91  ${OPENAL_INCLUDE_DIR}
92  ${ALUT_INCLUDE_DIR}
93  ${VORBIS_INCLUDE_DIR}
94  ${OGG_INCLUDE_DIR}
95  ${Lua_INCLUDE_DIR}
96  ${TCL_INCLUDE_PATH}
97)
98
99#add main source dir
100ADD_SUBDIRECTORY(src)
101
Note: See TracBrowser for help on using the repository browser.