* Fixed: Deleted SOURCE_DIR directory would abort just after git stash save --quiet;--include-untracked
* Fixed: Review comments
* Added: Integration test for deleted SOURCE_DIR with FetchContent
* Fixed: Review comments
* Fixed: Review comments
Klogg used to vendor all external dependencies, and now we switched to CPM, and this makes using local dependencies and packaging much easier. Thanks for all you effort!
* Override FetchContent paramers, fixes#281
* add check to verify that dependency is cached
* update test comment
* rename test file and class
* update test indentation
* Add per project CPM_DOWNLOAD controls
Introduces support for `CPM_<PACKAGE>_DOWNLOAD` variable ( and env )
which allows finer grained control.
* Address PR feedback on API names
By enabling CMP0126 we tell CMake that when constructing a CACHE variable
with the same name as a local variable to not unset the local variable.
By enabling CMPO126 it makes sure that CPM behavior around `OPTION` is
consistent if the option is created with `set(CACHE)` or with `option`.
* Initial commit for integration tests. Experimental. Playing with potential syntax
* Some experimental code to setup tests
* Piecewise building of CMakeLists
* First check
* Alternative approach. Using ruby's test/unit
* Parse CMakeCache. Separate lib
* First integration test
* Latest Format.cmake. Passing style
* Allow user-provided integration test dir. Allow reuse
* Separate class with utils for cache (no longer pure Hash)
* Allow running of tests from any dir
* Add integration tests to CI
* Use an in-source integration test directory
* Allow relative integration test dir from env
* Custom assertion for a success of CommandResult
* Windows-latest-latest
* Enrich CMakeCache class with more CPM data
* Added test for CPM-specific CMakeCache values
* Style
* Style
* test_update_single_package
* WiP for source cache test
* Small source_cache test
* Style
* Moved env clean to cleanup to make setup methods simpler (not require super)
* WiP for integration test documentation
* WiP for integration test documentation
* Project file creation tweaks
* Split docs into multiple files. Complete tutorial. Reference.
* Tips
* Typo
* Setup Ruby inistead of requiring windows-2022
* Revert "Setup Ruby inistead of requiring windows-2022"
This reverts commit 8aa2732145.
* Disable JSON tests being included in ctest
If `CPMAddPackage` includes json without setting JSON_BuildTests off first then the target's ctest will include lots of json's tests.
* Bump example JSON version to avoid JSON tests
* Added directory inside cache to make it shown more friendly in CLion
* Changed hash generation to omit collision with old cache scheme. Removed moving old directory for compatibility reason.
* Added CPM_USE_NAMED_CACHE_DIRECTORIES option
* Fixed formatting
* Added description of CPM_USE_NAMED_CACHE_DIRECTORIES into README.md
Co-authored-by: Paweł Gorgoń <pgorgon@hem-e.com>
* Check that the cache working directory is clean
* cpm_check_working_dir_is_clean for non git repo will not terminate cmake
* sileneced check for git repo, in case of error
* style(CPM.cmake): fixed indentation for ERROR_QUIET
* refactor(CPM.cmake): added logic to handle a cache folder inside a (not correlated) git repo
this is accomplished by checking if we are in the directory where .git lives
* style(CPM.cmake): stray tab to spaces
* test(dirty-cache-check): added unit test to check cpm_check_working_dir_is_clean
the test creates a file in a folder and then uses git to create a repo in that folder, to check various conditions
* Update test/unit/dirty-cache-check.cmake
added user.name and user.email to comply with test machine where git is not completely configured
Co-authored-by: Lars Melchior <TheLartians@users.noreply.github.com>
* feat(cpm_check_working_dir_is_clean): now it takes a git tag (works with hashes too) to check for uncommitted and commited changes
* refactor(cpm_check_working_dir_is_clean): early return for the most common case of uncommited changes in a repo
* refactor(cpm_check_git_working_dir_is_clean): removed edgecase detection (a non-git folder in an unrelated git repo)
now the contract is that com_check_git_working_dir_is_clean is given the base folder of a git repo
Co-authored-by: Andrew Gribble <ag131012@renishaw.com>
Co-authored-by: Lars Melchior <TheLartians@users.noreply.github.com>
Add fetchcontent_dependency unit test:
* This test should highlight the fact that cpm_add_subdirectory is always called, even when
cpm_fetch_package isn't populating the dependency
* NO_CACHE YES highlight a bug introduced in 32b063eba5 where
cpm_fetch_package was checking undefined ${lower_case_name}_POPULATED variable
https://github.com/cpm-cmake/CPM.cmake/issues/287
* Added support for bitbucket repositories:
* added variable BITBUCKET_REPOSITORY
* added short syntax in form "bb:user/repo"
* added description of that to readme.md
* Added test for bitbucket short syntax
* Used elseif syntax in handling of git services (github, gitlab, bitbucket).
* Added HEMRND/TestingFramework example located on bitbucket.org
* Reformatted CMakeLists.txt in TestingFramework example
* Bumped version of TestingFramework. It supports older version of c++ standard.
Co-authored-by: Paweł Gorgoń <pgorgon@hem-e.com>
* Expand relative download directory to prevent unnecessary download
If `CMAKE_SOURCE_CACHE` (and thus `download_directory`) is set to a relative path, the condition `if(EXISTS ${download_directory})` will fail even if the required directory exists. Expanding the variable `download_directory` to an absolute path before the test will rectify this, preventing unnecessary downloads of the sources.
* iFixed up formatting
Co-authored-by: Stuart Dootson <stuart.dootson@rolls-royce.com>
As noted in #263, setting `GIT_TAG` to a branch name results in unexpected and unreproducible build behaviour, as it does not automatically update when the `HEAD` changes.
* Fix#222
* Fix#222
* move policy change and local options to cpm_add_subdirectory
* change default policy as well
see https://gitlab.kitware.com/cmake/cmake/-/issues/20312
* add test
* update check to not use the NOT operator
(interestingly it works as expected locally)
* simplify test by not using options
* check options in tests
Co-authored-by: Lars Melchior <TheLartians@users.noreply.github.com>
Giving `CPMFindPackage` a less prominent position, as in almost all cases, `CPMAddPackage` should be preferred.
Following a related discussion in #222.
* update more examples to use shorthand syntax
* revert google-benchmark as tests require googletest to be installed
* update comments
* always quote single-arguments
* undo accidental deletion
* Function to extract name and version from url. Some tests
* Rewrite. Previous version was not safe enough. More tests
* Allow underscore as a name-version separator (<name>_<ver>)
* CPMAddPackage can infer name and version from url
* Allow URL parse from single arg and uncomment tests
* Info about shorthand syntax in README
* Fix style
* Fixed typo
Co-authored-by: Lars Melchior <TheLartians@users.noreply.github.com>
* Explicit hash algorithm in shorthand URL example.
Also added tests which include a hash algorithm provided
We can't document a default until it's confirmed here: https://gitlab.kitware.com/cmake/cmake/-/issues/21859
Co-authored-by: Lars Melchior <TheLartians@users.noreply.github.com>
* Added quotes in equality checks so lists can be compared
* Function to parse argument of CPMAddPackage in case a single one was provided
* Error on URL type in CPMAddPackage single-arg
* Fixed format
* Support single argument syntax of CPMAddPackage
* Documenting and showcasing the new shorthand syntax of CPMAddPackage
* Auto EXCLUDE_FROM_ALL for the shorthand syntax
* Fixed accidental paste of TOLOWER
* Document why some test cases are commented out
Co-authored-by: Lars Melchior <TheLartians@users.noreply.github.com>
* Update README.md
Co-authored-by: Lars Melchior <TheLartians@users.noreply.github.com>
* Removed GitHub as the default package shorthand provider
Co-authored-by: Lars Melchior <TheLartians@users.noreply.github.com>