FindTclStub — CMake 4.4.20260621-gcc70e9e-dirty Documentation

# FindTclStub

Finds the Tcl Stub Library, which is used for building version-independent Tcl extensions:

    find_package(TclStub [...])

Tcl (Tool Command Language) is a dynamic programming language, and the Tcl Stub Library provides a mechanism to allow Tcl extensions to be compiled in a way that they can work across multiple Tcl versions, without requiring recompilation.

This module is typically used in conjunction with Tcl development projects that aim to be portable across different Tcl releases. It first calls the `FindTCL` module to locate Tcl installation and then attempts to find the stub libraries corresponding to the located Tcl version.

## Result Variables

This module defines the following variables:

`TclStub_FOUND`

  Added in version 4.2.

  Boolean indicating whether the Tcl Stub Library was found.

## Cache Variables

The following cache variables may also be set:

`TCL_STUB_LIBRARY`

  The path to the Tcl stub library.

`TK_STUB_LIBRARY`

  The path to the Tk stub library.

`TTK_STUB_LIBRARY`

  The path to the ttk stub library.

## Examples

Finding Tcl Stubs Library:

    find_package(TclStub)

## See Also

- The `FindTCL` module to find the Tcl installation.

- The `FindTclsh` module to find the Tcl shell command-line executable.

Online references:

- How to Use the Tcl Stubs Library

- Practical Programming in Tcl and Tk