summaryrefslogtreecommitdiffstats
path: root/Modules/FindTCL.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/FindTCL.cmake')
-rw-r--r--Modules/FindTCL.cmake12
1 files changed, 8 insertions, 4 deletions
diff --git a/Modules/FindTCL.cmake b/Modules/FindTCL.cmake
index 13f32f8..f2c776f 100644
--- a/Modules/FindTCL.cmake
+++ b/Modules/FindTCL.cmake
@@ -48,10 +48,14 @@ INCLUDE(CMakeFindFrameworks)
INCLUDE(FindTclsh)
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}")
+IF(TCLSH_VERSION_STRING)
+ SET(TCL_TCLSH_VERSION "${TCLSH_VERSION_STRING}")
+ELSE(TCLSH_VERSION_STRING)
+ 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}")
+ENDIF(TCLSH_VERSION_STRING)
GET_FILENAME_COMPONENT(TK_WISH_PATH "${TK_WISH}" PATH)
GET_FILENAME_COMPONENT(TK_WISH_PATH_PARENT "${TK_WISH_PATH}" PATH)