From c4758f091a893531dcf94d7a7fd2377a32ca2058 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Fri, 24 Jun 2016 14:38:28 +0200 Subject: [PATCH] Simplify CGALConfig files: we do not need anymore to find zlib, nor opengl. --- .../cmake/modules/CGALConfig_binary.cmake.in | 55 +++++-------------- .../cmake/modules/CGALConfig_install.cmake.in | 52 ++++-------------- 2 files changed, 23 insertions(+), 84 deletions(-) diff --git a/Installation/cmake/modules/CGALConfig_binary.cmake.in b/Installation/cmake/modules/CGALConfig_binary.cmake.in index 3c29dd00d09..e0c8878a869 100644 --- a/Installation/cmake/modules/CGALConfig_binary.cmake.in +++ b/Installation/cmake/modules/CGALConfig_binary.cmake.in @@ -127,62 +127,33 @@ macro(check_cgal_component COMPONENT) if ( "${CGAL_LIB}" STREQUAL "CGAL" ) set( CGAL_FOUND TRUE ) set( CHECK_CGAL_ERROR_TAIL "" ) - else() + else( "${CGAL_LIB}" STREQUAL "CGAL" ) if ( WITH_${CGAL_LIB} ) - if(CGAL_HEADER_ONLY OR TARGET CGAL::${CGAL_LIB}) if ("${CGAL_LIB}" STREQUAL "CGAL_Qt5") - find_package(OpenGL QUIET) - find_package(Qt5 COMPONENTS OpenGL Svg QUIET) - - set(CGAL_Qt5_MISSING_DEPS "") - if(NOT Qt5OpenGL_FOUND) - set(CGAL_Qt5_MISSING_DEPS "Qt5OpenGL") - endif() - if(NOT Qt5Svg_FOUND) - set(CGAL_Qt5_MISSING_DEPS "${CGAL_Qt5_MISSING_DEPS} Qt5Svg") - endif() - if(NOT Qt5_FOUND) - set(CGAL_Qt5_MISSING_DEPS "${CGAL_Qt5_MISSING_DEPS} Qt5") - endif() - if(NOT OPENGL_FOUND) - set(CGAL_Qt5_MISSING_DEPS "${CGAL_Qt5_MISSING_DEPS} OpenGL") - endif() - - if(CGAL_Qt5_MISSING_DEPS) + find_package(Qt5Core) + if(NOT Qt5Core_FOUND) set( ${CGAL_LIB}_FOUND FALSE ) - message(STATUS "Missing the dependencies: ${CGAL_Qt5_MISSING_DEPS} cannot be configured.") + message(STATUS "Missing the dependencies: Qt5Core cannot be configured.") else() set( ${CGAL_LIB}_FOUND TRUE ) if (CGAL_HEADER_ONLY) include("${CGAL_MODULES_DIR}/Use_CGAL_Qt5_headers.cmake") endif() - endif() - else() - if ("${CGAL_LIB}" STREQUAL "CGAL_ImageIO") - find_package( OpenGL QUIET ) - find_package( ZLIB QUIET ) - - if(OPENGL_FOUND) - set( ${CGAL_LIB}_FOUND TRUE ) - else(OPENGL_FOUND) - set( ${CGAL_LIB}_FOUND FALSE ) - message(STATUS "Notice: ImageIO disabled because it requires OpenGL.") - endif(OPENGL_FOUND) - else() - # Librairies that have no dependencies - set( ${CGAL_LIB}_FOUND TRUE ) endif() - endif() - else() + else("${CGAL_LIB}" STREQUAL "CGAL_Qt5") + # Librairies that have no dependencies + set( ${CGAL_LIB}_FOUND TRUE ) + endif("${CGAL_LIB}" STREQUAL "CGAL_Qt5") + else(CGAL_HEADER_ONLY OR TARGET CGAL::${CGAL_LIB}) set( ${CGAL_LIB}_FOUND FALSE ) set( CHECK_${CGAL_LIB}_ERROR_TAIL " CGAL was configured with WITH_${CGAL_LIB}=ON, but one of the dependencies of ${CGAL_LIB} was not configured properly." ) - endif() - else() + endif(CGAL_HEADER_ONLY OR TARGET CGAL::${CGAL_LIB}) + else( WITH_${CGAL_LIB} ) set( ${CGAL_LIB}_FOUND FALSE ) set( CHECK_${CGAL_LIB}_ERROR_TAIL " Please configure CGAL using WITH_${CGAL_LIB}=ON." ) - endif() - endif() + endif( WITH_${CGAL_LIB} ) + endif( "${CGAL_LIB}" STREQUAL "CGAL" ) if ( NOT ${CGAL_LIB}_FOUND AND CHECK_CGAL_COMPONENT_MSG_ON_ERROR ) message( ${CHECK_CGAL_COMPONENT_ERROR_TYPE} "${CHECK_CGAL_COMPONENT_ERROR_TITLE} The ${CGAL_LIB} library was not configured.${CHECK_${CGAL_LIB}_ERROR_TAIL}" ) diff --git a/Installation/cmake/modules/CGALConfig_install.cmake.in b/Installation/cmake/modules/CGALConfig_install.cmake.in index 9d36a491c17..21d8c39ecb7 100644 --- a/Installation/cmake/modules/CGALConfig_install.cmake.in +++ b/Installation/cmake/modules/CGALConfig_install.cmake.in @@ -84,62 +84,30 @@ macro(check_cgal_component COMPONENT) endif() if ( WITH_${CGAL_LIB} ) - if(TARGET CGAL::${CGAL_LIB} OR CGAL_HEADER_ONLY ) - set( ${CGAL_LIB}_FOUND TRUE ) + if(CGAL_HEADER_ONLY OR TARGET CGAL::${CGAL_LIB}) if ("${CGAL_LIB}" STREQUAL "CGAL_Qt5") - find_package(OpenGL QUIET) - find_package(Qt5 COMPONENTS OpenGL Svg QUIET) - - set(CGAL_Qt5_MISSING_DEPS "") - if(NOT Qt5OpenGL_FOUND) - set(CGAL_Qt5_MISSING_DEPS "Qt5OpenGL") - endif() - if(NOT Qt5Svg_FOUND) - set(CGAL_Qt5_MISSING_DEPS "${CGAL_Qt5_MISSING_DEPS} Qt5Svg") - endif() - if(NOT Qt5_FOUND) - set(CGAL_Qt5_MISSING_DEPS "${CGAL_Qt5_MISSING_DEPS} Qt5") - endif() - if(NOT OPENGL_FOUND) - set(CGAL_Qt5_MISSING_DEPS "${CGAL_Qt5_MISSING_DEPS} OpenGL") - endif() - - if(CGAL_Qt5_MISSING_DEPS) + find_package(Qt5Core) + if(NOT Qt5Core_FOUND) set( ${CGAL_LIB}_FOUND FALSE ) - message(STATUS "Missing the dependencies: ${CGAL_Qt5_MISSING_DEPS} cannot be configured.") + message(STATUS "Missing the dependencies: Qt5Core cannot be configured.") else() set( ${CGAL_LIB}_FOUND TRUE ) if (CGAL_HEADER_ONLY) include("${CGAL_MODULES_DIR}/Use_CGAL_Qt5_headers.cmake") endif() endif() - else() - if ("${CGAL_LIB}" STREQUAL "CGAL_ImageIO") - find_package( OpenGL QUIET ) - find_package( ZLIB QUIET ) - - if(OPENGL_FOUND) - set( ${CGAL_LIB}_FOUND TRUE ) - else(OPENGL_FOUND) - set( ${CGAL_LIB}_FOUND FALSE ) - message(STATUS "Notice: ImageIO disabled because it requires OpenGL.") - endif(OPENGL_FOUND) - else() - # Librairies that have no dependencies - set( ${CGAL_LIB}_FOUND TRUE ) - endif() - else() + else("${CGAL_LIB}" STREQUAL "CGAL_Qt5") # Librairies that have no dependencies set( ${CGAL_LIB}_FOUND TRUE ) - endif() - else() + endif("${CGAL_LIB}" STREQUAL "CGAL_Qt5") + else(CGAL_HEADER_ONLY OR TARGET CGAL::${CGAL_LIB}) set( ${CGAL_LIB}_FOUND FALSE ) set( CHECK_${CGAL_LIB}_ERROR_TAIL " CGAL was configured with WITH_${CGAL_LIB}=ON, but one of the dependencies of ${CGAL_LIB} was not configured properly." ) - endif() - else() + endif(CGAL_HEADER_ONLY OR TARGET CGAL::${CGAL_LIB}) + else( WITH_${CGAL_LIB} ) set( ${CGAL_LIB}_FOUND FALSE ) set( CHECK_${CGAL_LIB}_ERROR_TAIL " Please configure CGAL using WITH_${CGAL_LIB}=ON." ) - endif() + endif( WITH_${CGAL_LIB} ) endif() if ( NOT ${CGAL_LIB}_FOUND AND CHECK_CGAL_COMPONENT_MSG_ON_ERROR )