CetInstall¶
This module defines an implementation of a generic file / installation function with the following features:
Identify files to install and/or exclude by
file(GLOB)
, or by list.Install contents of specific subdirectories: a) to their correct relative place in the install hierarchy; or b) to a base directory.
Optionally, copy files for use in the build tree in addition to installing them.
_cet_install()
is a “toolkit” function, intended to
facilitate the generation of install_X()
functions with particular
default or enforced characteristics for files of a particular type.
- _cet_install¶
Install files of a particular type or category with installation semantics common to that type of file.
_cet_install(<category> [<meta-options>...] [<options>...])
Options¶
BASENAME_EXCLUDES [REGEX] <exp> ...
Filenames matching these expressions in any searched subdirectory are excluded from installation;
file(GLOB)
expressions are permitted.DESTINATION <dest-path>
Installation subdirectory below
CMAKE_INSTALL_PREFIX
(mutually-exclusive withDEST_VAR
).DEST_VAR <dest-var>
The name of a CMake variable containing the installation subdirectory (mutually-exclusive with
DESTINATION
).
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
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> ...,
EXTRAS <extra file> ...
Specific files to copy/install in addition to those found via
GLOB
ing—incompatible with LIST <file> ....PROGRAMS
All files will be treated as executables and their mode will be set accordingly upon copy and/or install.
See also
SUBDIRNAME <dest-subdir>
Add
<dest-subdir>
to the destination path.
SUBDIRS <source-subdir> ...
Install files from the specified
<source-subdir> ...
; incompatible with LIST <file> ....
Meta-options¶
_EXTRA_BASENAME_EXCLUDES [<basename-exclude-exp> ...]
Additional basename exclusion expressions.
_EXTRA_EXCLUDES [<exclude-exp> ...]
Additional full-path exclusion expressions.
_EXTRA_EXTRAS [<path>...]
Files to install in addition to those found via
GLOB
expressions.
_GLOBS [<file(glob)>...]
GLOB
expressions for files to include._INSTALLED_FILES_VAR <var>
The name of a variable in which to stored the full list of files installed.
_INSTALL_ONLY
Do not copy files to the build tree.
_LIST_ONLY
Disable globbing: enforce explicit lists of files to install via LIST.
_NO_LIST
Disallow the use of LIST.
_SEARCH_BUILD
GLOB
expressions will be applied to the build tree in addition to the source tree._SQUASH_SUBDIRS
Subdirectory elements of source files are ignored when calculating the copy/install destination.
Details¶
Meta-options to
cet_install()
are distinguished by a leading underscore and are intended for use by wrapper functions specific to a particular category of file (e.g. license and README files, geometry data, configuration files, etc.) to enforce common behavior for all installation operations for those files.Note
Although supported for historical reasons, use of
file(GLOB)
to generate targets is not CMake best practice, and may lead to hysteresis if looking for generated files in the build tree.