From fe68498e9521ca4e1cc52ea10ac64024569ce35c Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Tue, 19 Sep 2023 14:59:11 +0200 Subject: [PATCH] CGALConfig.cmake remove the early return() Otherwise we have a lot of warnings like: ``` CMake Warning at /usr/lib64/cmake/Qt6/QtPublicWalkLibsHelpers.cmake:284 (message): When trying to collect dependencies of target 'Constrained_Delaunay_triangulation_2', the non-existent target 'Qt6::Svg' was encountered. This can likely be fixed by moving the find_package call that pulls in 'Qt6::Svg' to the scope of directory '/home/lrineau/Git/cgal-testsuite-dockerfiles/testsuite/CGAL-6.0-Ic-66/test/Triangulation_2_Demo' or higher. This warning can be silenced by setting QT_SILENCE_MISSING_DEPENDENCY_TARGET_WARNING to ON. Call Stack (most recent call first): /usr/lib64/cmake/Qt6/QtPublicWalkLibsHelpers.cmake:320 (__qt_internal_print_missing_dependency_target_warning) /usr/lib64/cmake/Qt6Core/Qt6CoreMacros.cmake:609 (__qt_internal_collect_all_target_dependencies) /usr/lib64/cmake/Qt6Core/Qt6CoreMacros.cmake:709 (_qt_internal_finalize_executable) /usr/lib64/cmake/Qt6Core/Qt6CoreMacros.cmake:564:EVAL:1 (qt6_finalize_target) test/Triangulation_2_Demo/CMakeLists.txt:DEFERRED ``` The issue was that `find_package(Qt6) ...` is required in any sub-directory, because imported targets like `Qt6::Svg` are local to the directory scope. --- Installation/lib/cmake/CGAL/CGALConfig.cmake | 5 ----- 1 file changed, 5 deletions(-) diff --git a/Installation/lib/cmake/CGAL/CGALConfig.cmake b/Installation/lib/cmake/CGAL/CGALConfig.cmake index 7b3f2c419cb..93e9e8830f0 100644 --- a/Installation/lib/cmake/CGAL/CGALConfig.cmake +++ b/Installation/lib/cmake/CGAL/CGALConfig.cmake @@ -146,11 +146,6 @@ foreach(cgal_lib ${CGAL_LIBRARIES}) set(CGALConfig_all_targets_are_defined FALSE) endif() endforeach() -if(CGALConfig_all_targets_are_defined) - return() -endif() - -message(STATUS "Using header-only CGAL") if(NOT CGAL_FOUND) return()