CMakePackageConfigHelpers: Add version range support

This commit is contained in:
Marc Chevrier
2020-09-13 16:32:32 +02:00
parent 6bfc442fde
commit 5b3356263c
8 changed files with 64 additions and 5 deletions

View File

@@ -10,6 +10,13 @@
# The variable CVF_VERSION must be set before calling configure_file().
if (PACKAGE_FIND_VERSION_RANGE)
message(AUTHOR_WARNING
"`find_package()` specify a version range but the version strategy "
"(SameMinorVersion) of the module `${PACKAGE_FIND_NAME}` is incompatible "
"with this request. Only the lower endpoint of the range will be used.")
endif()
set(PACKAGE_VERSION "@CVF_VERSION@")
if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION)