InstallHeaders

Install headers.

install_headers

Install headers in <PROJECT-NAME>_INCLUDE_DIR.

install_headers(LIST <file> ... [<common-options>])
install_headers([GLOB] [<common-options>] [<glob-options>])
install_headers(LIST <file> ... [<options>]

Install <file> ... in <PROJECT-NAME>_INCLUDE_DIR.

LIST [<file> ...]

A list of files to install. Mutually-exclusive with any option assuming a generated list via _GLOBS [<file(glob)>...], specifically EXCLUDES <exclude-exp> ..., BASENAME_EXCLUDES [REGEX] <exp> ..., EXTRAS <extra file> ..., and SUBDIRS <source-subdir> ...,

install_headers(GLOB [<common-options>] [<glob-options>])

Install recognized files found under CMAKE_CURRENT_SOURCE_DIR or CMAKE_CURRENT_BINARY_DIR in <PROJECT-NAME>_INCLUDE_DIR.

Recognized files
  • *.h

  • *.hh

  • *.H

  • *.hpp

  • *.hxx

  • *.icc

  • *.tcc

Note

The use of file(GLOB) expressions in CMake build/install lists is discouraged due to its tendency to create hysteresis.

BASENAME_EXCLUDES [[REGEX] <exp>] ...

Filenames matching these expressions in any searched subdirectory are excluded from installation; file(GLOB) expressions are permitted.

EXCLUDES [<exclude-exp> ...]

A list of paths to exclude from the list of files that would otherwise be installed. This keyword accepts files only: no wildcards or directories

EXTRAS [<extra file> ...]

Specific files to copy/install in addition to those found via GLOBing—incompatible with LIST <file> ....

SQUASH_SUBDIRS

In GLOB mode, ignore the path to any files found in SUBDIRS when calculating the destination path.

SUBDIRS [<source-subdir> ...]

Install files from the specified <source-subdir> ...; incompatible with LIST <file> ....

Common Options

NO_RELATIVE_SUBDIR

Refrain from using the current source directory relative to the top-level project directory as the base destination path.

SUBDIRNAME <dest-subdir>

Add <dest-subdir> to the destination path.

USE_PRODUCT_NAME

Deprecated since version 2.10.00.

USE_PROJECT_NAME

Prepend CETMODULES_CURRENT_PROJECT_NAME to the calculated destination path.

Variables affecting behavior