This repository contains some utility CMake files which I use througout my projects. Most probably this is not of much use for anyone else but maybe can serve as an inspiration. The main intention behind this files is to depend on as less information as possible. Most of them only require the project name and the version number.
PackageConfig.cmake- set the name of the package config and version file by defining the two variablesPACKAGE_VERSION_FILE_NAMEandPACKAGE_CONFIG_FILE_NAME. Both are derived form the projects name and version.InstallConfig.cmake- define installation directories for various platforms by defining the following variablesCMAKE_INSTALL_LIBDIR- relative library installation pathCMAKE_INSTALL_BINDIR- relative binary installation pathCMAKE_INSTALL_INCLUDEDIR- relative header installation pathCMAKE_DATAROOTDIR- relative path for data installationCMAKE_INSTALL_DOCDIR- relative path for documentation installationCMAKE_INSTALL_PACKAGEDIR- relative path for cmake package file installation
OutputDirConfig.cmake- set ouput directories for build artifacts by defining the following variablesCMAKE_RUNTIME_OUTPUT_DIRECTORYCMAKE_LIBRARY_OUTPUT_DIRECTORYCMAKE_ARCHIVE_OUTPUT_DIRECTORY
ConanSetup.cmake- run boiler-plate code to use conan from within CMake. This script will stop the build if theconanexecutable cannot be found.BoostTestConfig.cmake- help setting up test logging when using Boost's testing framework. It defines two variablesTEST_LOG_PATHandTEST_REPORT_PATH
which determine where the log files will be written and exports two macros *
add_boost_logging_test- which adds logging options to the test commandand ensures that the log files will be removed during
make clean.set_boost_test_definitions- add build definitions for boost tests.
EnsureBuildType.cmake- very simple, just breaks the configuration run ifCMAKE_BUILD_TYPEis not provided by the userWindowsUtils.cmake- creates two batch files to build the code and run tests. The files ensure that the appropriate configuration is passed to the command line.BoostLibrarySetup.cmake- set the basicBoost_USER_variables for the Boost library search.