From fe24a4db68c28588daff3471b40c07c35edfe1bc Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Tue, 14 Nov 2017 14:08:55 +0100 Subject: [PATCH] Explicit the dependencies of QGLViewer --- Installation/cmake/modules/FindQGLViewer.cmake | 8 ++++++-- Installation/lib/cmake/CGAL/CGALConfig.cmake | 3 +++ Triangulation_3/demo/Triangulation_3/CMakeLists.txt | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/Installation/cmake/modules/FindQGLViewer.cmake b/Installation/cmake/modules/FindQGLViewer.cmake index e769d9e196f..0e63355b7c2 100644 --- a/Installation/cmake/modules/FindQGLViewer.cmake +++ b/Installation/cmake/modules/FindQGLViewer.cmake @@ -7,6 +7,8 @@ # QGLVIEWER_DEFINITIONS - Compiler switches required for using QGLViewer # +find_package(Qt5 QUIET COMPONENTS OpenGL Xml) + # first look in user defined locations find_path(QGLVIEWER_INCLUDE_DIR NAMES QGLViewer/qglviewer.h @@ -50,15 +52,17 @@ endif() if(QGLVIEWER_LIBRARY_RELEASE) if(QGLVIEWER_LIBRARY_DEBUG) - set(QGLVIEWER_LIBRARIES_ optimized ${QGLVIEWER_LIBRARY_RELEASE} debug ${QGLVIEWER_LIBRARY_DEBUG}) + set(QGLVIEWER_LIBRARIES_ Qt5::Xml Qt5::OpenGL optimized ${QGLVIEWER_LIBRARY_RELEASE} debug ${QGLVIEWER_LIBRARY_DEBUG}) else() - set(QGLVIEWER_LIBRARIES_ ${QGLVIEWER_LIBRARY_RELEASE}) + set(QGLVIEWER_LIBRARIES_ Qt5::Xml Qt5::OpenGL ${QGLVIEWER_LIBRARY_RELEASE}) endif() set(QGLVIEWER_LIBRARIES ${QGLVIEWER_LIBRARIES_} CACHE FILEPATH "The QGLViewer library") endif() +message("QGLViewer: ${QGLVIEWER_LIBRARIES}") + IF(QGLVIEWER_INCLUDE_DIR AND QGLVIEWER_LIBRARIES) SET(QGLVIEWER_FOUND TRUE) ENDIF(QGLVIEWER_INCLUDE_DIR AND QGLVIEWER_LIBRARIES) diff --git a/Installation/lib/cmake/CGAL/CGALConfig.cmake b/Installation/lib/cmake/CGAL/CGALConfig.cmake index 2b4a7c73132..594c3730d91 100644 --- a/Installation/lib/cmake/CGAL/CGALConfig.cmake +++ b/Installation/lib/cmake/CGAL/CGALConfig.cmake @@ -14,6 +14,8 @@ get_filename_component(CGAL_CONFIG_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) set(CGAL_HEADER_ONLY TRUE) +set( CGAL_REQUESTED_COMPONENTS ${CGAL_FIND_COMPONENTS} ) + # Save the current source directory. That variable can be changed by # a `CMakeLists.txt`, for `CMakeLists.txt` files that are created in # the binary directory. @@ -75,6 +77,7 @@ endforeach() # Define the CGAL targets and theirs CGAL:: aliases # foreach(cgal_lib CGAL CGAL_Core CGAL_ImageIO CGAL_Qt5) + set(WITH_${cgal_lib} TRUE) if(${cgal_lib}_FOUND AND NOT TARGET ${cgal_lib}) add_library(${cgal_lib} INTERFACE) if(NOT TARGET CGAL::${cgal_lib}) diff --git a/Triangulation_3/demo/Triangulation_3/CMakeLists.txt b/Triangulation_3/demo/Triangulation_3/CMakeLists.txt index a5719e96996..d3fba6b9b2a 100644 --- a/Triangulation_3/demo/Triangulation_3/CMakeLists.txt +++ b/Triangulation_3/demo/Triangulation_3/CMakeLists.txt @@ -22,7 +22,7 @@ find_package(CGAL COMPONENTS Qt5) include(${CGAL_USE_FILE}) -find_package(Qt5 QUIET COMPONENTS Xml OpenGL Svg) +find_package(Qt5 QUIET COMPONENTS OpenGL) find_package(OpenGL)