[1159] | 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) |
---|
[1214] | 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 |
---|
[1159] | 9 | # TCL_INCLUDE_PATH = path to where tcl.h can be found |
---|
[1214] | 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 |
---|
[1159] | 18 | |
---|
[1214] | 19 | INCLUDE(CMakeFindFrameworks) |
---|
| 20 | INCLUDE(FindTclsh) |
---|
| 21 | INCLUDE(FindWish) |
---|
| 22 | |
---|
[1159] | 23 | GET_FILENAME_COMPONENT(TCL_TCLSH_PATH "${TCL_TCLSH}" PATH) |
---|
[1214] | 24 | GET_FILENAME_COMPONENT(TK_WISH_PATH "${TK_WISH}" PATH) |
---|
[1159] | 25 | |
---|
| 26 | SET (TCLTK_POSSIBLE_LIB_PATHS |
---|
[1214] | 27 | "${TCL_TCLSH_PATH}/../lib" |
---|
| 28 | "${TK_WISH_PATH}/../lib" |
---|
| 29 | "${TCL_INCLUDE_PATH}/../lib" |
---|
| 30 | "${TK_INCLUDE_PATH}/../lib" |
---|
[1159] | 31 | "$ENV{ProgramFiles}/Tcl/Lib" |
---|
| 32 | "C:/Program Files/Tcl/lib" |
---|
| 33 | "C:/Tcl/lib" |
---|
[1214] | 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 |
---|
[1160] | 42 | ../libs/tcl8.5.2/unix |
---|
[1214] | 43 | ../libs/tcl8.5.2/macosx |
---|
[1159] | 44 | ) |
---|
| 45 | |
---|
| 46 | FIND_LIBRARY(TCL_LIBRARY |
---|
| 47 | NAMES tcl tcl85 tcl8.5 tcl84 tcl8.4 tcl83 tcl8.3 tcl82 tcl8.2 tcl80 tcl8.0 |
---|
| 48 | PATHS ${TCLTK_POSSIBLE_LIB_PATHS} |
---|
| 49 | ) |
---|
| 50 | |
---|
[1214] | 51 | FIND_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 | |
---|
| 56 | FIND_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 | |
---|
| 61 | FIND_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 | |
---|
| 66 | FIND_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 | |
---|
| 71 | FIND_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 | |
---|
| 76 | FIND_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 | |
---|
| 81 | FIND_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 | |
---|
| 86 | CMAKE_FIND_FRAMEWORKS(Tcl) |
---|
| 87 | CMAKE_FIND_FRAMEWORKS(Tk) |
---|
| 88 | |
---|
| 89 | SET(TCL_FRAMEWORK_INCLUDES) |
---|
| 90 | IF(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) |
---|
| 96 | ENDIF(Tcl_FRAMEWORKS) |
---|
| 97 | |
---|
| 98 | SET(TK_FRAMEWORK_INCLUDES) |
---|
| 99 | IF(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) |
---|
| 106 | ENDIF(Tk_FRAMEWORKS) |
---|
| 107 | |
---|
[1159] | 108 | GET_FILENAME_COMPONENT(TCL_LIBRARY_PATH "${TCL_LIBRARY}" PATH) |
---|
[1214] | 109 | GET_FILENAME_COMPONENT(TK_LIBRARY_PATH "${TK_LIBRARY}" PATH) |
---|
[1159] | 110 | |
---|
| 111 | SET (TCLTK_POSSIBLE_INCLUDE_PATHS |
---|
[1214] | 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 |
---|
[1159] | 123 | /usr/include |
---|
| 124 | /usr/local/include |
---|
| 125 | /usr/include/tcl8.4 |
---|
| 126 | /usr/include/tcl8.3 |
---|
| 127 | /usr/include/tcl8.2 |
---|
| 128 | /usr/include/tcl8.0 |
---|
| 129 | ../libs/tcl8.5.2/generic |
---|
| 130 | ) |
---|
| 131 | |
---|
| 132 | FIND_PATH(TCL_INCLUDE_PATH tcl.h |
---|
| 133 | ${TCL_FRAMEWORK_INCLUDES} ${TCLTK_POSSIBLE_INCLUDE_PATHS} |
---|
| 134 | ) |
---|
| 135 | |
---|
[1214] | 136 | FIND_PATH(TK_INCLUDE_PATH tk.h |
---|
| 137 | ${TK_FRAMEWORK_INCLUDES} ${TCLTK_POSSIBLE_INCLUDE_PATHS} |
---|
| 138 | ) |
---|
| 139 | |
---|
| 140 | IF (WIN32) |
---|
| 141 | FIND_PATH(TK_INTERNAL_PATH tkWinInt.h |
---|
| 142 | ${TCLTK_POSSIBLE_INCLUDE_PATHS} |
---|
| 143 | ) |
---|
| 144 | MARK_AS_ADVANCED(TK_INTERNAL_PATH) |
---|
| 145 | ENDIF(WIN32) |
---|
| 146 | |
---|
| 147 | MARK_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 | ) |
---|
| 162 | |
---|
[1159] | 163 | IF(TCL_INCLUDE_PATH) |
---|
| 164 | IF(TK_INCLUDE_PATH) |
---|
| 165 | IF(TCL_LIBRARY) |
---|
| 166 | IF(TK_LIBRARY) |
---|
| 167 | SET(TCL_FOUND 1) |
---|
| 168 | ENDIF(TK_LIBRARY) |
---|
| 169 | ENDIF(TCL_LIBRARY) |
---|
| 170 | ENDIF(TK_INCLUDE_PATH) |
---|
| 171 | ENDIF(TCL_INCLUDE_PATH) |
---|