| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Dependency tracking library for CMake - completely written in CMake.
CMLIB Library is dependency tracking library which allows effectively track all needed dependencies without worrying about consistency and project regeneration times.
Main features are
For examples look at the example directory
Example with nlohmann json library
FIND_PACKAGE(CMLIB REQUIRED)
CMLIB_DEPENDENCY(
URI "https://github.com/nlohmann/json/releases/download/v3.12.0/json.tar.xz"
TYPE ARCHIVE
OUTPUT_PATH_VAR nlohmann_json_DIR
KEYWORDS NLOHMANN JSON
)
FIND_PACKAGE(nlohmann_json 3.12.0 REQUIRED)Full example can be found at example/DEPENDENCY/nlohmann_json_example
It is intended that the user has only one global instance of library. However it is possible use cmakelib as submodule and use INCLUDE(<submodule_path>/CMLIB.cmake). However it is not recommanded.
Library is stored on User computer and the global environment variable CMLIB_DIR must be defined.
CMLIB_DIR variable is named as CMake requires in order to FIND_PACKAGE to find a CMLIB by a FIND_PACKAGE(CMLIB REQUIRED)
mkdir -p ~/cmakelib && cd ~/cmakelib
git clone https://github.com/cmakelib/cmakelib.gitTo make CMLIB work add following lines to your .bashrc
echo "export CMLIB_DIR=$PWD/cmakelib" >> .bashrc
# If one, global cache directory is required setup
#echo "export CMLIB_REQUIRED_ENV_TMP_PATH=$PWD/cmakelib_cache" >> .bashrcThen in CMake project call FIND_PACKAGE(CMLIB REQUIRED)
Examples for CMLIB_DEPENDENCY can be found at example/DEPENDENCY
The library core is a function
CMLIB_DEPENDENCY
Which can track/cache various number of dependencies.
System modules do not contain anything except what is needed for CMLIB_DEPENDENCY implementation.
Library consist from following system modules
Detailed documentation can be found in each module.
There are examples for each modules in example directory.
As optional feaure CMake-lib provides several components which extends functionality of the core library.
Each component has its own git repository in form cmakelib-component-<component_name>.
The master branch of the given component is always used.
List of CMake-lib components
Components can be used by FIND_PACKAGE(CMLIB REQUIRED COMPONENTS <component_list>)
Cache entries are represented by ordered, nonempty set of uppercase strings called KEYWORDS.
If no KEYWORDS are specified then the set is created by the library as a hash of URI, GIT_PATH etc.
Cache mechanism is a persistent across CMake binary dir instances. If user deletes our CMake binary dir the cache will regenerate in next CMake run for the same CMakeLists.txt (we assume that cache is located in dir different from CMake binary dir)
If the CMLIB_REQUIRED_ENV_TMP_PATH is set then the cache will be stored in the directory specified by CMLIB_REQUIRED_ENV_TMP_PATH. (which can be set as ENV var)
If the cache reset is needed, just delete directory path stored in CMLIB_REQUIRED_ENV_TMP_PATH.
Dependency cache control is optional feature (enabled by default) which ensure that there are only one dependency cached at a time.
If ON we cannot track the same dependency under two different KEYWORDS sets.
Mechanism can be disabled by setting CMLIB_DEPENDENCY_CONTROL to OFF.
All temporary files and outputs are stored in temporary directory
Path to temporary directory is controlled by CMLIB_REQUIRED_ENV_TMP_PATH
CMLIB_REQUIRED_ENV_TMP_PATH can be overridden be system ENV var named CMLIB_REQUIRED_ENV_TMP_PATH
User can define global ENV var to specify exactly one, central cache storage which will be shared across CMake project instances.
For test go to the test/ and read the attached test/README.md.
Tests are run by github CI/CD for each PR.
Docker images are stored as cmake github packages.
Dockerfiles can be found at docker-build-images repository.
In library we use Uppercase for all CMake keywords.
Local variables can be named as lowercase.
Just call "git pull" on repository root.
In case of cmake-generation problem reset the cache and remove CMLIB_REQUIRED_ENV_TMP_PATH directory.
Release process is described in doc/ReleaseProcess.md
Project is licensed under BSD-3-Clause License
| Back | FazBrowse Home | New Git URL |