This is a collection of CMake scripts for various purposes, please read the subsections of each script to see how to use them.
To use this collection of CMake modules, please include this snippet in your CMake script
include(FetchContent)
FetchContent_Declare(river
GIT_REPOSITORY https://github.com/uyha/cmake-modules.git
GIT_TAG v0.2.0)
FetchContent_MakeAvailable(river)
list(APPEND CMAKE_MODULE_PATH "${river_SOURCE_DIR}")
This module finds and uses the ccache program to speed up recompilation.
To use this module, put include(Ccache)
in your build script.
Ccache_EXECUTABLE
: The path to the ccache executable.
This module invokes conan and installs the dependencies specified in either conanfile.txt or conanfile.py. After this module is included, then the find_package command can be used to make the dependencies appear as CMake targets.
USE_CONAN
: [ON, OFF] (Default: ON)This variable controls whether this module is active or not.
CONAN_AUTODETECT
: [ON, OFF] (Default: OFF)This variable controls whether the autodetect feature should be used.
CONAN_PROFILE_HOST
: Path (Required)The path to the profile for the hosting context.
CONAN_PROFILE_BUILD
: Path (Optional)The path to the profile for the building context. If this variable is not provided,
CONAN_PROFILE_HOST
will be used.
This module finds the conan
executable and provides CMake functions to interact with it.
Conan_EXECUTABLE
: The path to theconan
executable.Conan_VERSION
: The version of theconan
executable.
conan_install
: This function invokes theconan install
command and passes the appropriate arguments to it. Please refer to conan install. The arguments forconan install
are translated to CMake style arguments, i.e "--" is removed, ":" or "-" becomes "_", and the arguments are capitalized.
Conan_DIR
: Path (Optional)The path to the directory containing the
conan
executable.
This module installs the Python dependencies specified in pyproject.toml using poetry.
Python_ROOT_DIR
: Whenfind_package(Python)
is used, the python interpreter will be found in the poetry virtual environment.
This module install the Python dependencies specified in pyproject.toml using pdm.
Python_ROOT_DIR
: Whenfind_package(Python)
is used, the python interpreter will be found in the poetry virtual environment.