From 252b58d39fb3a997365b584b84a43bc75d7b655f Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Thu, 14 May 2020 11:26:00 +0200 Subject: [PATCH] Change the version compatibility to SameMajorVersion and change the testsuite --- Installation/lib/cmake/CGAL/CGALConfigVersion.cmake | 6 +++++- Installation/test/Installation/CMakeLists.txt | 7 ++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/Installation/lib/cmake/CGAL/CGALConfigVersion.cmake b/Installation/lib/cmake/CGAL/CGALConfigVersion.cmake index 16aa829ea9d..ee71a01063c 100644 --- a/Installation/lib/cmake/CGAL/CGALConfigVersion.cmake +++ b/Installation/lib/cmake/CGAL/CGALConfigVersion.cmake @@ -15,7 +15,11 @@ set(PACKAGE_VERSION ${CGAL_CREATED_VERSION_NUM}) if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION) set(PACKAGE_VERSION_COMPATIBLE FALSE) else() - set(PACKAGE_VERSION_COMPATIBLE TRUE) + if(PACKAGE_FIND_VERSION_MAJOR STREQUAL CGAL_MAJOR_VERSION) + set(PACKAGE_VERSION_COMPATIBLE TRUE) + else() + set(PACKAGE_VERSION_COMPATIBLE FALSE) + endif() if(PACKAGE_FIND_VERSION STREQUAL PACKAGE_VERSION) set(PACKAGE_VERSION_EXACT TRUE) endif() diff --git a/Installation/test/Installation/CMakeLists.txt b/Installation/test/Installation/CMakeLists.txt index e4aacdf867c..cbb6b6b9681 100644 --- a/Installation/test/Installation/CMakeLists.txt +++ b/Installation/test/Installation/CMakeLists.txt @@ -106,7 +106,10 @@ endif() function(CGAL_installation_test_find_package_version mode) set(EXACT) 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() if(mode STREQUAL "greater" OR mode STREQUAL "fail-exact") MATH(EXPR CGAL_MINOR_VERSION "${CGAL_MINOR_VERSION} + 1") @@ -129,11 +132,13 @@ function(CGAL_installation_test_find_package_version mode) endfunction() 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(greater) CGAL_installation_test_find_package_version(exact) CGAL_installation_test_find_package_version(fail-exact) set_tests_properties( test_find_package_version_greater + test_find_package_version_less_major test_find_package_version_fail-exact PROPERTIES WILL_FAIL TRUE)