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 # TCLSH_FOUND = TRUE if tclsh has been found
6 # TCL_TCLSH = the path to the tclsh executable
7 # In cygwin, look for the cygwin version first. Don't look for it later to
8 # avoid finding the cygwin version on a Win32 build.
11 FIND_PROGRAM(TCL_TCLSH NAMES cygtclsh83 cygtclsh80)
14 GET_FILENAME_COMPONENT(TK_WISH_PATH "${TK_WISH}" PATH)
15 GET_FILENAME_COMPONENT(TK_WISH_PATH_PARENT "${TK_WISH_PATH}" PATH)
17 "^.*wish([0-9]\\.*[0-9]).*$" "\\1" TK_WISH_VERSION "${TK_WISH}")
19 GET_FILENAME_COMPONENT(TCL_INCLUDE_PATH_PARENT "${TCL_INCLUDE_PATH}" PATH)
20 GET_FILENAME_COMPONENT(TK_INCLUDE_PATH_PARENT "${TK_INCLUDE_PATH}" PATH)
22 GET_FILENAME_COMPONENT(TCL_LIBRARY_PATH "${TCL_LIBRARY}" PATH)
23 GET_FILENAME_COMPONENT(TCL_LIBRARY_PATH_PARENT "${TCL_LIBRARY_PATH}" PATH)
25 "^.*tcl([0-9]\\.*[0-9]).*$" "\\1" TCL_LIBRARY_VERSION "${TCL_LIBRARY}")
27 GET_FILENAME_COMPONENT(TK_LIBRARY_PATH "${TK_LIBRARY}" PATH)
28 GET_FILENAME_COMPONENT(TK_LIBRARY_PATH_PARENT "${TK_LIBRARY_PATH}" PATH)
30 "^.*tk([0-9]\\.*[0-9]).*$" "\\1" TK_LIBRARY_VERSION "${TK_LIBRARY}")
32 SET(TCLTK_POSSIBLE_BIN_PATHS
33 "${TCL_INCLUDE_PATH_PARENT}/bin"
34 "${TK_INCLUDE_PATH_PARENT}/bin"
35 "${TCL_LIBRARY_PATH_PARENT}/bin"
36 "${TK_LIBRARY_PATH_PARENT}/bin"
37 "${TK_WISH_PATH_PARENT}/bin"
41 GET_FILENAME_COMPONENT(
42 ActiveTcl_CurrentVersion
43 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\ActiveState\\ActiveTcl;CurrentVersion]"
45 SET(TCLTK_POSSIBLE_BIN_PATHS ${TCLTK_POSSIBLE_BIN_PATHS}
46 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\ActiveState\\ActiveTcl\\${ActiveTcl_CurrentVersion}]/bin"
47 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.6;Root]/bin"
48 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.5;Root]/bin"
49 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.4;Root]/bin"
50 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.3;Root]/bin"
51 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.2;Root]/bin"
52 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.0;Root]/bin"
58 tclsh${TCL_LIBRARY_VERSION} tclsh${TK_LIBRARY_VERSION} tclsh${TK_WISH_VERSION}
67 FIND_PROGRAM(TCL_TCLSH
68 NAMES ${TCL_TCLSH_NAMES}
69 HINTS ${TCLTK_POSSIBLE_BIN_PATHS}
72 # handle the QUIETLY and REQUIRED arguments and set TIFF_FOUND to TRUE if
73 # all listed variables are TRUE
74 INCLUDE(FindPackageHandleStandardArgs)
75 FIND_PACKAGE_HANDLE_STANDARD_ARGS(Tclsh DEFAULT_MSG TCL_TCLSH)
77 MARK_AS_ADVANCED(TCL_TCLSH)