diff options
author | Robert Maynard <rmaynard@nvidia.com> | 2021-05-27 18:14:49 (GMT) |
---|---|---|
committer | Robert Maynard <rmaynard@nvidia.com> | 2021-05-27 19:18:37 (GMT) |
commit | e609afeb5f4385755a6d0f2fdb45fcdfb0a01b7a (patch) | |
tree | 375cfa4058b154ec4f5673310e460aa728e1175f /Tests/RunCMake/find_package | |
parent | c5657a2fe42a0de7a5724507888f9f6f1afff8ea (diff) | |
download | CMake-e609afeb5f4385755a6d0f2fdb45fcdfb0a01b7a.zip CMake-e609afeb5f4385755a6d0f2fdb45fcdfb0a01b7a.tar.gz CMake-e609afeb5f4385755a6d0f2fdb45fcdfb0a01b7a.tar.bz2 |
WriteBasicConfigVersion supports version strings such as 21.07.04
Fixes #22207
Diffstat (limited to 'Tests/RunCMake/find_package')
3 files changed, 28 insertions, 2 deletions
diff --git a/Tests/RunCMake/find_package/RunCMakeTest.cmake b/Tests/RunCMake/find_package/RunCMakeTest.cmake index 72ffcce..3ba04c8 100644 --- a/Tests/RunCMake/find_package/RunCMakeTest.cmake +++ b/Tests/RunCMake/find_package/RunCMakeTest.cmake @@ -38,6 +38,7 @@ run_cmake(VersionRange3) run_cmake(VersionRange4) run_cmake(VersionRangeConfig) run_cmake(VersionRangeConfig2) +run_cmake(VersionRangeConfig02) run_cmake(VersionRangeConfigStd) run_cmake(VersionRangeConfigStd2) if(UNIX diff --git a/Tests/RunCMake/find_package/VersionRangeCfg/VersionRangeCfgConfigVersion.cmake b/Tests/RunCMake/find_package/VersionRangeCfg/VersionRangeCfgConfigVersion.cmake index e9f6076..1d0adfe 100644 --- a/Tests/RunCMake/find_package/VersionRangeCfg/VersionRangeCfgConfigVersion.cmake +++ b/Tests/RunCMake/find_package/VersionRangeCfg/VersionRangeCfgConfigVersion.cmake @@ -1,6 +1,7 @@ if (NOT PACKAGE_FIND_VERSION_COMPLETE STREQUAL "1.2.3.4...5.6.7.8" - AND NOT PACKAGE_FIND_VERSION_COMPLETE STREQUAL "1.2.3.4...<5.6.7.8") + AND NOT PACKAGE_FIND_VERSION_COMPLETE STREQUAL "1.2.3.4...<5.6.7.8" + AND NOT PACKAGE_FIND_VERSION_COMPLETE STREQUAL "1.02.03.04...<5.06.07.08") message (SEND_ERROR "Wrong value for PACKAGE_FIND_VERSION_COMPLETE: ${PACKAGE_FIND_VERSION_COMPLETE}") endif() @@ -21,7 +22,8 @@ if (NOT PACKAGE_FIND_VERSION_TWEAK VERSION_EQUAL "4") endif() if (NOT PACKAGE_FIND_VERSION_RANGE STREQUAL "1.2.3.4...5.6.7.8" - AND NOT PACKAGE_FIND_VERSION_RANGE STREQUAL "1.2.3.4...<5.6.7.8") + AND NOT PACKAGE_FIND_VERSION_RANGE STREQUAL "1.2.3.4...<5.6.7.8" + AND NOT PACKAGE_FIND_VERSION_RANGE STREQUAL "1.02.03.04...<5.06.07.08") message (SEND_ERROR "Wrong value for PACKAGE_FIND_VERSION_RANGE: ${PACKAGE_FIND_VERSION_RANGE}") endif() diff --git a/Tests/RunCMake/find_package/VersionRangeConfig02.cmake b/Tests/RunCMake/find_package/VersionRangeConfig02.cmake new file mode 100644 index 0000000..6522f6d --- /dev/null +++ b/Tests/RunCMake/find_package/VersionRangeConfig02.cmake @@ -0,0 +1,23 @@ +set(CMAKE_PREFIX_PATH ${CMAKE_CURRENT_SOURCE_DIR}) + +find_package(VersionRange 1.02.03.04...<5.06.07.08 CONFIG NAMES VersionRangeCfg) + +if (NOT VersionRange_FOUND) + message (FATAL_ERROR "Package VersionRange not found in CONFIG mode.") +endif() + +if (NOT VersionRange_VERSION VERSION_EQUAL "2.3.4.5") + message (SEND_ERROR "Wrong version : ${VersionRange_VERSION}") +endif() +if (NOT VersionRange_VERSION_MAJOR VERSION_EQUAL "2") + message (SEND_ERROR "Wrong major version : ${VersionRange_VERSION_MAJOR}") +endif() +if (NOT VersionRange_VERSION_MINOR VERSION_EQUAL "3") + message (SEND_ERROR "Wrong minor version : ${VersionRange_VERSION_MINOR}") +endif() +if (NOT VersionRange_VERSION_PATCH VERSION_EQUAL "4") + message (SEND_ERROR "Wrong patch version : ${VersionRange_VERSION_PATCH}") +endif() +if (NOT VersionRange_VERSION_TWEAK VERSION_EQUAL "5") + message (SEND_ERROR "Wrong tweak version : ${VersionRange_VERSION_TWEAK}") +endif() |