FindTclsh
Finds the Tcl shell command-line executable (tclsh), which includes the Tcl (Tool Command Language) interpreter:
find_package(Tclsh [<version>] [...])
Result Variables
This module defines the following variables:
-
Tclsh_FOUND -
Added in version 3.3.
Boolean indicating whether the (requested version of)
tclshexecutable was found. -
Tclsh_VERSION -
Added in version 4.2.
The version of
tclshfound.
Cache Variables
The following cache variables may also be set:
-
TCL_TCLSH -
The path to the
tclshexecutable.
Deprecated Variables
The following variables are provided for backward compatibility:
-
TCLSH_FOUND -
Deprecated since version 4.2: Use
Tclsh_FOUND, which has the same value.Boolean indicating whether the (requested version of)
tclshexecutable was found. -
TCLSH_VERSION_STRING -
Deprecated since version 4.2: Use
Tclsh_VERSION, which has the same value.The version of
tclshfound.
Examples
In the following example, this module is used to find the tclsh command-line executable, which is then executed in a process to evaluate TCL code from the script file located in the project source directory:
find_package(Tclsh)
if(Tclsh_FOUND)
execute_process(COMMAND ${TCL_TCLSH} example-script.tcl)
endif()
See Also
- The
FindTCLmodule to find the Tcl installation. - The
FindTclStubmodule to find the Tcl Stubs Library.
© 2000–2026 Kitware, Inc. and Contributors
Licensed under the BSD 3-clause License.
https://cmake.org/cmake/help/latest/module/FindTclsh.html