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;
}
is not available.
*Add default empty struct for Get_arithmetic_kernel. That way we can test if
a specialization is avaible. I used it for the default case of Root_of_traits.
When a number type not known by CGAL is used to instanciate Root_of_traits,
the field type used to instanciate Sqrt_extension is made using Quotient.
*Patch of Lazy_exact_nt constructor from another Lazy_exact_nt type.
In revision 61559, that constructor was retricted to the case the exact type
is implicitely constructed from the other exact type. Now the old behavior is
back but only if it is explicitely called (patch from Marc Glisse).
*Update To_double specialization of Sqrt_extension to use the same formula
than To_interval so that the double value is contained in the interval.
*update root_of_2 test-suite to use Sqrt_extension and that they behave
similarly
move Get_arithmetic_kernel specialization into MP_Float.h
reorder declaration of to_double(Sqrt_extension<MP_Float>)
Sqrt_extension need specialization of Real_embeddable_traits
and Algebraic_structure_traits.
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)
by namespace CGAL { and } //namespace CGAL. in all .h and .cpp files
in a directory.
Apply it to all packages in the trunk
Remove macro definition from the config.h file.