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.
```
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.
This allows to create a CMakeLists.txt in a directory whereas the sources
are in another directory.
This will allow out-of-sources creation of CMakeLists.txt files. And, in
the end, that will improve the branch-build.
Freie Universitaet Berlin (Germany), Martin-Luther-University Halle-Wittenberg
(Germany) and RISC Linz (Austria) as they transfer the copyright to other
sites.
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)
Followup to revision 45719, which was:
"- Fix soname and soversion of libraries (they were exchanged).
- Make get_dependency_version found the print_${LIB}_version.cpp, even
if the lib is compiled separately.
- Rename FindQt3.cmake to FindQt3-patched.cmake and Qt3Macros to
Qt3Macros-patched.
- Make CGAL-Qt3 compilable separately.
- Fix all commited CMakeLists.txt:
- use Qt3-patched and Qt3Macros-patched, and s/QT_/QT3_/
- add a comment about FindQt3-patched,
- wrap target creation with if(CGAL_FOUND AND QT3_FOUND)/else/endif
- Modified cgal_create_cmake_script"
- Make get_dependency_version found the print_${LIB}_version.cpp, even
if the lib is compiled separately.
- Rename FindQt3.cmake to FindQt3-patched.cmake and Qt3Macros to
Qt3Macros-patched.
- Make CGAL-Qt3 compilable separately.
- Fix all commited CMakeLists.txt:
- use Qt3-patched and Qt3Macros-patched, and s/QT_/QT3_/
- add a comment about FindQt3-patched,
- wrap target creation with if(CGAL_FOUND AND QT3_FOUND)/else/endif
- Modified cgal_create_cmake_script