From bdd7988a4aa560cd64b90cc247d3bebf78600a29 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Tue, 27 May 2025 13:02:04 +0200 Subject: [PATCH] remove CMake warnings about CMP0167 The issue was when VTK/ITK was searched. The variable `CMAKE_POLICY_DEFAULT_CMP0167` can be used to workaround that. --- BGL/test/BGL/CMakeLists.txt | 1 + Installation/CMakeLists.txt | 1 + Isosurfacing_3/examples/Isosurfacing_3/CMakeLists.txt | 1 + Lab/demo/Lab/Plugins/IO/CMakeLists.txt | 1 + Lab/demo/Lab/Plugins/Mesh_3/CMakeLists.txt | 1 + Mesh_3/examples/Mesh_3/CMakeLists.txt | 2 ++ 6 files changed, 7 insertions(+) diff --git a/BGL/test/BGL/CMakeLists.txt b/BGL/test/BGL/CMakeLists.txt index bc18562bb6e..016e0009d4f 100644 --- a/BGL/test/BGL/CMakeLists.txt +++ b/BGL/test/BGL/CMakeLists.txt @@ -63,6 +63,7 @@ else() message(STATUS "NOTICE: Tests that use OpenMesh will not be compiled.") endif() +set(CMAKE_POLICY_DEFAULT_CMP0167 NEW) find_package(VTK 9.0 QUIET COMPONENTS CommonCore IOCore IOLegacy IOXML FiltersCore FiltersSources) if (VTK_FOUND AND VTK_LIBRARIES) message(STATUS "VTK ${VTK_VERSION} found ${VTK_LIBRARIES}") diff --git a/Installation/CMakeLists.txt b/Installation/CMakeLists.txt index 0cdd9edf184..2aba88233d3 100644 --- a/Installation/CMakeLists.txt +++ b/Installation/CMakeLists.txt @@ -949,6 +949,7 @@ if(CGAL_BRANCH_BUILD) find_package(Doxygen REQUIRED) find_package(Eigen3 REQUIRED) find_package(Qt6 COMPONENTS Core Widgets OpenGL Gui REQUIRED) + set(CMAKE_POLICY_DEFAULT_CMP0167 NEW) find_package(VTK COMPONENTS ImagingGeneral IOImage NO_MODULE) if(VTK_FOUND) get_target_property(VTK_INCLUDE_DIRS VTK::IOImage INTERFACE_INCLUDE_DIRECTORIES) diff --git a/Isosurfacing_3/examples/Isosurfacing_3/CMakeLists.txt b/Isosurfacing_3/examples/Isosurfacing_3/CMakeLists.txt index bd42e9ca7b2..33d73873145 100644 --- a/Isosurfacing_3/examples/Isosurfacing_3/CMakeLists.txt +++ b/Isosurfacing_3/examples/Isosurfacing_3/CMakeLists.txt @@ -12,6 +12,7 @@ include(CGAL_Eigen3_support) find_package(TBB QUIET) include(CGAL_TBB_support) +set(CMAKE_POLICY_DEFAULT_CMP0167 NEW) find_package(VTK QUIET COMPONENTS vtkImagingGeneral vtkIOImage vtkIOXML vtkIOMINC vtkIOLegacy NO_MODULE) if(VTK_FOUND) message(STATUS "VTK was found") diff --git a/Lab/demo/Lab/Plugins/IO/CMakeLists.txt b/Lab/demo/Lab/Plugins/IO/CMakeLists.txt index 71498737a77..dbdad76da22 100644 --- a/Lab/demo/Lab/Plugins/IO/CMakeLists.txt +++ b/Lab/demo/Lab/Plugins/IO/CMakeLists.txt @@ -57,6 +57,7 @@ else() message(STATUS "NOTICE: the OM IO plugin needs OpenMesh libraries and will not be compiled.") endif() +set(CMAKE_POLICY_DEFAULT_CMP0167 NEW) find_package(VTK 9.0 QUIET COMPONENTS CommonCore IOCore IOLegacy IOXML FiltersCore FiltersSources) set_package_properties( VTK PROPERTIES diff --git a/Lab/demo/Lab/Plugins/Mesh_3/CMakeLists.txt b/Lab/demo/Lab/Plugins/Mesh_3/CMakeLists.txt index cf7b5571528..3c344555147 100644 --- a/Lab/demo/Lab/Plugins/Mesh_3/CMakeLists.txt +++ b/Lab/demo/Lab/Plugins/Mesh_3/CMakeLists.txt @@ -31,6 +31,7 @@ target_link_libraries( target_include_directories(mesh_3_plugin PRIVATE include) CGAL_Lab_target_use_c3t3_type(mesh_3_plugin) +set(CMAKE_POLICY_DEFAULT_CMP0167 NEW) find_package(ITK NAMES ITK InsightToolkit QUIET COMPONENTS ITKCommon ITKThresholding ITKSmoothing ITKImageIntensity) if(ITK_FOUND) diff --git a/Mesh_3/examples/Mesh_3/CMakeLists.txt b/Mesh_3/examples/Mesh_3/CMakeLists.txt index a1e2e345e97..3a36d74eb05 100644 --- a/Mesh_3/examples/Mesh_3/CMakeLists.txt +++ b/Mesh_3/examples/Mesh_3/CMakeLists.txt @@ -26,6 +26,7 @@ if(NOT TARGET CGAL::Eigen3_support) return() endif() +set(CMAKE_POLICY_DEFAULT_CMP0167 NEW) find_package(VTK 9.0 COMPONENTS ImagingGeneral IOImage QUIET) @@ -170,6 +171,7 @@ if(TARGET CGAL::CGAL_ImageIO) target_link_libraries(mesh_3D_image_variable_size PRIVATE CGAL::Eigen3_support) + set(CMAKE_POLICY_DEFAULT_CMP0167 NEW) find_package(ITK NAMES ITK InsightToolkit QUIET COMPONENTS ITKCommon ITKThresholding ITKSmoothing ITKImageIntensity) if(ITK_FOUND)