[1505] | 1 | # - Find Tcl includes and libraries. |
---|
| 2 | # This module finds if TCL is installed and determines where the |
---|
| 3 | # include files and libraries are. It also determines what the name of |
---|
| 4 | # the library is. This code sets the following variables: |
---|
| 5 | # TCL_LIBRARY = path to Tcl library (tcl tcl80) |
---|
| 6 | # TCL_LIBRARY_DEBUG = path to Tcl library (debug) |
---|
| 7 | # TCL_INCLUDE_PATH = path to where tcl.h can be found |
---|
[1776] | 8 | # |
---|
| 9 | # Several changes and additions by Fabian 'x3n' Landau |
---|
| 10 | # > www.orxonox.net < |
---|
[1505] | 11 | |
---|
[1776] | 12 | IF (TCL_LIBRARY AND TCL_INCLUDE_PATH) |
---|
| 13 | SET(TCL_FIND_QUIETLY TRUE) |
---|
| 14 | ENDIF (TCL_LIBRARY AND TCL_INCLUDE_PATH) |
---|
[1505] | 15 | |
---|
| 16 | SET (TCLTK_POSSIBLE_LIB_PATHS |
---|
| 17 | "${TCL_TCLSH_PATH}/../lib" |
---|
| 18 | "${TK_WISH_PATH}/../lib" |
---|
| 19 | "${TCL_INCLUDE_PATH}/../lib" |
---|
| 20 | "${TK_INCLUDE_PATH}/../lib" |
---|
| 21 | "$ENV{ProgramFiles}/Tcl/Lib" |
---|
| 22 | "C:/Program Files/Tcl/lib" |
---|
| 23 | "C:/Tcl/lib" |
---|
[1776] | 24 | [HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.5;Root]/lib |
---|
[1505] | 25 | [HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.4;Root]/lib |
---|
| 26 | /usr/lib |
---|
| 27 | /usr/local/lib |
---|
| 28 | /usr/pack/tcltk-8.4.9.linux-mo/lib |
---|
| 29 | ../libs/tcl8.5.2/win |
---|
| 30 | ../libs/tcl8.5.2/unix |
---|
| 31 | ../libs/tcl8.5.2/macosx |
---|
| 32 | ) |
---|
| 33 | |
---|
| 34 | FIND_LIBRARY(TCL_LIBRARY |
---|
[1776] | 35 | NAMES tcl tcl85 tcl8.5 tcl84 tcl8.4 |
---|
[1505] | 36 | PATHS ${TCLTK_POSSIBLE_LIB_PATHS} |
---|
| 37 | ) |
---|
| 38 | |
---|
| 39 | FIND_LIBRARY(TCL_LIBRARY_DEBUG |
---|
[1776] | 40 | NAMES tcld tcl85d tcl8.5d tcl84d tcl8.4d |
---|
[1505] | 41 | PATHS ${TCLTK_POSSIBLE_LIB_PATHS} |
---|
| 42 | ) |
---|
| 43 | |
---|
| 44 | SET (TCLTK_POSSIBLE_INCLUDE_PATHS |
---|
| 45 | ${TCL_TCLSH_PATH}/../include |
---|
| 46 | ${TK_WISH_PATH}/../include |
---|
| 47 | "${TCL_LIBRARY_PATH}/../include" |
---|
| 48 | "${TK_LIBRARY_PATH}/../include" |
---|
[1776] | 49 | [HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.5;Root]/include |
---|
[1505] | 50 | [HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.4;Root]/include |
---|
| 51 | "$ENV{ProgramFiles}/Tcl/include" |
---|
| 52 | "C:/Program Files/Tcl/include" |
---|
| 53 | C:/Tcl/include |
---|
| 54 | /usr/include |
---|
| 55 | /usr/local/include |
---|
[1776] | 56 | /usr/include/tcl8.5 |
---|
[1505] | 57 | /usr/include/tcl8.4 |
---|
| 58 | ../libs/tcl8.5.2/generic |
---|
| 59 | ) |
---|
| 60 | |
---|
| 61 | FIND_PATH(TCL_INCLUDE_PATH tcl.h |
---|
| 62 | ${TCL_FRAMEWORK_INCLUDES} ${TCLTK_POSSIBLE_INCLUDE_PATHS} |
---|
| 63 | ) |
---|
| 64 | |
---|
| 65 | |
---|
[1776] | 66 | IF (TCL_LIBRARY AND TCL_INCLUDE_PATH) |
---|
| 67 | IF (NOT TCL_FIND_QUIETLY) |
---|
| 68 | MESSAGE(STATUS "Tcl was found") |
---|
| 69 | IF (VERBOSE_FIND) |
---|
| 70 | MESSAGE (STATUS " include path: ${TCL_INCLUDE_PATH}") |
---|
| 71 | MESSAGE (STATUS " library path: ${TCL_LIBRARY}") |
---|
| 72 | MESSAGE (STATUS " libraries: tcld tcl85d tcl8.5d tcl84d tcl8.4d") |
---|
| 73 | ENDIF (VERBOSE_FIND) |
---|
| 74 | ENDIF (NOT TCL_FIND_QUIETLY) |
---|
| 75 | ELSE (TCL_LIBRARY AND TCL_INCLUDE_PATH) |
---|
| 76 | IF (NOT TCL_INCLUDE_PATH) |
---|
| 77 | MESSAGE(SEND_ERROR "Tcl include path was not found.") |
---|
| 78 | ENDIF (NOT TCL_INCLUDE_PATH) |
---|
| 79 | IF (NOT TCL_LIBRARY ) |
---|
| 80 | MESSAGE(SEND_ERROR "Tcl library was not found.") |
---|
| 81 | ENDIF (NOT TCL_LIBRARY ) |
---|
| 82 | ENDIF (TCL_LIBRARY AND TCL_INCLUDE_PATH) |
---|
[1505] | 83 | |
---|
| 84 | IF(TCL_INCLUDE_PATH) |
---|
[1776] | 85 | IF(TCL_LIBRARY) |
---|
| 86 | SET(TCL_FOUND 1) |
---|
| 87 | ENDIF(TCL_LIBRARY) |
---|
[1505] | 88 | ENDIF(TCL_INCLUDE_PATH) |
---|