17 Commits

Author SHA1 Message Date
Avus-c
8b67fe2344 replace deprecated calls to FetchContent_Populate (#570)
* replace deprecated calls to FetchContent_Populate

The single argument signature for FetchContent_Populate is deprecated with CMake 3.30.
It was used, in order to call add_subdirectory manually with the EXCLUDE_FROM_ALL and SYSTEM flags.
These have been added to FetchContent_Declare with 3.25 and 3.28.
Calling FetchContent_MakeAvailable will internally call add_subdirectory with EXCLUDE_FROM_ALL and SYSTEM.
There is therefore no need to call this manually.

* fix: OPTIONS passed to CPMAddPackage not set

where previously parsed in cpm_add_subdirectory which is not called
on the new code path.

* refactor: remove an unnecessary else branch

* ci: include cmake 3.30 in test matrix

* fix: forward SOURCE_SUBDIR to FetchContent_Declare

For CMake version <3.28 this is done by calling add_subdirectory manually.
For newer version FetchContent_Declare/MakeAvailable handles this for us.

* fix: only set options if download_only is false

this replicates the old behaviour

* fix: DOWNLOAD_ONLY test

* refactor: always use *_Populate to reduce code paths

* Revert "refactor: always use *_Populate to reduce code paths"

This reverts commit 0e8ca2a0e9.

---------

Co-authored-by: Avus <48911667+Avus@users.noreply.github.com>
2024-07-29 11:19:31 +02:00
Chris Wright
369f1316f6 Treat relative paths as relative to parent project's remote (#522)
* Treat relative paths as relative to parent project's remote

* replace unit test case with integration test

* run relative URL test only on supported CMake versions (3.27)

* omit cmake 2.25.x test runner as replaced by 2.27.x

---------

Co-authored-by: Chris Wright <chris.wright@mqa.co.uk>
Co-authored-by: Lars Melchior <lars.melchior@gmail.com>
2023-11-30 20:01:03 +01: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
2023-09-18 15:01:57 +02:00
Tobias Schmidl
699c7a0038 Added download status, added comparison by hash sum (#474) 2023-09-18 14:01:34 +02: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
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>
2023-02-21 15:51:33 +01:00
Lars Melchior
1f4909ca44 add CONTRIBUTING.md (#412) 2022-09-28 05:55:09 +03:00
Robert Maynard
11c7ec8afa Use CMake 3.14+ documented way to pass the source dir -S. (#337)
The `-H<src_dir>` was never officially documented by CMake
2022-01-27 23:45:35 +01:00
Borislav Stanimirov
c58e98a0a0 Initial version of integration tests (#330)
* 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.
2022-01-19 00:18:41 +01:00
Borislav Stanimirov
262f1e0602 Unified GitHub workflow for tests on major operating systems (#326) 2022-01-11 21:16:04 +01:00
Lars Melchior
c5cb85b2f1 Build examples in CI using GitHub (#283)
* build examples in CI using github

* update cxxopts style
2021-08-29 20:27:10 +02: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
c3c7e2d9a3 add on-demand download script to release (#146) 2020-08-20 09:32:03 +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
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
90558aa9cb Add GitHub action to publish CPM on release (#102)
* add github action to publish cpm on release

* add checkout step

* update readme
2020-03-16 20:37:30 +01:00
Lars Melchior
3a4516265c Add GitHub workflows (#93)
* add mac workflow

* rename and add windows and ubuntu workflows

* update tests

* update tests

* update travis
2019-10-24 18:14:58 +02:00