diff options
Diffstat (limited to 'Modules/FindTCL.cmake')
-rw-r--r-- | Modules/FindTCL.cmake | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/Modules/FindTCL.cmake b/Modules/FindTCL.cmake index 6af7ea7..b61fc60 100644 --- a/Modules/FindTCL.cmake +++ b/Modules/FindTCL.cmake @@ -37,18 +37,26 @@ INCLUDE(FindWish) GET_FILENAME_COMPONENT(TCL_TCLSH_PATH "${TCL_TCLSH}" PATH) GET_FILENAME_COMPONENT(TCL_TCLSH_PATH_PARENT "${TCL_TCLSH_PATH}" PATH) +STRING(REGEX REPLACE + "^.*tclsh([0-9]\\.*[0-9]).*$" "\\1" TCL_TCLSH_VERSION "${TCL_TCLSH}") GET_FILENAME_COMPONENT(TK_WISH_PATH "${TK_WISH}" PATH) GET_FILENAME_COMPONENT(TK_WISH_PATH_PARENT "${TK_WISH_PATH}" PATH) +STRING(REGEX REPLACE + "^.*wish([0-9]\\.*[0-9]).*$" "\\1" TK_WISH_VERSION "${TK_WISH}") GET_FILENAME_COMPONENT(TCL_INCLUDE_PATH_PARENT "${TCL_INCLUDE_PATH}" PATH) GET_FILENAME_COMPONENT(TK_INCLUDE_PATH_PARENT "${TK_INCLUDE_PATH}" PATH) GET_FILENAME_COMPONENT(TCL_LIBRARY_PATH "${TCL_LIBRARY}" PATH) GET_FILENAME_COMPONENT(TCL_LIBRARY_PATH_PARENT "${TCL_LIBRARY_PATH}" PATH) +STRING(REGEX REPLACE + "^.*tcl([0-9]\\.*[0-9]).*$" "\\1" TCL_LIBRARY_VERSION "${TCL_LIBRARY}") GET_FILENAME_COMPONENT(TK_LIBRARY_PATH "${TK_LIBRARY}" PATH) GET_FILENAME_COMPONENT(TK_LIBRARY_PATH_PARENT "${TK_LIBRARY_PATH}" PATH) +STRING(REGEX REPLACE + "^.*tk([0-9]\\.*[0-9]).*$" "\\1" TK_LIBRARY_VERSION "${TK_LIBRARY}") SET(TCLTK_POSSIBLE_LIB_PATHS "${TCL_INCLUDE_PATH_PARENT}/lib" @@ -81,7 +89,9 @@ IF(WIN32) ENDIF(WIN32) FIND_LIBRARY(TCL_LIBRARY - NAMES tcl + NAMES + tcl + tcl${TK_LIBRARY_VERSION} tcl${TCL_TCLSH_VERSION} tcl${TK_WISH_VERSION} tcl86 tcl8.6 tcl85 tcl8.5 tcl84 tcl8.4 @@ -92,7 +102,9 @@ FIND_LIBRARY(TCL_LIBRARY ) FIND_LIBRARY(TK_LIBRARY - NAMES tk + NAMES + tk + tk${TCL_LIBRARY_VERSION} tk${TCL_TCLSH_VERSION} tk${TK_WISH_VERSION} tk86 tk8.6 tk85 tk8.5 tk84 tk8.4 @@ -135,6 +147,8 @@ SET(TCLTK_POSSIBLE_INCLUDE_PATHS "${TK_WISH_PATH_PARENT}/include" /usr/include /usr/local/include + /usr/include/tcl${TK_LIBRARY_VERSION} + /usr/include/tcl${TCL_LIBRARY_VERSION} /usr/include/tcl8.6 /usr/include/tcl8.5 /usr/include/tcl8.4 |