diff options
author | Brad King <brad.king@kitware.com> | 2024-10-18 11:39:59 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2024-10-18 11:40:14 (GMT) |
commit | 5a459163dc9429bec9028db36d3cb8eca9504d9c (patch) | |
tree | eaffe6e61ae37f1ece977371e6edd250fbd4f266 /Tests | |
parent | b3a90110ce36ae3ce1fbe31ee623eb755c191b79 (diff) | |
parent | f04dd93c4736ecbc74624dbf2c1b6dd58ecf3ca4 (diff) | |
download | CMake-5a459163dc9429bec9028db36d3cb8eca9504d9c.zip CMake-5a459163dc9429bec9028db36d3cb8eca9504d9c.tar.gz CMake-5a459163dc9429bec9028db36d3cb8eca9504d9c.tar.bz2 |
Merge topic 'fix-cps-version' into release-3.31
f04dd93c47 cmExportPackageInfoGenerator: Fix version properties
Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !9914
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/RunCMake/PackageInfo/MinimalVersion-check.cmake | 21 | ||||
-rw-r--r-- | Tests/RunCMake/PackageInfo/MinimalVersion.cmake | 19 | ||||
-rw-r--r-- | Tests/RunCMake/PackageInfo/RunCMakeTest.cmake | 1 |
3 files changed, 41 insertions, 0 deletions
diff --git a/Tests/RunCMake/PackageInfo/MinimalVersion-check.cmake b/Tests/RunCMake/PackageInfo/MinimalVersion-check.cmake new file mode 100644 index 0000000..8facefa --- /dev/null +++ b/Tests/RunCMake/PackageInfo/MinimalVersion-check.cmake @@ -0,0 +1,21 @@ +include(${CMAKE_CURRENT_LIST_DIR}/Assertions.cmake) + +set(out_dir "${RunCMake_BINARY_DIR}/MinimalVersion-build/CMakeFiles/Export/510c5684a4a8a792eadfb55bc9744983") + +file(READ "${out_dir}/foo1.cps" content) +expect_value("${content}" "foo1" "name") +expect_value("${content}" "1.0" "version") +expect_missing("${content}" "compat_version") +expect_missing("${content}" "version_schema") + +file(READ "${out_dir}/foo2.cps" content) +expect_value("${content}" "foo2" "name") +expect_value("${content}" "1.5" "version") +expect_value("${content}" "1.0" "compat_version") +expect_missing("${content}" "version_schema") + +file(READ "${out_dir}/foo3.cps" content) +expect_value("${content}" "foo3" "name") +expect_value("${content}" "1.0" "version") +expect_missing("${content}" "compat_version") +expect_value("${content}" "simple" "version_schema") diff --git a/Tests/RunCMake/PackageInfo/MinimalVersion.cmake b/Tests/RunCMake/PackageInfo/MinimalVersion.cmake new file mode 100644 index 0000000..ea4679c --- /dev/null +++ b/Tests/RunCMake/PackageInfo/MinimalVersion.cmake @@ -0,0 +1,19 @@ +add_library(foo INTERFACE) +install(TARGETS foo EXPORT foo DESTINATION .) + +install(PACKAGE_INFO foo1 + EXPORT foo + VERSION 1.0 + DESTINATION cps) + +install(PACKAGE_INFO foo2 + EXPORT foo + VERSION 1.5 + COMPAT_VERSION 1.0 + DESTINATION cps) + +install(PACKAGE_INFO foo3 + EXPORT foo + VERSION 1.0 + VERSION_SCHEMA simple + DESTINATION cps) diff --git a/Tests/RunCMake/PackageInfo/RunCMakeTest.cmake b/Tests/RunCMake/PackageInfo/RunCMakeTest.cmake index 54a32d5..e90c371 100644 --- a/Tests/RunCMake/PackageInfo/RunCMakeTest.cmake +++ b/Tests/RunCMake/PackageInfo/RunCMakeTest.cmake @@ -27,6 +27,7 @@ run_cmake(Appendix) run_cmake(InterfaceProperties) run_cmake(Metadata) run_cmake(Minimal) +run_cmake(MinimalVersion) run_cmake(LowerCaseFile) run_cmake(Requirements) run_cmake(TargetTypes) |