Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 1214 for code/trunk/cmake


Ignore:
Timestamp:
May 2, 2008, 9:23:30 PM (16 years ago)
Author:
landauf
Message:

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:
1 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/cmake/FindTCL.cmake

    r1160 r1214  
    44# the library is. This code sets the following variables:
    55#  TCL_LIBRARY        = path to Tcl library (tcl tcl80)
     6#  TCL_LIBRARY_DEBUG  = path to Tcl library (debug)
     7#  TCL_STUB_LIBRARY   = path to Tcl stub library
     8#  TCL_STUB_LIBRARY_DEBUG = path to debug stub library
    69#  TCL_INCLUDE_PATH   = path to where tcl.h can be found
     10#  TCL_TCLSH          = path to tclsh binary (tcl tcl80)
     11#  TK_LIBRARY         = path to Tk library (tk tk80 etc)
     12#  TK_LIBRARY_DEBUG   = path to Tk library (debug)
     13#  TK_STUB_LIBRARY    = path to Tk stub library
     14#  TK_STUB_LIBRARY_DEBUG = path to debug Tk stub library
     15#  TK_INCLUDE_PATH    = path to where tk.h can be found
     16#  TK_INTERNAL_PATH   = path to where tkWinInt.h is found
     17#  TK_WISH            = full path to the wish executable
     18
     19INCLUDE(CMakeFindFrameworks)
     20INCLUDE(FindTclsh)
     21INCLUDE(FindWish)
    722
    823GET_FILENAME_COMPONENT(TCL_TCLSH_PATH "${TCL_TCLSH}" PATH)
     24GET_FILENAME_COMPONENT(TK_WISH_PATH "${TK_WISH}" PATH)
    925
    1026SET (TCLTK_POSSIBLE_LIB_PATHS
    11   /usr/lib
    12   /usr/local/lib
     27  "${TCL_TCLSH_PATH}/../lib"
     28  "${TK_WISH_PATH}/../lib"
     29  "${TCL_INCLUDE_PATH}/../lib"
     30  "${TK_INCLUDE_PATH}/../lib"
    1331  "$ENV{ProgramFiles}/Tcl/Lib"
    1432  "C:/Program Files/Tcl/lib"
    1533  "C:/Tcl/lib"
     34  [HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.4;Root]/lib
     35  [HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.3;Root]/lib
     36  [HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.2;Root]/lib
     37  [HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.0;Root]/lib
     38  /usr/lib
     39  /usr/local/lib
     40  /usr/pack/tcltk-8.4.9.linux-mo/lib
     41  ../libs/tcl8.5.2/win
    1642  ../libs/tcl8.5.2/unix
    17   ../libs/tcl8.5.2/win
     43  ../libs/tcl8.5.2/macosx
    1844)
    1945
     
    2349)
    2450
     51FIND_LIBRARY(TCL_LIBRARY_DEBUG
     52  NAMES tcld tcl85d tcl8.5d tcl84d tcl8.4d tcl83d tcl8.3d tcl82d tcl8.2d tcl80d tcl8.0d
     53  PATHS ${TCLTK_POSSIBLE_LIB_PATHS}
     54)
     55
     56FIND_LIBRARY(TCL_STUB_LIBRARY
     57  NAMES tclstub tclstub84 tclstub8.4 tclstub83 tclstub8.3 tclstub82 tclstub8.2 tclstub80 tclstub8.0
     58  PATHS ${TCLTK_POSSIBLE_LIB_PATHS}
     59)
     60
     61FIND_LIBRARY(TCL_STUB_LIBRARY_DEBUG
     62  NAMES tclstubd tclstub84d tclstub8.4d tclstub83d tclstub8.3d tclstub82d tclstub8.2d tclstub80d tclstub8.0d
     63  PATHS ${TCLTK_POSSIBLE_LIB_PATHS}
     64)
     65
     66FIND_LIBRARY(TK_LIBRARY
     67  NAMES tk tk84 tk8.4 tk83 tk8.3 tk82 tk8.2 tk80 tk8.0
     68  PATHS ${TCLTK_POSSIBLE_LIB_PATHS}
     69)
     70
     71FIND_LIBRARY(TK_LIBRARY_DEBUG
     72  NAMES tkd tk84d tk8.4d tk83d tk8.3d tk82d tk8.2d tk80d tk8.0d
     73  PATHS ${TCLTK_POSSIBLE_LIB_PATHS}
     74)
     75
     76FIND_LIBRARY(TK_STUB_LIBRARY
     77  NAMES tkstub tkstub84 tkstub8.4 tkstub83 tkstub8.3 tkstub82 tkstub8.2 tkstub80 tkstub8.0
     78  PATHS ${TCLTK_POSSIBLE_LIB_PATHS}
     79)
     80
     81FIND_LIBRARY(TK_STUB_LIBRARY_DEBUG
     82  NAMES tkstubd tkstub84d tkstub8.4d tkstub83d tkstub8.3d tkstub82d tkstub8.2d tkstub80d tkstub8.0d
     83  PATHS ${TCLTK_POSSIBLE_LIB_PATHS}
     84)
     85
     86CMAKE_FIND_FRAMEWORKS(Tcl)
     87CMAKE_FIND_FRAMEWORKS(Tk)
     88
     89SET(TCL_FRAMEWORK_INCLUDES)
     90IF(Tcl_FRAMEWORKS)
     91  IF(NOT TCL_INCLUDE_PATH)
     92    FOREACH(dir ${Tcl_FRAMEWORKS})
     93      SET(TCL_FRAMEWORK_INCLUDES ${TCL_FRAMEWORK_INCLUDES} ${dir}/Headers)
     94    ENDFOREACH(dir)
     95  ENDIF(NOT TCL_INCLUDE_PATH)
     96ENDIF(Tcl_FRAMEWORKS)
     97
     98SET(TK_FRAMEWORK_INCLUDES)
     99IF(Tk_FRAMEWORKS)
     100  IF(NOT TK_INCLUDE_PATH)
     101    FOREACH(dir ${Tk_FRAMEWORKS})
     102      SET(TK_FRAMEWORK_INCLUDES ${TK_FRAMEWORK_INCLUDES}
     103        ${dir}/Headers ${dir}/PrivateHeaders)
     104    ENDFOREACH(dir)
     105  ENDIF(NOT TK_INCLUDE_PATH)
     106ENDIF(Tk_FRAMEWORKS)
     107
    25108GET_FILENAME_COMPONENT(TCL_LIBRARY_PATH "${TCL_LIBRARY}" PATH)
     109GET_FILENAME_COMPONENT(TK_LIBRARY_PATH "${TK_LIBRARY}" PATH)
    26110
    27111SET (TCLTK_POSSIBLE_INCLUDE_PATHS
     112  ${TCL_TCLSH_PATH}/../include
     113  ${TK_WISH_PATH}/../include
     114  "${TCL_LIBRARY_PATH}/../include"
     115  "${TK_LIBRARY_PATH}/../include"
     116  [HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.4;Root]/include
     117  [HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.3;Root]/include
     118  [HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.2;Root]/include
     119  [HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.0;Root]/include
     120  "$ENV{ProgramFiles}/Tcl/include"
     121  "C:/Program Files/Tcl/include"
     122  C:/Tcl/include
    28123  /usr/include
    29124  /usr/local/include
     
    32127  /usr/include/tcl8.2
    33128  /usr/include/tcl8.0
    34   "$ENV{ProgramFiles}/Tcl/include"
    35   "C:/Program Files/Tcl/include"
    36   C:/Tcl/include
    37129  ../libs/tcl8.5.2/generic
    38130)
     
    41133  ${TCL_FRAMEWORK_INCLUDES} ${TCLTK_POSSIBLE_INCLUDE_PATHS}
    42134)
     135
     136FIND_PATH(TK_INCLUDE_PATH tk.h
     137  ${TK_FRAMEWORK_INCLUDES} ${TCLTK_POSSIBLE_INCLUDE_PATHS}
     138)
     139
     140IF (WIN32)
     141  FIND_PATH(TK_INTERNAL_PATH tkWinInt.h
     142    ${TCLTK_POSSIBLE_INCLUDE_PATHS}
     143  )
     144  MARK_AS_ADVANCED(TK_INTERNAL_PATH)
     145ENDIF(WIN32)
     146
     147MARK_AS_ADVANCED(
     148    TCL_TCLSH_PATH
     149    TK_WISH_PATH
     150    TCL_INCLUDE_PATH
     151    TK_INCLUDE_PATH
     152    TCL_LIBRARY
     153    TCL_LIBRARY_DEBUG
     154    TK_LIBRARY 
     155    TK_LIBRARY_DEBUG
     156  TCL_STUB_LIBRARY
     157  TCL_STUB_LIBRARY_DEBUG
     158  TK_STUB_LIBRARY 
     159  TK_STUB_LIBRARY
     160  TK_STUB_LIBRARY_DEBUG
     161  )
    43162
    44163IF(TCL_INCLUDE_PATH)
Note: See TracChangeset for help on using the changeset viewer.