diff --git a/Installation/cmake/modules/CGALConfig_binary.cmake.in b/Installation/cmake/modules/CGALConfig_binary.cmake.in index 7c817e6a7f0..82a09e52b18 100644 --- a/Installation/cmake/modules/CGALConfig_binary.cmake.in +++ b/Installation/cmake/modules/CGALConfig_binary.cmake.in @@ -130,30 +130,16 @@ macro(check_cgal_component COMPONENT) set( CHECK_CGAL_ERROR_TAIL "" ) else( "${CGAL_LIB}" STREQUAL "CGAL" ) if ( WITH_${CGAL_LIB} ) - if(CGAL_HEADER_ONLY OR TARGET CGAL::${CGAL_LIB}) + if(TARGET CGAL::${CGAL_LIB}) if ("${CGAL_LIB}" STREQUAL "CGAL_Qt5") - find_package(Qt5 QUIET COMPONENTS OpenGL Svg) - find_package(OpenGL 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() + + include("${CGAL_MODULES_DIR}/CGAL_SetupCGAL_Qt5Dependencies.cmake") if(CGAL_Qt5_MISSING_DEPS) - set( ${CGAL_LIB}_FOUND FALSE ) + set( CGAL_Qt5_FOUND FALSE ) message(STATUS "libCGAL_Qt5 is missing the dependencies: ${CGAL_Qt5_MISSING_DEPS} cannot be configured.") else() - set( ${CGAL_LIB}_FOUND TRUE ) + set( CGAL_Qt5_FOUND TRUE ) if (CGAL_HEADER_ONLY) include("${CGAL_MODULES_DIR}/Use_CGAL_Qt5_headers.cmake") endif() @@ -162,10 +148,10 @@ macro(check_cgal_component COMPONENT) # 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}) + else(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(CGAL_HEADER_ONLY OR TARGET CGAL::${CGAL_LIB}) + endif(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." ) diff --git a/Installation/cmake/modules/CGALConfig_install.cmake.in b/Installation/cmake/modules/CGALConfig_install.cmake.in index ea644ba9ade..a58321637a7 100644 --- a/Installation/cmake/modules/CGALConfig_install.cmake.in +++ b/Installation/cmake/modules/CGALConfig_install.cmake.in @@ -91,30 +91,16 @@ macro(check_cgal_component COMPONENT) endif() if ( WITH_${CGAL_LIB} ) - if(CGAL_HEADER_ONLY OR TARGET CGAL::${CGAL_LIB}) + if(TARGET CGAL::${CGAL_LIB}) if ("${CGAL_LIB}" STREQUAL "CGAL_Qt5") - find_package(Qt5 QUIET COMPONENTS OpenGL Svg) - find_package(OpenGL 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() + + include("${CGAL_MODULES_DIR}/CGAL_SetupCGAL_Qt5Dependencies.cmake") if(CGAL_Qt5_MISSING_DEPS) - set( ${CGAL_LIB}_FOUND FALSE ) + set( CGAL_Qt5_FOUND FALSE ) message(STATUS "libCGAL_Qt5 is missing the dependencies: ${CGAL_Qt5_MISSING_DEPS} cannot be configured.") else() - set( ${CGAL_LIB}_FOUND TRUE ) + set( CGAL_Qt5_FOUND TRUE ) if (CGAL_HEADER_ONLY) include("${CGAL_MODULES_DIR}/Use_CGAL_Qt5_headers.cmake") endif() @@ -123,10 +109,10 @@ macro(check_cgal_component COMPONENT) # 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}) + else(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(CGAL_HEADER_ONLY OR TARGET CGAL::${CGAL_LIB}) + endif(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." )