Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/trunk/src/core/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.2 KB
Line 
1SET(CORE_SRC_FILES
2  OrxonoxClass.cc
3  BaseObject.cc
4  Factory.cc
5  Identifier.cc
6  IdentifierDistributor.cc
7  InputHandler.cc
8  InputManager.cc
9  InputEventListener.cc
10  MetaObjectList.cc
11  ConfigFileManager.cc
12  ConfigValueContainer.cc
13  Error.cc
14  SignalHandler.cc
15  CoreSettings.cc
16  OutputHandler.cc
17  Language.cc
18  ClassTreeMask.cc
19  Loader.cc
20  Executor.cc
21  XMLPort.cc
22  Namespace.cc
23  NamespaceNode.cc
24  CommandExecutor.cc
25  InputBuffer.cc
26  Tickable.cc
27  Script.cc
28  tolua/tolua_bind.cc
29#tolua/tolua_bind.h
30  TclBind.cc
31)
32
33#SET_SOURCE_FILES_PROPERTIES(tolua/tolua_bind.h
34#  PROPERTIES
35#  OBJECT_DEPENDS tolua/tolua_bind.h
36#  OBJECT_DEPENDS tolua/tolua_bind.cc
37#  GENERATED true
38#  HEADER_FILE_ONLY true
39#)
40
41GET_TARGET_PROPERTY(TOLUA_EXE tolua LOCATION)
42ADD_CUSTOM_COMMAND(
43  OUTPUT tolua/tolua_bind.cc tolua/tolua_bind.h
44  COMMAND ${TOLUA_EXE} -n core -o ../../src/core/tolua/tolua_bind.cc -H ../../src/core/tolua/tolua_bind.h ../../src/core/tolua/tolua.pkg
45  DEPENDS tolua
46  WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/bin/lib
47)
48
49ADD_LIBRARY(core SHARED ${CORE_SRC_FILES})
50
51TARGET_LINK_LIBRARIES(core
52  cpptcl
53  ${Lua_LIBRARIES}
54  ${OIS_LIBRARIES}
55  ${OGRE_LIBRARIES}
56  tinyxml
57  tolualib
58  util
59)
Note: See TracBrowser for help on using the repository browser.