Fix CGAL_Qt5 installation

This commit is contained in:
Maxime Gimeno 2020-10-14 11:14:58 +02:00
parent fcb6419106
commit 0c14520987
2 changed files with 9 additions and 22 deletions

View File

@ -667,33 +667,20 @@ cache_get(CGAL_3RD_PARTY_LIBRARIES )
cache_get(CGAL_3RD_PARTY_LIBRARIES_DIRS) cache_get(CGAL_3RD_PARTY_LIBRARIES_DIRS)
#add_subdirectory(src) #add_subdirectory(src)
message("Configuring libCGAL_Qt5")
if(NOT POLICY CMP0070 AND POLICY CMP0053) if(NOT POLICY CMP0070 AND POLICY CMP0053)
# Only set CMP0053 to OLD with CMake<3.10, otherwise there is a warning. # Only set CMP0053 to OLD with CMake<3.10, otherwise there is a warning.
cmake_policy(SET CMP0053 OLD) cmake_policy(SET CMP0053 OLD)
endif() endif()
include(CGAL_SetupCGAL_Qt5Dependencies) find_package(Qt5 QUIET COMPONENTS OpenGL Svg Xml)
if(NOT Qt5_FOUND)
if(CGAL_Qt5_MISSING_DEPS) message("CGAL_Qt5 needs Qt5 and won't be configured.")
message(STATUS "libCGAL_Qt5 is missing the dependencies: ${CGAL_Qt5_MISSING_DEPS} cannot be configured.") else()#NOT Qt5_FOUND
else()
message( STATUS "USING Qt5_VERSION = '${Qt5Core_VERSION_STRING}'" ) message( STATUS "USING Qt5_VERSION = '${Qt5Core_VERSION_STRING}'" )
CGAL_setup_CGAL_Qt5_dependencies( CGAL_Qt5 ) install(DIRECTORY "${CGAL_GRAPHICSVIEW_PACKAGE_DIR}/include/CGAL/Qt/" DESTINATION "${CGAL_INSTALL_INC_DIR}/CGAL/Qt" COMPONENT CGAL_Qt5)
install(DIRECTORY "${CGAL_GRAPHICSVIEW_PACKAGE_DIR}/demo/resources/" DESTINATION "${CGAL_INSTALL_CMAKE_DIR}/demo/resources" COMPONENT CGAL_Qt5)
if(COMMAND add_config_flag) install(DIRECTORY "${CGAL_GRAPHICSVIEW_PACKAGE_DIR}/demo/icons/" DESTINATION "${CGAL_INSTALL_CMAKE_DIR}/demo/icons" COMPONENT CGAL_Qt5)
set( CGAL_HAS_QT5 TRUE ) endif()#NOT Qt5_FOUND
add_config_flag( CGAL_HAS_QT5 )
endif()
install(DIRECTORY " ${CGAL_GRAPHICSVIEW_PACKAGE_DIR}/include/CGAL/Qt/" DESTINATION "${CGAL_INSTALL_INC_DIR}/CGAL/Qt" COMPONENT CGAL_Qt5)
install(DIRECTORY " ${CGAL_GRAPHICSVIEW_PACKAGE_DIR}/demo/resources/" DESTINATION "${CGAL_INSTALL_CMAKE_DIR}/demo/resources" COMPONENT CGAL_Qt5)
install(DIRECTORY " ${CGAL_GRAPHICSVIEW_PACKAGE_DIR}/demo/icons/" DESTINATION "${CGAL_INSTALL_CMAKE_DIR}/demo/icons" COMPONENT CGAL_Qt5)
message("libCGAL_Qt5 is configured")
endif()
# #

View File

@ -131,7 +131,7 @@ include(CGAL_setup_target_dependencies)
# Define the CGAL targets and their CGAL:: aliases # Define the CGAL targets and their CGAL:: aliases
# #
foreach(cgal_lib ${CGAL_LIBRARIES}) foreach(cgal_lib ${CGAL_LIBRARIES})
set(WITH_${cgal_lib} TRUE)
if(${cgal_lib}_FOUND AND NOT TARGET ${cgal_lib}) if(${cgal_lib}_FOUND AND NOT TARGET ${cgal_lib})
add_library(${cgal_lib} INTERFACE IMPORTED GLOBAL) add_library(${cgal_lib} INTERFACE IMPORTED GLOBAL)
if(NOT TARGET CGAL::${cgal_lib}) if(NOT TARGET CGAL::${cgal_lib})