summaryrefslogtreecommitdiffstats
path: root/Modules/FindTclsh.cmake
diff options
context:
space:
mode:
authorRolf Eike Beer <eike@sf-mail.de>2012-01-25 17:37:00 (GMT)
committerRolf Eike Beer <eike@sf-mail.de>2012-01-25 17:37:25 (GMT)
commite01fe583b80208b1cd28f429cfac9c866453a994 (patch)
tree8eb274d0bd17b5e49b6f95515a619f8e9baf3b53 /Modules/FindTclsh.cmake
parent731f996ce070bbba1b4913050497afa95436f2d2 (diff)
downloadCMake-e01fe583b80208b1cd28f429cfac9c866453a994.zip
CMake-e01fe583b80208b1cd28f429cfac9c866453a994.tar.gz
CMake-e01fe583b80208b1cd28f429cfac9c866453a994.tar.bz2
FindTclsh: support version selection
Diffstat (limited to 'Modules/FindTclsh.cmake')
-rw-r--r--Modules/FindTclsh.cmake12
1 files changed, 11 insertions, 1 deletions
diff --git a/Modules/FindTclsh.cmake b/Modules/FindTclsh.cmake
index 8fde59e..a45f285 100644
--- a/Modules/FindTclsh.cmake
+++ b/Modules/FindTclsh.cmake
@@ -82,9 +82,19 @@ FIND_PROGRAM(TCL_TCLSH
HINTS ${TCLTK_POSSIBLE_BIN_PATHS}
)
+IF(TCL_TCLSH)
+ EXECUTE_PROCESS(COMMAND "${CMAKE_COMMAND}" -E echo puts "\$tcl_version"
+ COMMAND "${TCL_TCLSH}"
+ OUTPUT_VARIABLE TCLSH_VERSION_STRING
+ ERROR_QUIET
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+ENDIF(TCL_TCLSH)
+
# handle the QUIETLY and REQUIRED arguments and set TIFF_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(Tclsh DEFAULT_MSG TCL_TCLSH)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(Tclsh
+ REQUIRED_VARS TCL_TCLSH
+ VERSION_VAR TCLSH_VERSION_STRING)
MARK_AS_ADVANCED(TCL_TCLSH)