* 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>
* Added assert_not_defined check
* Function to get package name form git uri and tests
* Autofix format
* If name is not provided, try to infer it from the git repo
* Unset result of cpm_package_name_from_git_uri if there is no match
- Also reordered tests to ensure that the result is actually unset when needed
* Removed trailing spaces in README
* Updated the main example with the new minimal syntax
* Well... autofix format again
* Update error message for missing name to reflect the possible auto-infer step
* Autofix format... yet again :)
* add dependencies using EXCLUDE_FROM_ALL flag
* respect DOWNLOAD_ONLY flag
* set EXCLUDE_FROM_ALL as an optional flag
* use one value arg for consistency
* fix argument passing
* add unit test
* update cmake-format
* update most package versions
extent build_all.py to inject cmake modules
and use Ninja generator
* fix build problems while build on debian
use SYSTEM include paths (for clang++)
we should not use local installed header!
* fix banchmark example
finalize cmake project code injection as an option
* fix build problems on travis CI
gtest needs c++17
* Update examples/build_all.py
Co-authored-by: Lars Melchior <TheLartians@users.noreply.github.com>
* reindent py script requested by review
indent with only 2 spaces again
* changes according the review
the gtest build error seems to be a make -j cpucount problem
* revert filter too
Co-authored-by: Lars Melchior <TheLartians@users.noreply.github.com>
* add prettify macro
* apply the prettier and change the name of the output arg
* add parameter inside macro
* resolve path if its cmake_sourc_dir
* add missing uparsed argument
* add early unit test for prettifier
* retab prettify_cpm_add_package
* rename prettify_cpm_add_package cpm_prettyfy_package_arguments
* convert macro to function and fix unit test
* fix typo in the name of the parse argument in prettyfy function
* change the unit test to test only the function
* add test for the commented part
* remove dead code
* fix typo
* run cmake-format on CPM.cmake
* reformated unit test prettify
* flip the logic to add space on new argument unparsed to avoir space at the end
* remove debug message
* apply most suggestion from pr 162, disable formating only for small part in unit test
* add unit test to cover defauld source dir added inside lock
* run format tool on unit test
* remove dead code
* change the prettifier from 4 space to 2
* run format on unit test
* apply clang-format and cmake-format and add style check workflow
* add declare package definition
* add additional public methods and rename internals
* change development verison tag to 1.0.0
* rename internal method
* rename public method
* rename test var
* update copyright and fix comment
* typo
* run fix-format
* fix test function names
When using CPMFindPackage, if no VERSION is given then GIT_TAG is used as fallback if defined, which is a good idea.
The issue is that GIT_TAG is missing inside the oneValueArgs variable therefore GIT_TAG is not parsed. This is resolved by this little change.
When I used CPM_<pkg>_SOURCE to point to a locally modified copy,
the options ended up not being passed on. I think they should be, so
this patch does so.
* Add asio standalone example
* Mark VERSION explicitly
Without this version information, CPM's versioning mechanism may break
in some cases.
Also add comments for compile definition on Windows.
* Use aync-tcp-echo-server as the example
* Add boost software license to the demo source
Co-authored-by: Lars Melchior <TheLartians@users.noreply.github.com>
Co-authored-by: Lars Melchior <TheLartians@users.noreply.github.com>
* Use shallow clone for git repositories by default (#129)
* use shallow clone for git repositories by default
* remove trailing spaces
* Enable shallow clone for actual tags
* Support short commit hash
* Enable shallow only when downloading dependencies into cache
* Always honor user specified GIT_SHALLOW opiton