InstallSource

Install source files.

install_source

Install sources in <PROJECT-NAME>_INSTALLED_SOURCE_DIR.

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

Install <file> ... in <PROJECT-NAME>_INSTALLED_SOURCE_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_source(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
  • *.C

  • *.H

  • *.c

  • *.cc

  • *.cpp

  • *.cxx

  • *.dox

  • *.h

  • *.hh

  • *.hpp

  • *.hxx

  • *.icc

  • *.pl

  • *.py

  • *.rb

  • *.sh

  • *.tcc

  • *.xml

  • *README*

  • COPYING.*

  • COPYING

  • INSTALL*

  • LICENSE.*

  • LICENSE

Excluded files
  • *.bak

  • *.~

  • *.~[0-9]*

  • *.old

  • *.orig

  • *.rej

  • #*#

  • .DS_Store

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> ....

SUBDIRS [<source-subdir> ...]

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

Common Options

SUBDIRNAME <dest-subdir>

Add <dest-subdir> to the destination path.