Closed VincentRouvreau closed 1 month ago
That is an history of PR #4697 and, in particular commit 252b58d39fb3a997365b584b84a43bc75d7b655f, it seems that at that time we decided that, if the CMake user-code was asking for CGAL compatible with version 5.1, then a major version change like 6.0 would not be compatible. Do you agree it was a reasonable choice?
In recent CMake versions, find_package
can specify a version range. I do not know if our file Installation/lib/cmake/CGAL/CGALConfigVersion.cmake
is ready for that. I am pretty sure it is not tested, and thus I would guess it is broken.
I am open for a discussion, here. @VincentRouvreau, @afabri, @sloriot, others, please comment.
Will the major changes for CGAL 6.0 invalidate the CMake code above?
From a CGAL user point of view, if you keep PACKAGE_VERSION_COMPATIBLE=FALSE
when major version is not the same, I do not see any CMake mechanism to make find_package(CGAL 5.1.0)
work as I am expecting to.
For instance, multiple find_package
does not work:
find_package(CGAL 5.1.0...<6.0.0)
if (NOT TARGET CGAL::CGAL)
find_package(CGAL 6.0.0)
endif()
But I can still do:
find_package(CGAL) # No expected version
if (NOT TARGET CGAL::CGAL)
# Do some tests to check the version number
endif()
Hi @VincentRouvreau @mglisse,
After a discussion with @sloriot, we decided that we will change that file CGALConfigVersion.cmake
for master
/CGAL-6.0. Whatever we decide for the policy in CGALConfigVersion.cmake
, CGAL tries to be reasonably backward-compatible, with a few breaking changes for any new version (except for bug-fixes versions). Regardless of the policy we adopt, it will only approximate the actual situation. Therefore, we should avoid creating unnecessary obstacles for CGAL users.
Hi @VincentRouvreau @mglisse,
After a discussion with @sloriot, we decided that we will change that file
CGALConfigVersion.cmake
formaster
/CGAL-6.0. Whatever we decide for the policy inCGALConfigVersion.cmake
, CGAL tries to be reasonably backward-compatible, with a few breaking changes for any new version (except for bug-fixes versions). Regardless of the policy we adopt, it will only approximate the actual situation. Therefore, we should avoid creating unnecessary obstacles for CGAL users.
Thanks for the fix proposal !
@VincentRouvreau A pull-request fixing that issue is being tested: https://github.com/CGAL/cgal/pull/8221.
Issue Details
CMake
find_package(CGAL 5.1.0)
(with a minimal cgal version number) does not seem to behave as expected with master version.Source Code
Here is a CMake file to reproduce the behaviour:
With CGAL 5.1.5, it works fine:
(tested with 5.5.3 also).
But, with 6.0-I-207 (master from some days ago):
Environment