325 Commits

Author SHA1 Message Date
Lars Melchior
4502bf1e04 Forward exclude and subdir options when using local package override (#261)
* forward exclude and subdir options when using local package override.
fixes #260.

* run cmake format

* add SOURCE_SUBDIR parameter to cmake-format
2021-06-08 15:26:39 +03:00
Clare Macrae
dd3ba9792c Fix typo in README - omit -> emit (#258) 2021-06-02 09:36:29 +03:00
Lars Melchior
de5551e42c Update boost-cmake (#252)
* update boost-cmake

* run cmake-format
2021-05-18 16:29:52 +03:00
Paul Taylor
7644c3a40f Respect FETCHCONTENT_BASE_DIR if set by a user (#244)
* Respect `FETCHCONTENT_BASE_DIR` if set by a user

* Use a single `CPM_FETCHCONTENT_BASE_DIR` var
v0.32.1
2021-04-16 17:27:51 +02:00
Lars Melchior
310efb9b17 Update more examples from the readme (#241)
* update examples from the readme

* add explainations to the examples
2021-03-26 18:31:35 +02:00
Lars Melchior
4fad2eac0a remove option consistency check (#240) v0.32.0 2021-03-25 19:24:44 +02:00
flagarde
ee08119642 Scope package options to avoid changing the local scope (#235)
* 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>
2021-03-25 15:59:34 +01:00
Lars Melchior
259f1be8e2 update cxxopts and add reasonable options (#239) 2021-03-25 14:20:06 +02:00
Lars Melchior
32b063eba5 Fix support for source subdirectories (#238)
* add support for source subdirectories

* style fixes

* remove debug log

* grammar fix in comment
v0.31.2
2021-03-25 10:42:51 +01:00
Lars Melchior
d64d816585 Make CPMFindPackage less prominent in the Readme (#236)
Giving `CPMFindPackage` a less prominent position, as in almost all cases, `CPMAddPackage` should be preferred.

Following a related discussion in #222.
2021-03-22 12:37:11 +01:00
Lars Melchior
8e8dcc9a8d moved test repostitory to CPM.cmake namespace (#228) 2021-03-04 11:01:01 +02:00
Lars Melchior
8afc2af4f9 update more examples to use shorthand syntax (#223)
* 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
2021-02-25 09:53:28 +02:00
Borislav Stanimirov
a3d1048ad6 Infer package name and version from URL (#220)
* 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>
v0.31.1
2021-02-23 20:15:45 +01:00
Lars Melchior
492e762591 update examples to use new syntax where possible (#218) 2021-02-23 08:14:32 +02:00
Borislav Stanimirov
3f6cbe7383 Single-argument shorthand syntax for CPMAddPackage (#207)
* 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>
v0.31.0
2021-02-22 21:12:06 +01:00
Borislav Stanimirov
4aadac1972 Improved regex match in cpm_package_name_from_git_uri (#206) 2021-02-19 09:45:04 +01:00
Borislav Stanimirov
4cbf443363 If a name isn't provided, try to infer it from the git repo (#202)
* 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 :)
v0.30.0
2021-02-17 12:41:25 +01:00
Borislav Stanimirov
2744b87f07 FATAL_ERROR if no NAME is provided (#201)
* FATAL_ERROR if no NAME is provided

* Fixed format
2021-02-16 14:54:31 +00:00
Lars Melchior
fd539b8ff3 Add dependencies using EXCLUDE_FROM_ALL flag (#198)
* 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
v0.29.0
2021-02-16 10:26:16 +00:00
Lars Melchior
02d57a1601 Update URLs for new CPM.cmake organisation (#194)
* update URLs for new CPM.cmake organisation

* trigger travis
v0.28.4
2021-02-08 21:31:06 +01:00
Claus Klein
5f614e5eb6 update most package versions (#190)
* 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>
v0.28.3
2021-02-07 17:08:04 +01:00
Xavier Muller
1f5cb903e5 fix superbuild cmake < 3.17 (#193)
* CPM_INDENT in the global scope as suggest

* Fix FetchContent failure with cmake < 3.17

* format
2021-02-07 17:07:47 +01:00
alexandreSalconiDenis
7000572bbe Feature/prettify package lock (#162)
* 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
v0.28.2
2021-01-27 13:29:15 +01:00
Borislav Stanimirov
fe8d15ba82 Expand CPM_SOURCE_CACHE path provided as a configure argument (#186)
Otherwise if one configures with -DCPM_SOURCE_CACHE=~/something (tilde to be expanded to $HOME), https://gitlab.kitware.com/cmake/cmake/-/issues/21729 hits, EXISTS always fails, and file(DOWNLOAD) fails
v0.28.1
2021-01-21 16:31:55 +01:00
Lars Melchior
ab6e8d6d8c Performance improvement: bypass FetchContent for cached dependencies (#182)
* skip FetchContent for cached dependencies

* set default value for CPM_SKIP_FETCH to avoid conflicts

* add tests to check exported values
v0.28.0
2021-01-20 13:15:18 +01:00
Lars Melchior
aad0397beb add further reading section (#177) 2021-01-14 12:28:11 +00:00
Lars Melchior
1ebbac6332 Apply clang-format and cmake-format and add style check workflow (#171)
* 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
2021-01-06 14:40:33 +01:00
Yotam Gingold
cf3f62b6f2 Fixed typo in help message (#165) 2020-11-26 17:52:34 +01:00
Xavier Muller
3b404296b5 fix: GIT_TAG not parsed inside CPMFindPackage (#159)
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.
v0.27.5
2020-10-19 09:34:42 +02:00
Leonardo Lima
18e09b07ba Implemented GitHub Actions cache example (#156)
* Implemented GitHub Actions cache example

* Updated GitHub Actions example

* Update README.md

* Fixed consistency

Co-authored-by: Lars Melchior <TheLartians@users.noreply.github.com>

Co-authored-by: Lars Melchior <TheLartians@users.noreply.github.com>
2020-10-06 13:07:00 +02:00
Kai Germaschewski
aeef56ea85 fix passing options when using CPM_<pkg>_SOURCE (#155)
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.
v0.27.4
2020-09-27 22:56:32 +02:00
The Gitter Badger
4271d5981f Add Gitter badge (#154) 2020-09-25 17:42:02 +02:00
Prabir Shrestha
d17500b0be ignore lua.c and luac.c from lua (#149)
* ignore lua.c and luac.c from lua

* Update README.md

* update CMakeLists.txt for sol2
2020-09-13 12:00:19 +02:00
Leonardo
5e0c3855c7 Implemented spdlog library example (#150) 2020-09-08 14:08:35 +02:00
Lars Melchior
f96cff720e switch to on-demand download script as the recommended way to get CPM.cmake (#147) 2020-08-20 10:31:08 +02:00
Lars Melchior
c3c7e2d9a3 add on-demand download script to release (#146) v0.27.3 2020-08-20 09:32:03 +02:00
Lars Melchior
30b98af416 Add link to tutorial (#143) 2020-08-12 13:41:40 +02:00
Lars Melchior
5063c7d992 Add built with CPM.cmake section (#142)
* add built with cpm.cmake section

* update text

* explicitly set width
2020-08-11 14:49:21 +02:00
Lars Melchior
3cfb309f3c add comparisons to other approaches (#141) 2020-08-11 12:49:37 +02:00
Lars Melchior
25603ac4ad Update publish script to set CPM.cmake version automatically (#139)
* update publish script to set CPM.cmake version automatically

* set a minimum development version to avoid deprecated error handler call
2020-08-04 13:12:35 +02:00
Lars Melchior
ac872f6908 Bump version and add gitlab source to examples (#138)
* use gitlab as source for example library

* bump CPM.cmake version
v0.27.2
2020-08-04 12:24:06 +02:00
jecassis
bd14ccbd5a Fix indeterminate command for GitLab argument (#137) 2020-08-04 11:40:58 +02:00
Kingsley Chen
f8afae6eb3 Add asio standalone example (#133)
* 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>
2020-06-24 12:40:12 +02:00
Lars Melchior
9ec279c75f bump version and update tests (#131) v0.27.1 2020-06-15 10:16:30 +02:00
Kingsley Chen
392b2a864b Use shallow clone for git repositories by default (#129) (#130)
* 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
2020-06-15 09:27:26 +02:00
Lars Melchior
139d3cacba Add NO_CACHE option (#128)
* add NO_CACHE option

* add unit test
v0.27
2020-06-04 14:22:57 +02:00
Lars Melchior
b31063d2ae prevent overriding declarations (#127) v0.26.2 2020-05-29 16:08:41 +02:00
Lars Melchior
4425bd38cf Add FORCE parameter (#126)
* add scope protection

* rename to cpm_clean_argument_scope and update patch version

* undo unnecessary scope cleaning

* undo some changes

* consistent define checks
v0.26.1
2020-05-29 15:37:49 +02:00
Lars Melchior
6da5c38dae Add package lock section to the readme (#125)
* add package lock section to the readme

* clarify position of package lock
2020-05-29 12:24:55 +02:00
Lars Melchior
76d7b27459 Fix typo and wording (#124)
* Fix typo

* Update README.md
2020-05-29 10:15:09 +02:00