Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/trunk/src/orxonox/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: 1.5 KB
Line 
1SET( ORXONOX_SRC_FILES
2  GraphicsEngine.cc
3  Main.cc
4  Orxonox.cc
5  console/InGameConsole.cc
6#  SpaceshipSteering.cc
7  hud/HUD.cc
8  particle/ParticleInterface.cc
9  tools/BillboardSet.cc
10  tools/Light.cc
11  tools/Mesh.cc
12  tools/Timer.cc
13  objects/Ambient.cc
14  objects/Camera.cc
15  objects/Explosion.cc
16#  objects/Fighter.cc
17  objects/Model.cc
18  objects/NPC.cc
19  objects/Projectile.cc
20  objects/Skybox.cc
21  objects/SpaceShip.cc
22#  objects/SpaceshipSteeringObject.cc
23#  objects/test1.cc
24#  objects/test2.cc
25#  objects/test3.cc
26  objects/WorldEntity.cc
27#  objects/weapon/AmmunitionDump.cc
28#  objects/weapon/BarrelGun.cc
29#  objects/weapon/BaseWeapon.cc
30#  objects/weapon/Bullet.cc
31#  objects/weapon/BulletManager.cc
32#  objects/weapon/WeaponStation.cc
33  tolua/tolua_bind.cc
34#  tolua/tolua_bind.h
35)
36
37#SET_SOURCE_FILES_PROPERTIES(tolua/tolua_bind.h
38#  PROPERTIES
39#  OBJECT_DEPENDS tolua/tolua_bind.h
40#  OBJECT_DEPENDS tolua/tolua_bind.cc
41#  GENERATED true
42#  HEADER_FILE_ONLY true
43#)
44
45GET_TARGET_PROPERTY(TOLUA_EXE tolua LOCATION)
46ADD_CUSTOM_COMMAND(
47  OUTPUT tolua/tolua_bind.cc tolua/tolua_bind.h
48  COMMAND ${TOLUA_EXE} -n orxonox -o ../../src/orxonox/tolua/tolua_bind.cc -H ../../src/orxonox/tolua/tolua_bind.h ../../src/orxonox/tolua/tolua.pkg
49  DEPENDS tolua
50  WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/bin/lib
51)
52       
53ADD_EXECUTABLE( orxonox ${ORXONOX_SRC_FILES} )
54
55TARGET_LINK_LIBRARIES( orxonox
56  ${OGRE_LIBRARIES}
57  ${Lua_LIBRARIES}
58  tinyxml
59  tolualib
60  util
61  core
62  audio
63  network
64)
65
Note: See TracBrowser for help on using the repository browser.