Commit Graph

18 Commits

Author SHA1 Message Date
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>
2021-02-22 21:12:06 +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 :)
2021-02-17 12:41:25 +01: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
2021-02-16 10:26:16 +00: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
2021-01-27 13:29:15 +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
2021-01-20 13:15:18 +01: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
Lars Melchior
9ec279c75f bump version and update tests (#131) 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
2020-06-04 14:22:57 +02:00
Lars Melchior
54a2d80d1e Add option for local package override (#123)
* add option for local package override

* print info on the source directory
2020-05-29 09:58:39 +02:00
Lars Melchior
829262cbd3 omit unversioned and local dependencies in package lock (#122)
* omit unversioned and local dependencies in package lock

* update package lock for active project only
2020-05-28 13:29:25 +02:00
Lars Melchior
4aeea1d31d Add package lock (#121)
* add package lock creation

* change target name

* fix cpm_export_variables

* add test

* fix git repo detection addition

* remove test package lock from git

* add link to package lock wiki

* add CPMGetPackage
2020-05-27 19:07:06 +02:00
Lars Melchior
ca33abc236 create FindXXX.cmake modules for added CPM packages (#112)
* create FindXXX.cmake modules for added CPM packages

* don't use list(PREPEND) as it unsupported on older CMake versions

* use CMAKE_BINARY_DIR

* ensure CPM.cmake is initialized only once

* import CPM.cmake in modules
2020-04-29 09:18:54 +02:00
Lars Melchior
618cdefa0d Support CPM_SOURCE_CACHE on windows (#109)
* use semicolon as empty command and add test

* remove platform specific test coverage

* only run actions for pushes and prs into master (avoid duplication)

* remove cache test as it's already part of the test suite

* update version

* test cache reuse
2020-04-25 00:51:18 +02:00
Lars Melchior
01b69aad82 add support for SOURCE_DIR argument (#97)
* add support for SOURCE_DIR argument

* simplify code

* add test

* update comment
2020-02-25 13:29:21 +01:00
Lars Melchior
47bfb554ab reorganise source and add CPMFindPackage (#92)
* reorganise source and add CPMFindPackage

* add consistent find_package behaviour

* document CPMFindPackage

* reset examples to CPMAddPackage unless tested

* update version

* update README.md

* Update README.md
2019-10-24 15:42:25 +02:00
Lars Melchior
4064a45552 Add CPM_SOURCE_CACHE environmental variable support and keep existing sources (#83)
* read CPM_SOURCE_CACHE from environment

* update readme

* cleanup

* add cache tests
2019-10-10 20:13:10 +02:00
Lars Melchior
3d75ed06a3 add unit tests and determine version from GIT_TAG (#66)
* add unit tests

* determine package version from git tag. closes #54.

* update readme

* bugfix

* update example

* update gitignore
2019-06-22 13:31:32 +02:00