* 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>
* 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>
* 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
* 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>
* 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.
* 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
* 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