CetInstallDirs¶
include(CetInstallDirs)
Define GNU/UPS standard and CET project installation directories
Cetbuildtools2 supports two different filesystem hierarchies for installation
- Defined by the GNU Coding Standards
- Defined by the CET/FNAL UPS Product Install Policy
Additional installation directories for common CET project resources such as FHiCL and GDML configuration files are specified.
Result Variables¶
Inclusion of this module defines the following variables
CMAKE_INSTALL_<dir>
Destination for files of a given type. This value may be passed to theDESTINATION
options ofinstall()
commands for the corresponding file type.
CMAKE_INSTALL_FULL_<dir>
The absolute path generated from the correspondingCMAKE_INSTALL_<dir>
value. If the value is not already an absolute path, an absolute path is constructed typically by prepending the value of theCMAKE_INSTALL_PREFIX
variable.
where <dir>
is one of the values as defined in the
GNUInstallDirs module
,
plus the CET extensions
CMAKEDIR
CMake “ProjectConfig” and extension module files (defaults to
LIBDIR/cmake/
)This makes the assumption that projects will install binaries. If that is not the case for your project, consider setting this to
CMAKE_INSTALL_DATAROOTDIR/cmake
after inclusion of this module.FCLDIR
- FHiCL configuration files (defaults to
DATAROOTDIR/fhicl
) GDMLDIR
- GDML configuration files (defaults to
DATAROOTDIR/gdml
)
Install Hierarchy Policies¶
By default, the GNU install policy is used. All CMAKE_INSTALL_<dir>
variables will have the defaults as defined in GNUInstallDirs
and may be set on the command line on in the CMake interactive dialogs.
Todo
Selection/Activation of UPS Install Policy
Install/Build Directory Functions¶
The following functions are available to query and manipulate install and build output directories
-
cet_set_output_directories
¶ cet_set_output_directories()
Function
that sets the values of the default output directories for CMake targets to match to the install hierarchy.For single mode build generators (make, ninja), the following hierarchy is used:
+- <PROJECT_BINARY_DIR>/ +- BuildProducts/ +- <CMAKE_INSTALL_BINDIR>/ +- ... "runtime" targets ... +- <CMAKE_INSTALL_LIBDIR>/ +- ... "library" and "archive" targets ...
For multimode build generators (Xcode, Visual Studio), each mode is separated using the hierarchy
+- <PROJECT_BINARY_DIR> +- BuildProducts/ +- <CONFIG>/ +- <CMAKE_INSTALL_BINDIR>/ +- ... "runtime" targets ... +- <CMAKE_INSTALL_LIBDIR>/ +- ... "library" and "archive" targets ... +- ...
where
<CONFIG>
is repeated for each build configuration listed inCMAKE_CONFIGURATION_TYPES
, e.g. Release, Debug, RelWithDebInfo etc. Currently always called by inclusion of theCetInstallDirs
module.Todo
Consider taking a base directory argument and review default call