
Modify how CMake handles required components of a CPS transitive dependency to not pass them as COMPONENTS if a CMake-script package is found as the resolved dependency. This is necessary as many CMake-script package description files do not treat component requests as target requests (which, in CPS-land, they effectively are), but do implement logic to mark themselves 'not found' if requested components are missing. As a result, passing in the required targets as required components is likely to cause the dependency to be spuriously not found if it is only available via a CMake-script package configuration file. Fix this by introducing a new 'required targets' concept, and by passing CPS component requirements as both required targets and optional components. The latter serves as a hint for packages that might provide only a subset of themselves. The former is used to post-validate a CMake-script package, or is folded on-the-fly into required components when considering CPS packages. Note that this functionality is not exposed to the user at this time, and is only used when resolving transitive dependencies for a CPS package.
33 lines
848 B
CMake
33 lines
848 B
CMake
include(RunCMake)
|
|
|
|
run_cmake(ExperimentalWarning)
|
|
|
|
# Enable experimental feature and suppress warnings
|
|
set(RunCMake_TEST_OPTIONS
|
|
-Wno-dev
|
|
"-DCMAKE_EXPERIMENTAL_FIND_CPS_PACKAGES:STRING=e82e467b-f997-4464-8ace-b00808fff261"
|
|
)
|
|
|
|
# Version-matching tests
|
|
run_cmake(ExactVersion)
|
|
run_cmake(CompatVersion)
|
|
run_cmake(MultipleVersions)
|
|
run_cmake(VersionLimit1)
|
|
run_cmake(VersionLimit2)
|
|
run_cmake(TransitiveVersion)
|
|
run_cmake(CustomVersion)
|
|
|
|
# Version-matching failure tests
|
|
run_cmake(MissingVersion1)
|
|
run_cmake(MissingVersion2)
|
|
run_cmake(VersionLimit3)
|
|
run_cmake(VersionLimit4)
|
|
|
|
# Component-related failure tests
|
|
run_cmake(MissingTransitiveDependency)
|
|
run_cmake(MissingComponent)
|
|
run_cmake(MissingComponentDependency)
|
|
run_cmake(MissingTransitiveComponentCPS)
|
|
run_cmake(MissingTransitiveComponentCMake)
|
|
run_cmake(MissingTransitiveComponentDependency)
|