1 # - Find Tcl stub libraries.
2 # This module finds Tcl stub libraries. It first finds Tcl include files and
3 # libraries by calling FindTCL.cmake.
4 # How to Use the Tcl Stubs Library:
5 # http://tcl.activestate.com/doc/howto/stubs.html
6 # Using Stub Libraries:
7 # http://safari.oreilly.com/0130385603/ch48lev1sec3
8 # This code sets the following variables:
9 # TCL_STUB_LIBRARY = path to Tcl stub library
10 # TK_STUB_LIBRARY = path to Tk stub library
12 # In an effort to remove some clutter and clear up some issues for people
13 # who are not necessarily Tcl/Tk gurus/developpers, some variables were
14 # moved or removed. Changes compared to CMake 2.4 are:
15 # - TCL_STUB_LIBRARY_DEBUG and TK_STUB_LIBRARY_DEBUG were removed.
16 # => these libs are not packaged by default with Tcl/Tk distributions.
17 # Even when Tcl/Tk is built from source, several flavors of debug libs
18 # are created and there is no real reason to pick a single one
19 # specifically (say, amongst tclstub84g, tclstub84gs, or tclstub84sgx).
20 # Let's leave that choice to the user by allowing him to assign
21 # TCL_STUB_LIBRARY to any Tcl library, debug or not.
25 GET_FILENAME_COMPONENT(TCL_TCLSH_PATH "${TCL_TCLSH}" PATH)
26 GET_FILENAME_COMPONENT(TCL_TCLSH_PATH_PARENT "${TCL_TCLSH_PATH}" PATH)
28 "^.*tclsh([0-9]\\.*[0-9]).*$" "\\1" TCL_TCLSH_VERSION "${TCL_TCLSH}")
30 GET_FILENAME_COMPONENT(TK_WISH_PATH "${TK_WISH}" PATH)
31 GET_FILENAME_COMPONENT(TK_WISH_PATH_PARENT "${TK_WISH_PATH}" PATH)
33 "^.*wish([0-9]\\.*[0-9]).*$" "\\1" TK_WISH_VERSION "${TK_WISH}")
35 GET_FILENAME_COMPONENT(TCL_INCLUDE_PATH_PARENT "${TCL_INCLUDE_PATH}" PATH)
36 GET_FILENAME_COMPONENT(TK_INCLUDE_PATH_PARENT "${TK_INCLUDE_PATH}" PATH)
38 GET_FILENAME_COMPONENT(TCL_LIBRARY_PATH "${TCL_LIBRARY}" PATH)
39 GET_FILENAME_COMPONENT(TCL_LIBRARY_PATH_PARENT "${TCL_LIBRARY_PATH}" PATH)
41 "^.*tcl([0-9]\\.*[0-9]).*$" "\\1" TCL_LIBRARY_VERSION "${TCL_LIBRARY}")
43 GET_FILENAME_COMPONENT(TK_LIBRARY_PATH "${TK_LIBRARY}" PATH)
44 GET_FILENAME_COMPONENT(TK_LIBRARY_PATH_PARENT "${TK_LIBRARY_PATH}" PATH)
46 "^.*tk([0-9]\\.*[0-9]).*$" "\\1" TK_LIBRARY_VERSION "${TK_LIBRARY}")
48 SET(TCLTK_POSSIBLE_LIB_PATHS
49 "${TCL_INCLUDE_PATH_PARENT}/lib"
50 "${TK_INCLUDE_PATH_PARENT}/lib"
53 "${TCL_TCLSH_PATH_PARENT}/lib"
54 "${TK_WISH_PATH_PARENT}/lib"
60 GET_FILENAME_COMPONENT(
61 ActiveTcl_CurrentVersion
62 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\ActiveState\\ActiveTcl;CurrentVersion]"
64 SET(TCLTK_POSSIBLE_LIB_PATHS ${TCLTK_POSSIBLE_LIB_PATHS}
65 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\ActiveState\\ActiveTcl\\${ActiveTcl_CurrentVersion}]/lib"
66 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.6;Root]/lib"
67 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.5;Root]/lib"
68 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.4;Root]/lib"
69 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.3;Root]/lib"
70 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.2;Root]/lib"
71 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.0;Root]/lib"
72 "$ENV{ProgramFiles}/Tcl/Lib"
73 "C:/Program Files/Tcl/lib"
78 FIND_LIBRARY(TCL_STUB_LIBRARY
81 tclstub${TK_LIBRARY_VERSION} tclstub${TCL_TCLSH_VERSION} tclstub${TK_WISH_VERSION}
88 PATHS ${TCLTK_POSSIBLE_LIB_PATHS}
91 FIND_LIBRARY(TK_STUB_LIBRARY
94 tkstub${TCL_LIBRARY_VERSION} tkstub${TCL_TCLSH_VERSION} tkstub${TK_WISH_VERSION}
101 PATHS ${TCLTK_POSSIBLE_LIB_PATHS}