Change the version compatibility to SameMajorVersion

and change the testsuite
This commit is contained in:
Laurent Rineau 2020-05-14 11:26:00 +02:00
parent d85396c148
commit 252b58d39f
2 changed files with 11 additions and 2 deletions

View File

@ -15,7 +15,11 @@ set(PACKAGE_VERSION ${CGAL_CREATED_VERSION_NUM})
if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION) if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION)
set(PACKAGE_VERSION_COMPATIBLE FALSE) set(PACKAGE_VERSION_COMPATIBLE FALSE)
else() else()
if(PACKAGE_FIND_VERSION_MAJOR STREQUAL CGAL_MAJOR_VERSION)
set(PACKAGE_VERSION_COMPATIBLE TRUE) set(PACKAGE_VERSION_COMPATIBLE TRUE)
else()
set(PACKAGE_VERSION_COMPATIBLE FALSE)
endif()
if(PACKAGE_FIND_VERSION STREQUAL PACKAGE_VERSION) if(PACKAGE_FIND_VERSION STREQUAL PACKAGE_VERSION)
set(PACKAGE_VERSION_EXACT TRUE) set(PACKAGE_VERSION_EXACT TRUE)
endif() endif()

View File

@ -106,7 +106,10 @@ endif()
function(CGAL_installation_test_find_package_version mode) function(CGAL_installation_test_find_package_version mode)
set(EXACT) set(EXACT)
if(mode STREQUAL "less") if(mode STREQUAL "less")
MATH(EXPR CGAL_MAJOR_VERSION "${CGAL_MAJOR_VERSION} - 1") set(CGAL_MINOR_VERSION 0)
endif()
if(mode STREQUAL "less_major")
set(CGAL_MAJOR_VERSION 0)
endif() endif()
if(mode STREQUAL "greater" OR mode STREQUAL "fail-exact") if(mode STREQUAL "greater" OR mode STREQUAL "fail-exact")
MATH(EXPR CGAL_MINOR_VERSION "${CGAL_MINOR_VERSION} + 1") MATH(EXPR CGAL_MINOR_VERSION "${CGAL_MINOR_VERSION} + 1")
@ -129,11 +132,13 @@ function(CGAL_installation_test_find_package_version mode)
endfunction() endfunction()
CGAL_installation_test_find_package_version(less) CGAL_installation_test_find_package_version(less)
CGAL_installation_test_find_package_version(less_major)
CGAL_installation_test_find_package_version(equal) CGAL_installation_test_find_package_version(equal)
CGAL_installation_test_find_package_version(greater) CGAL_installation_test_find_package_version(greater)
CGAL_installation_test_find_package_version(exact) CGAL_installation_test_find_package_version(exact)
CGAL_installation_test_find_package_version(fail-exact) CGAL_installation_test_find_package_version(fail-exact)
set_tests_properties( set_tests_properties(
test_find_package_version_greater test_find_package_version_greater
test_find_package_version_less_major
test_find_package_version_fail-exact test_find_package_version_fail-exact
PROPERTIES WILL_FAIL TRUE) PROPERTIES WILL_FAIL TRUE)