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
11 # TTK_STUB_LIBRARY = path to ttk stub library
13 # In an effort to remove some clutter and clear up some issues for people
14 # who are not necessarily Tcl/Tk gurus/developpers, some variables were
15 # moved or removed. Changes compared to CMake 2.4 are:
16 # - TCL_STUB_LIBRARY_DEBUG and TK_STUB_LIBRARY_DEBUG were removed.
17 # => these libs are not packaged by default with Tcl/Tk distributions.
18 # Even when Tcl/Tk is built from source, several flavors of debug libs
19 # are created and there is no real reason to pick a single one
20 # specifically (say, amongst tclstub84g, tclstub84gs, or tclstub84sgx).
21 # Let's leave that choice to the user by allowing him to assign
22 # TCL_STUB_LIBRARY to any Tcl library, debug or not.
26 GET_FILENAME_COMPONENT(TCL_TCLSH_PATH "${TCL_TCLSH}" PATH)
27 GET_FILENAME_COMPONENT(TCL_TCLSH_PATH_PARENT "${TCL_TCLSH_PATH}" PATH)
29 "^.*tclsh([0-9]\\.*[0-9]).*$" "\\1" TCL_TCLSH_VERSION "${TCL_TCLSH}")
31 GET_FILENAME_COMPONENT(TK_WISH_PATH "${TK_WISH}" PATH)
32 GET_FILENAME_COMPONENT(TK_WISH_PATH_PARENT "${TK_WISH_PATH}" PATH)
34 "^.*wish([0-9]\\.*[0-9]).*$" "\\1" TK_WISH_VERSION "${TK_WISH}")
36 GET_FILENAME_COMPONENT(TCL_INCLUDE_PATH_PARENT "${TCL_INCLUDE_PATH}" PATH)
37 GET_FILENAME_COMPONENT(TK_INCLUDE_PATH_PARENT "${TK_INCLUDE_PATH}" PATH)
39 GET_FILENAME_COMPONENT(TCL_LIBRARY_PATH "${TCL_LIBRARY}" PATH)
40 GET_FILENAME_COMPONENT(TCL_LIBRARY_PATH_PARENT "${TCL_LIBRARY_PATH}" PATH)
42 "^.*tcl([0-9]\\.*[0-9]).*$" "\\1" TCL_LIBRARY_VERSION "${TCL_LIBRARY}")
44 GET_FILENAME_COMPONENT(TK_LIBRARY_PATH "${TK_LIBRARY}" PATH)
45 GET_FILENAME_COMPONENT(TK_LIBRARY_PATH_PARENT "${TK_LIBRARY_PATH}" PATH)
47 "^.*tk([0-9]\\.*[0-9]).*$" "\\1" TK_LIBRARY_VERSION "${TK_LIBRARY}")
49 SET(TCLTK_POSSIBLE_LIB_PATHS
50 "${TCL_INCLUDE_PATH_PARENT}/lib"
51 "${TK_INCLUDE_PATH_PARENT}/lib"
54 "${TCL_TCLSH_PATH_PARENT}/lib"
55 "${TK_WISH_PATH_PARENT}/lib"
61 GET_FILENAME_COMPONENT(
62 ActiveTcl_CurrentVersion
63 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\ActiveState\\ActiveTcl;CurrentVersion]"
65 SET(TCLTK_POSSIBLE_LIB_PATHS ${TCLTK_POSSIBLE_LIB_PATHS}
66 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\ActiveState\\ActiveTcl\\${ActiveTcl_CurrentVersion}]/lib"
67 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.6;Root]/lib"
68 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.5;Root]/lib"
69 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.4;Root]/lib"
70 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.3;Root]/lib"
71 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.2;Root]/lib"
72 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.0;Root]/lib"
73 "$ENV{ProgramFiles}/Tcl/Lib"
74 "C:/Program Files/Tcl/lib"
79 FIND_LIBRARY(TCL_STUB_LIBRARY
82 tclstub${TK_LIBRARY_VERSION} tclstub${TCL_TCLSH_VERSION} tclstub${TK_WISH_VERSION}
89 PATHS ${TCLTK_POSSIBLE_LIB_PATHS}
92 FIND_LIBRARY(TK_STUB_LIBRARY
95 tkstub${TCL_LIBRARY_VERSION} tkstub${TCL_TCLSH_VERSION} tkstub${TK_WISH_VERSION}
102 PATHS ${TCLTK_POSSIBLE_LIB_PATHS}
105 FIND_LIBRARY(TTK_STUB_LIBRARY
108 ttkstub${TCL_LIBRARY_VERSION} ttkstub${TCL_TCLSH_VERSION} ttkstub${TK_WISH_VERSION}
113 PATHS ${TCLTK_POSSIBLE_LIB_PATHS}