Commit Graph

299 Commits

Author SHA1 Message Date
Lars Melchior
d6d5d0d5ab Remove logs in get_cpm.cmake script (#508)
* remove all logs from get_cpm.cmake

* simplify get_cpm.cmake script
v0.38.5
2023-09-18 16:11:03 +02:00
Lars Melchior
16c6a3b0af Fix download_command by declaring it a multi-value option (#473) v0.38.4 2023-09-18 15:37:35 +02:00
Lars Melchior
52ee7c9d53 Fix new release script to use correct version and hash sum (#507)
* fix new release script to use correct version and hash sum

* update logging behaviour
v0.38.3 v0.38.3-rc-2
2023-09-18 15:01:57 +02:00
Tobias Schmidl
699c7a0038 Added download status, added comparison by hash sum (#474) v0.38.3-rc-1 2023-09-18 14:01:34 +02:00
Vincent Hamp
daf9d766c6 Add ZIMO-Elektronik to "Built with CPM.cmake" (#490) 2023-09-18 11:45:33 +02:00
Carlo Corradini
439bfcf134 chore(license): update license year (#504) 2023-09-17 19:35:11 +00:00
Alois Klink
02ecc4608a Add SPDX tags to get_cpm.cmake to comply with MIT (#496)
Add [SPDX][1] licensing/copyright tags to the `get_cpm.cmake` script,
so that anybody that copies the `get_cpm.cmake` script into their repo
(following the instructions in the README.md)
will automatically comply with CPM's MIT license.

[1]: https://spdx.dev/
2023-08-19 12:53:28 +00:00
Johel Ernesto Guerrero Peña
4608688d85 docs: fix spelling of "through" (#489) 2023-08-19 13:29:57 +02:00
Johel Ernesto Guerrero Peña
cda03b434e ci(cmake): split additional_commands to its own file (#486) 2023-08-19 12:57:47 +02:00
Andreas K
ee556fc555 fix(lock): fix typo: CPM_CACHE_SOURCE -> CPM_SOURCE_CACHE (#485) v0.38.2 2023-07-12 15:43:48 +02:00
Asger Gitz-Johansen
1b59cb6b16 Add AALTITOAD to "Built with CPM.cmake" (#463) 2023-04-13 09:58:49 +00:00
Claus Klein
a02a9601da SOURCE_DIR option disable call to find_package() (#456) v0.38.1 2023-02-28 19:25:01 +01:00
Craig Hutchinson
af3f1ca814 Prevent check variable leaking into caller scope (#457) 2023-02-27 12:48:00 +01:00
Lars Melchior
b9b512a869 Add CMake version as workflow matrix parameter (#451)
* add CMake version as workflow matrix parameter

* change system test behaviour based on specified CMake version

* use explicit version strings

* set CMake version for both test steps

* exclude windows-2022, cmake 3.16 combination
2023-02-22 17:33:50 +01:00
Lars Melchior
e23bd4c0c3 Update Readme to match default SYSTEM behaviour (#452) 2023-02-21 20:00:20 +02:00
Lars Melchior
5f3005ab7c Move section on adding CPM higher in the Readme (#454)
Repositions the "Adding CPM" section higher in the Readme to increase incentive to try it out and make it easier to find for updating CPM in existing projects.
2023-02-21 19:59:57 +02:00
Lars Melchior
12daf366c7 Add SYSTEM option (#449)
* add system property for cpm_add_subdirectory

* add test case for system property

* lock CMake version in test workflow

* refactor to make SYSTEM an extra config option and update tests

* remove old comment change

* use consistent CMake version and extension for all workflows

* make warning more specific and try to trigger on windows

* another attempt to trigger warning on MSVC

* update readme

* simplify test case and use git tag

* add SYSTEM option to .cmake-format

* forward system arg for source overrides

* enable system implicitly for the single argument syntax

* Use SYSTEM option for FetchContent and add_subdirectory (#441)

* Use SYSTEM option for FetchContent and add_subdirectory

* Add SYSTEM option to syntax and doku

* Update CPM.cmake

* Update .cmake-format

---------

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

---------

Co-authored-by: Claus Klein <claus.klein@arcormail.de>
v0.38.0
2023-02-21 15:51:33 +01:00
PercentBoat4164
0938e8fde7 Improve Multi-threaded Performance. (#450)
* Optimized multi-threading.

* Remove old multi-threading implementation.

* Release files instead of removing.

* Lock before choosing to check cache or download.

* Unlock directly after verifying directory exists.
2023-02-21 15:47:15 +01:00
PercentBoat4164
09b056ae20 Add file locking to support parallel runs. (#427)
* Add file locking to support parallel runs.

* Fixed formatting.

* Prevent double locking file.

* Fix SegFault from test 2.

* Remove unnecessary debugging messages.

* Lock the package directory rather than the cache directory.
Only synchronize if CPM_SOURCE_CACHE is defined.

* Lock the version specific cache entry rather than the package specific entry.

* Remove unnecessary arguments in conditional statements.

* Change back to locking entire cache directory.

* Only check CPM_HAS_CACHE_LOCK.

* Lock on a per-package basis rather than the entire cache.

* Clean up the locked file.

* Unlock then remove to fix Windows.

* Specify use of cmake.lock as the lock file.

* - Changed CPM_HAS_CACHE_LOCK to ${CPM_ARGS_NAME}_CPM_HAS_CACHE_LOCK.
- Removed redundant variable initialization.

* Add unit test.

* Actually test if resulting git cache is clean in unit test.

* - Added comments
- Fixed formatting
- Removed unnecessary imports

* convert parallelism test to integration test

* remove comment

* - Removed now unnecessary variable.
 - Only delete file instead of unlocking it then deleting it.

* Forgot to change variable name.

* Add similar changes to the missed section.

* Fixed formatting.

* Unlock the file, but do not delete it.

* Only unlock the file if it exists.

* Changed cache.cmake test to ignore non-directory entries.

* Integration test lib make_project:
* keyword args
* 'name' arg to allow multiple projects from the same test

* - Moved checks to function.
- Fixed small grammatical errors.

* - Fix formatting

* Switch to snake case.

---------

Co-authored-by: Lars Melchior <TheLartians@users.noreply.github.com>
Co-authored-by: Lars Melchior <lars.melchior@gmail.com>
Co-authored-by: Borislav Stanimirov <b.stanimirov@abv.bg>
v0.37.0
2023-01-28 14:36:44 +01:00
Jan Niklas Hasse
d34d2a8730 Add JNGL to "Built with CPM.cmake" (#434)
Co-authored-by: Lars Melchior <TheLartians@users.noreply.github.com>
2023-01-10 15:48:29 +00:00
Lars Melchior
6fc2170d5d Update example dependency versions (#430)
* update example versions

* update doctest

* update lua

* update google benchmark

* update catch2

* update readme to match updated dependencies

Co-authored-by: Lars Melchior <lars@Larss-Laptop.local>
2023-01-10 15:31:57 +01:00
haenkel
1184a6e6e7 get_cpm: Recover from failed download (#426)
* get_cpm: Recover from failed download

If the download fails during the cmake config step
an empty `CPM_<version>.cmake` file is created.
So far the script only checks the files existence,
so there is no second try until the empty file is deleted manually.

This adds a check if the file is empty
and resumes the download on next config if it is.

* More descriptive function name
2022-11-29 17:30:22 +00:00
flagarde
c53417bd65 Small helper function for logging : (#422)
* Small helper function for logging :

This PR add an helper function only when `message(STATUS ...)` as the other are `backtracing` and adding the helper function add on stack.

It should fix #328 #342 with a few line of code.

* Formatting
2022-11-29 17:50:19 +01:00
Jan Niklas Hasse
50e9b9edb8 Instead of spdlog's bundled fmt re-use it from CPM.cmake (#364)
* Instead of spdlog's bundled fmt re-use it from CPM.cmake

* Add comment about re-using fmt for spdlog

* Update examples/spdlog/CMakeLists.txt

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

* run cmake-format

* disable cmake-format around code block

Co-authored-by: Lars Melchior <TheLartians@users.noreply.github.com>
2022-11-09 11:23:09 +00:00
Craig Hutchinson
03705fcce1 Added export of CPM_LAST_PACKAGE_NAME (#403) v0.36.0 2022-09-28 21:39:31 +02:00
Lars Melchior
f00ccd89c4 Update example in readme (#413)
* update readme example

* Update README.md
2022-09-28 22:31:15 +03:00
Lars Melchior
1f4909ca44 add CONTRIBUTING.md (#412) 2022-09-28 05:55:09 +03:00
Borislav Stanimirov
4d33686a50 Updated contributor list (#411) 2022-09-27 21:09:28 +02:00
AlessandroW
984251f46c Fix copy/paste bug in fmt example CMakeLists.txt
#410
2022-09-27 21:01:21 +03:00
Robert Maynard
63d0de7114 Don't warn about dirty source trees when a PATCH_COMMAND is provided (#401)
The patch command will always cause a dirty source tree, which
is expected and not a cause for concern.
v0.35.6
2022-09-13 23:21:12 +02:00
Kamil Kisiel
65c760a840 Expand absolute path later in get_cpm.cmake (#397)
* Expand absolute path later in get_cpm.cmake

Supports expanding tildes in the environment.

* Apply cmake-format to get_cpm.cmake

* Use .cmake-format file
2022-09-13 20:54:57 +00:00
Robert Maynard
b5e60e72e8 cpm_find_package Use found package version when possible (#396) 2022-09-13 22:44:24 +02:00
Robert Maynard
10bf25a811 Restore policy changes in CPMAddPackage (#388)
* Restore policy changes in CPMAddPackage

Fixes #387

* Correct style issues found by CI
v0.35.5
2022-08-11 19:12:21 +00:00
Lars Melchior
18b6cbf233 perform policy changes only in top-level CPM.cmake script (#386) 2022-08-09 12:56:46 +02:00
Olivier Le Doeuff
698741ff7c Fix a very confusing typo (#384) 2022-08-04 10:34:33 +03:00
Borislav Stanimirov
1f09de0d9b Document policies being set to NEW when including CPM.cmake (#383) 2022-08-04 08:32:05 +02:00
Robert Maynard
b224ce280d Timestamps for URL downloads match the download time (#372)
* Timestamps for URL downloads match the download time

By enabling CMake policy 135 we ensure that extracted files
timestamp match that of the download time, instead of when the
archive is created. This makes sure that if the URL changes to
an older version we still rebuild everything as the timestamp
stays newer.

* Introduce CPM_SET_RECOMMENDED_CMAKE_POLICIES

Enabling CPM_SET_RECOMMENDED_CMAKE_POLICIES will establish defaults
for all CMake policies so that both CPM and added projects
operate inline with CPM recommended best practices.

* Fix style issues found by ci

* Update README.md

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

* Update cmake/CPM.cmake

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

* Set policies when CPM.cmake is included

* CPM_SET_RECOMMENDED_CMAKE_POLICIES default is ON

* Correct failing CI tests

* CPM.cmake always sets policies to on

Co-authored-by: Lars Melchior <TheLartians@users.noreply.github.com>
v0.35.4
2022-08-04 00:22:50 +02:00
Lars Melchior
49af958fb4 Use 3 column layout in showcase (#381) 2022-08-03 10:55:32 +03:00
Evgeny Gorodetskiy
90c763532a Add Methane Kit project to showcase table in ReadMe (#380)
* Add MethaneKit project to the showcase table

* Shorten description, wrap to new line in table
2022-08-01 20:55:03 +02:00
Robert Maynard
4605d32f0e CPM_DIRECTORY always stores absolute non symlink paths (#379)
* CPM_DIRECTORY always stores absolute non symlink paths

When CPM is brought into a project via downloading it will be placed
in the build directory. When the build directory is a symlink the
CPM_DIRECTORY value will hold the symlink value. This means that
trying to run CMake via the real build directory will cause CPM
to fail since it considers the current CMAKE_CURRENT_LIST_DIR
to be different and will early exit.

This resolves the issue be always getting CMake to resolve symlinks
before comparing paths for CPM_DIRECTORY.

* Refactor logic based on PR review
v0.35.3
2022-07-31 21:51:27 +02:00
Thomas Mosegaard Pedersen
ede60451a9 CPMAddPackage fails if the SOURCE_DIR directory is deleted. (#370)
* 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
v0.35.2
2022-07-26 07:15:11 +00:00
David Fong
5961f9f9fb bump example range-v3 to 0.12.0 (#366)
* bump range-v3 to 0.12.0

* bump range-v3 to 0.12.0
2022-07-02 12:56:11 +00:00
Anton Filimonov
69e9ff3766 Klogg switched to CPM for dependency management (#363)
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!
2022-06-27 23:39:13 +02:00
Olivier Le Doeuff
3fee69c894 Add readme "Customize repository URL" with git-config (#353) 2022-05-17 08:17:14 +02:00
Lars Melchior
a575ab57b7 Allow overriding FetchContent using CPM (#352)
* Override FetchContent paramers, fixes #281

* add check to verify that dependency is cached

* update test comment

* rename test file and class

* update test indentation
v0.35.1
2022-05-16 21:28:44 +02:00
Lava Block
ca421f0e0c Add liblava to "Built with CPM.cmake" (#346) 2022-04-10 18:59:05 +00:00
Robert Maynard
005f202655 Add per package CPM_DOWNLOAD controls (#336)
* 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
v0.35.0
2022-02-11 19:37:32 +01:00
Lars Bilke
865648e7bd Fixed typos in comments 2022-02-09 11:25:26 +00:00
Borislav Stanimirov
33bdbae902 List of contributors (#340)
* Updated copyright years. Same copyright holders in code and LICENSE

* Contributor list. Order is from contributors gh page
2022-02-07 20:21:43 +01:00
Tobias Hellmann
9d3fad01d4 Fix broken example for nlohmann/json (#338) 2022-01-27 22:59:28 +00:00