That will suppress the warnings about `CMP0167` (from CMake 3.30):
```
CMake Warning (dev) at cmake/modules/display-third-party-libs-versions.cmake:37 (find_package):
Policy CMP0167 is not set: The FindBoost module is removed. Run "cmake
--help-policy CMP0167" for policy details. Use the cmake_policy command to
set the policy and suppress this warning.
```
- only search for Boost if extra Boost components are required,
- do not test `Boost_FOUND` (because Boost is `REQUIRED` in
`find_package`),
- use Boost imported targets instead of variable (compatibility with
Boost-1.70 CMake config mode)
As CGAL is `REQUIRED` in `find_package`, no test of `CGAL_FOUND` can
be done, if `CGAL_FOUND` is not `TRUE`, then CMake stops with a hard
error at the line `find_package(CGAL REQUIRED ...)`.
The file `${CGAL_USE_FILE}` must be included before
`find_package(LEDA)` can be called. But that would require to verify
`CGAL_FOUND` first...
Actually, now that we require at least CMake 3.1, let's say that CGAL
is `REQUIRED`, but not the components. That is the basic truth, and
that avoids testing for `CGAL_FOUND`.
At the same time, I have modified the `cmake_minimum_required`:
- placed as the first line,
- set to `3.1...3.13`:
https://cmake.org/cmake/help/latest/command/cmake_policy.html#setting-policies-by-cmake-version
I have also removed the comments that says the `CMakeLists.txt` was
generated. That may have been true... but before a lot of modifications.
Save the current source directory to `CGAL_CURRENT_SOURCE_DIR`. The
variable value is modified by a `CMakeLists.txt` file when it is
generated by `cgal_create_cmake_script` in the binary tree. The script
`cgal_create_cmake_script` itself it called by CMake, by the function
`process_CGAL_subdirectory` (see its definition in
`Installation/cmake/modules/CGAL_Macros.cmake`), called in
`(examples|test|demo)/CMakeLists.txt`.
Eventually, that variable value is supposed to be the directory to the
current sources, even if the current `CMakeLists.txt` is within the
binary tree.
That is used in `CGAL_CreateSingleSourceCGALProgram.cmake` for the CTest
support, so set correctly the current working directory (in the
directory of the tests/examples).
Rationale: cgal_create_CMakeLists and related scripts used to not
consider files ending on anything else than .cpp or .C as C++ sources.
This patch allows for the list of extensions considered as C++ source
files as stated in the g++ man page.
Taucs, Lapack and Blas supports are no longer tested
Approved by the Release Manager
Tested in CGAL-4.5-Ic-97
Conflicts:
Polyhedron/demo/Polyhedron/CMakeLists.txt