Tags: cpm-cmake/CPM.cmake
Tags
Implement #624: Use shorter hashes with CPM_SOURCE_CACHE (#631) * Add ASSERT_CONTENTS_EQUAL test macro in testing.cmake Checks if the contents of a file matches the given input * Use shorter hashes with CPM_SOURCE_CACHE (#624) Uses shorter hashes with CPM_SOURCE_CACHE. Falls back to a longer hash if necessary (ie, if there's a collision with an existing hash). See: #624 * Update integration tests to support shorter hashes * trigger ci * run cmake-format * if already available, use the legacy cache hash * create temporary file in current binary dir * add test case for legacy hash --------- Co-authored-by: Lars Melchior <[email protected]> Co-authored-by: Lars Melchior <[email protected]>
feature: allow URI to use shorthand syntax with additional options (#617 ) * feature: add URI to use shorthand syntax with additional options This allows to combine the shorthand syntax with URI and additional arguments: ``` CPMAddPackage(URI "gh:nlohmann/[email protected]" OPTIONS "JSON_BUildTests OFF") ``` This is much shorter than the longer syntax way of writing: ``` CPMAddPackage( NAME nlohmann_json VERSION 3.9.1 GITHUB_REPOSITORY nlohmann/json OPTIONS "JSON_BuildTests OFF" ) ``` * fix: use shorthand syntax in examples * test: add test for shorthand syntax with options * doc: extend README mentioning shorthand syntax with options * feat: URI keyword also sets EXCLUDE_FROM AND SYSTEM * doc: more explicit about the behavior of URI * doc: adjust README accordingly to PR-Review * test: fix inline documentation of test_simple * move URI comment * added new test for shorthand syntax * reset simple test * add that URI must be the first argument --------- Co-authored-by: Lars Melchior <[email protected]>
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 0e8ca2a. --------- Co-authored-by: Avus <[email protected]>
PreviousNext