Now that we require CMake>=3.1, we can forget a lot of old CMake policies.
`CMP0053` `OLD` behavior is still needed, because of a bug in Qt5 CMake files, but it will
not be set with CMake>=3.10. Let's assume that a recent CMake version means
a recent Qt5 version.
Change of Qt4or5 variables names.
Now: QT_VERSION => contains "QtX", with x 4 or 5 depending of the version wanted by the user.
USE_QT_VERSION => variable to force the version of Qt wanted. If this variable is set, the Qt Choice drop-down menu doesn't appear on CMake-gui.
QT_VERSION_USED => number of Qt version wanted (4 or 5).
QT4 => TRUE if Qt4 chosen.
QT5 => TRUE if Qt5 chosen.
That is a followup-to my commit last year:
| ------------------------------------------------------------------------
| r63198 | lrineau | 2011-04-28 19:45:22 +0200 (Thu, 28 Apr 2011) | 5 lines
|
| Try to fix my last revision about cmake_policy, with CMake-2.6.x
|
| CMake gives an error if one tries to use cmake_policy(VERSION x.y.z) if
| x.y.z is greater than the current CMake version.
|
| ------------------------------------------------------------------------
The following check:
if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" VERSION_GREATER 2.6)
is useless just after a call to:
cmake_minimum_required(VERSION 2.6.2)
The script used to fix that was:
#!/usr/bin/env perl
$replacement=<<'END';
if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION}" VERSION_GREATER 2.8.3)
cmake_policy(VERSION 2.8.4)
else()
cmake_policy(VERSION 2.6)
endif()
END
while(<>) {
if(/if\("\${CMAKE_MAJOR_VERSION}.\${CMAKE_MINOR_VERSION}" VERSION_GREATER 2.6\)/) {
while(<>) {
if(/^endif\(\)/) {
print "$replacement";
while(<>) {
print;
}
exit 0
}
}
}
print;
}
For resources that are shipped by the CGAL_Qt4 library, one need to call
CGAL_QT4_INIT_RESOURCES, a macro that calls CGAL_Qt4_init_resources
(exported by the CGAL_Qt4 DLL)
We declare
cmake_minimum_required(VERSION 2.6.2)
but we also use
cmake_policy(VERSION 2.8.4)
to declare that our CMake scripts are OK with all the defaults of CMake policies
as of CMake-2.8.4. That shuts down the warnings of CMake-2.8.4.
That way, we no longer need any declaration of specific policies.
Those two lines must be present and maintained in all our CMakeLists.txt
files (the one for the libraries, and also the one for examples and demos,
and maybe tests).
The documentation of CGAL says that the minimal version of CMake must be
CMake-2.6.2.
- change cmake_minimum_required to VERSION 2.6.2
- no longer any need for the policy CMP0003 (was for 2.4.x)
- no longer any need for CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS (was for 2.4)
| ------------------------------------------------------------------------
| r57979 | lrineau | 2010-08-11 15:24:20 +0200 (Wed, 11 Aug 2010) | 1 line
|
| Global fix of all uses of qt4_generate_moc: the destination file path must be absolute.
| ------------------------------------------------------------------------
| r58026 | stayeb | 2010-08-12 17:40:41 +0200 (Thu, 12 Aug 2010) | 2 lines
|
| Bug fix: ensure that c3t3 contains no in complex cell when starting a new refinement process. We need this because the first refinement of the surface does not update the volume, so c3t3 can't know that in complex cells have been deleted.
|
| ------------------------------------------------------------------------
(That shows it is difficult to avoid to merge the release branch in the
trunk from time to time.)
| ------------------------------------------------------------------------
| r57993 | lrineau | 2010-08-11 18:02:00 +0200 (Wed, 11 Aug 2010) | 5 lines
|
| Massive change in all .qrc files: the attribute lang= must not be used. It
| must be only used to create an alternative for another lang. If a resource
| exists only with lang=, then that resource will not be found if the locale
| had not that language.
|
| ------------------------------------------------------------------------
must be only used to create an alternative for another lang. If a resource
exists only with lang=, then that resource will not be found if the locale
had not that language.