CetCMakeSettings¶
Set defaults for CMake build settings as useful or required for building CET projects. Where appropriate, these settings may be changed via command line arguments to cmake or through ccmake/cmake-gui interfaces.
General Build Settings¶
The following CMake variables and options are configured by default when including this module:
CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE: ON- Force project directories to appear first in any list of include paths. This applies to both full paths and those created by generator expressions.
CMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION: ON- CET policy is to install fully relocatable packages, so install directories should never be absolute. NB: This does not guarantee that a package is relocatable.
CMAKE_INSTALL_MESSAGE:LAZY- Only report new or updated files installed by the
installtarget.
- Only report new or updated files installed by the
CMAKE_EXPORT_NO_PACKAGE_REGISTRY: ONCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY: ONCMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY: ON- These variables are set to ensure that a project never creates or searches
for config files in any package registry. This prevents the
find_packagecommand from locating potentially spurious config files.
- These variables are set to ensure that a project never creates or searches
for config files in any package registry. This prevents the
In addition to the base setting above, configurable options are provided for enabling/disabling extra targets and functionality:
-
CET_BUILD_NO_UNINSTALL_TARGET¶ Option to disable creation of an
uninstalltarget for the project.OFFby default, and marked as advanced.See the documentation of the
CetUninstallTargetmodule for more details on what this target does.
CTest/Testing Settings¶
-
BUILD_TESTING¶ Option to enable test infrastructure and settings,
ONby default. After inclusion of this module, use CMake conditionals onBUILD_TESTINGlikeif(BUILD_TESTING) # ... code to create/build/configure tests ... endif()
to only build/define tests when the variable is set.
At present, enabling testing only supports direct testing rather than use of the
CTestmodule.Todo
Add support for CTest. Should be matter of checking for a CTestConfig.cmake file in the project source dir.