mirror of https://github.com/CGAL/cgal
WIP CGAL_qt5
This commit is contained in:
parent
654c99484c
commit
fcb6419106
|
|
@ -357,7 +357,6 @@ set( CGAL_Qt5_SOVERSION "14.0.0" )
|
|||
|
||||
message( STATUS "CGAL_SONAME_VERSION=${CGAL_SONAME_VERSION}" )
|
||||
message( STATUS "CGAL_SOVERSION =${CGAL_SOVERSION}" )
|
||||
set( CGAL_BUILDING_LIBS TRUE )
|
||||
|
||||
set( CGAL_VERSION_DIR CGAL-${CGAL_VERSION} )
|
||||
set( CGAL_MODULES_REL_DIR cmake/modules )
|
||||
|
|
@ -667,7 +666,35 @@ cache_get(CGAL_3RD_PARTY_INCLUDE_DIRS )
|
|||
cache_get(CGAL_3RD_PARTY_LIBRARIES )
|
||||
cache_get(CGAL_3RD_PARTY_LIBRARIES_DIRS)
|
||||
|
||||
add_subdirectory(src)
|
||||
#add_subdirectory(src)
|
||||
message("Configuring libCGAL_Qt5")
|
||||
|
||||
if(NOT POLICY CMP0070 AND POLICY CMP0053)
|
||||
# Only set CMP0053 to OLD with CMake<3.10, otherwise there is a warning.
|
||||
cmake_policy(SET CMP0053 OLD)
|
||||
endif()
|
||||
|
||||
include(CGAL_SetupCGAL_Qt5Dependencies)
|
||||
|
||||
if(CGAL_Qt5_MISSING_DEPS)
|
||||
message(STATUS "libCGAL_Qt5 is missing the dependencies: ${CGAL_Qt5_MISSING_DEPS} cannot be configured.")
|
||||
else()
|
||||
|
||||
message( STATUS "USING Qt5_VERSION = '${Qt5Core_VERSION_STRING}'" )
|
||||
CGAL_setup_CGAL_Qt5_dependencies( CGAL_Qt5 )
|
||||
|
||||
if(COMMAND add_config_flag)
|
||||
set( CGAL_HAS_QT5 TRUE )
|
||||
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()
|
||||
|
||||
|
||||
#
|
||||
# Variables used when WITH_{demos|examples|tests} are TRUE
|
||||
|
|
|
|||
|
|
@ -24,17 +24,6 @@ if( NOT CGAL_COMMON_FILE_INCLUDED )
|
|||
set( CMAKE_2_6_3_OR_ABOVE FALSE )
|
||||
endif()
|
||||
|
||||
if ( CGAL_BUILDING_LIBS )
|
||||
option(BUILD_SHARED_LIBS "Build shared libraries" ON)
|
||||
set(CGAL_BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS})
|
||||
|
||||
if ( BUILD_SHARED_LIBS )
|
||||
message( STATUS "Building shared libraries" )
|
||||
else()
|
||||
message( STATUS "Building static libraries" )
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if ( WIN32 )
|
||||
find_program(CMAKE_UNAME uname /bin /usr/bin /usr/local/bin )
|
||||
if(CMAKE_UNAME)
|
||||
|
|
|
|||
|
|
@ -290,10 +290,9 @@ if( NOT CGAL_MACROS_FILE_INCLUDED )
|
|||
|
||||
# To deal with imported targets of Qt5 and Boost, when CGAL
|
||||
# targets are themselves imported by another project.
|
||||
if(NOT CGAL_BUILDING_LIBS)
|
||||
if (${component} STREQUAL "Qt5")
|
||||
find_package(Qt5 COMPONENTS OpenGL Gui Core Script ScriptTools QUIET)
|
||||
endif()
|
||||
|
||||
if (${component} STREQUAL "Qt5")
|
||||
find_package(Qt5 COMPONENTS OpenGL Gui Core Script ScriptTools QUIET)
|
||||
endif()
|
||||
|
||||
else(WITH_CGAL_${component})
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ if(NOT CGAL_Qt5_MISSING_DEPS)
|
|||
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/CGAL_Qt5_moc_and_resource_files.cmake)
|
||||
|
||||
if((WITH_demos OR WITH_examples OR WITH_tests OR NOT CGAL_BUILDING_LIBS) AND NOT TARGET CGAL_Qt5_moc_and_resources)
|
||||
if(NOT TARGET CGAL_Qt5_moc_and_resources)
|
||||
add_library(CGAL_Qt5_moc_and_resources STATIC
|
||||
${_CGAL_Qt5_MOC_FILES_private}
|
||||
${CGAL_GRAPHICSVIEW_PACKAGE_DIR}/include/CGAL/Qt/GraphicsViewNavigation.h
|
||||
|
|
|
|||
|
|
@ -6,12 +6,12 @@ if ( NOT CGAL_SETUP_FLAGS_INCLUDED )
|
|||
# override the flags used to build the libraries
|
||||
#
|
||||
set( CGAL_DONT_OVERRIDE_CMAKE_FLAGS_DESCRIPTION
|
||||
"Set this to TRUE if you want to define or modify any of CMAKE_*_FLAGS. When this is FALSE, all the CMAKE_*_FLAGS flags are overriden with the values used when building the CGAL libs. For CGAL_*_flags (used for ADDITIONAL flags) , there is no need to set this to TRUE."
|
||||
"Set this to TRUE if you want to define or modify any of CMAKE_*_FLAGS. When this is FALSE, all the CMAKE_*_FLAGS flags are overriden with the values used when building the CGAL libs. For CGAL_*_flags (used for ADDITIONAL flags) , there is no need to set this to TRUE."
|
||||
)
|
||||
|
||||
option( CGAL_DONT_OVERRIDE_CMAKE_FLAGS
|
||||
option( CGAL_DONT_OVERRIDE_CMAKE_FLAGS
|
||||
${CGAL_DONT_OVERRIDE_CMAKE_FLAGS_DESCRIPTION}
|
||||
FALSE
|
||||
FALSE
|
||||
)
|
||||
|
||||
if ( CGAL_CONFIG_LOADED AND NOT CGAL_DONT_OVERRIDE_CMAKE_FLAGS )
|
||||
|
|
@ -19,18 +19,14 @@ if ( CGAL_CONFIG_LOADED AND NOT CGAL_DONT_OVERRIDE_CMAKE_FLAGS )
|
|||
typed_cache_set ( STRING "Build type: Release, Debug, RelWithDebInfo or MinSizeRel" CMAKE_BUILD_TYPE "${CGAL_BUILD_TYPE_INIT}" )
|
||||
|
||||
string( TOUPPER "${CMAKE_BUILD_TYPE}" CGAL_BUILD_TYPE_UPPER )
|
||||
|
||||
if ( CGAL_BUILD_SHARED_LIBS )
|
||||
set( CGAL_LINKER_FLAGS_TYPE SHARED )
|
||||
else()
|
||||
set( CGAL_LINKER_FLAGS_TYPE MODULE )
|
||||
endif()
|
||||
|
||||
|
||||
set( CGAL_LINKER_FLAGS_TYPE MODULE )
|
||||
|
||||
typed_cache_set ( STRING "C++ compiler flags for all build types" CMAKE_CXX_FLAGS "${CGAL_CXX_FLAGS_INIT}" )
|
||||
typed_cache_set ( STRING "C++ compiler flags for ${CGAL_BUILD_TYPE_UPPER}" CMAKE_CXX_FLAGS_${CGAL_BUILD_TYPE_UPPER} "${CGAL_CXX_FLAGS_${CGAL_BUILD_TYPE_UPPER}_INIT}" )
|
||||
typed_cache_set ( STRING "Linker flags for all build types" CMAKE_EXE_LINKER_FLAGS "${CGAL_${CGAL_LINKER_FLAGS_TYPE}_LINKER_FLAGS_INIT}" )
|
||||
typed_cache_set ( STRING "Linker flags for ${CGAL_BUILD_TYPE_UPPER}" CMAKE_EXE_LINKER_FLAGS_${CGAL_BUILD_TYPE_UPPER} "${CGAL_${CGAL_LINKER_FLAGS_TYPE}_LINKER_FLAGS_${CGAL_BUILD_TYPE_UPPER}_INIT}" )
|
||||
|
||||
|
||||
endif()
|
||||
|
||||
typed_cache_set( BOOL ${CGAL_DONT_OVERRIDE_CMAKE_FLAGS_DESCRIPTION} CGAL_DONT_OVERRIDE_CMAKE_FLAGS TRUE )
|
||||
|
|
@ -68,15 +64,7 @@ string( TOUPPER "${CMAKE_BUILD_TYPE}" CGAL_BUILD_TYPE_UPPER )
|
|||
|
||||
message( STATUS "USING CXXFLAGS = '${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_${CGAL_BUILD_TYPE_UPPER}}'" )
|
||||
|
||||
if ( CGAL_BUILDING_LIBS )
|
||||
if ( BUILD_SHARED_LIBS )
|
||||
message( STATUS "USING LDFLAGS = '${CMAKE_SHARED_LINKER_FLAGS} ${CMAKE_SHARED_LINKER_FLAGS_${CGAL_BUILD_TYPE_UPPER}}'" )
|
||||
else()
|
||||
message( STATUS "USING LDFLAGS = '${CMAKE_STATIC_LINKER_FLAGS} ${CMAKE_STATIC_LINKER_FLAGS_${CGAL_BUILD_TYPE_UPPER}}'" )
|
||||
endif()
|
||||
else()
|
||||
message( STATUS "USING EXEFLAGS = '${CMAKE_EXE_LINKER_FLAGS} ${CMAKE_EXE_LINKER_FLAGS_${CGAL_BUILD_TYPE_UPPER}}'" )
|
||||
endif()
|
||||
message( STATUS "USING EXEFLAGS = '${CMAKE_EXE_LINKER_FLAGS} ${CMAKE_EXE_LINKER_FLAGS_${CGAL_BUILD_TYPE_UPPER}}'" )
|
||||
|
||||
endif()
|
||||
|
||||
|
|
|
|||
|
|
@ -10,12 +10,4 @@ string( TOUPPER "${CMAKE_BUILD_TYPE}" CGAL_BUILD_TYPE_UPPER )
|
|||
|
||||
message( STATUS "USING CXXFLAGS = '${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_${CGAL_BUILD_TYPE_UPPER}}'" )
|
||||
|
||||
if ( CGAL_BUILDING_LIBS )
|
||||
if ( BUILD_SHARED_LIBS )
|
||||
message( STATUS "USING LDFLAGS = '${CMAKE_SHARED_LINKER_FLAGS} ${CMAKE_SHARED_LINKER_FLAGS_${CGAL_BUILD_TYPE_UPPER}}'" )
|
||||
else()
|
||||
message( STATUS "USING LDFLAGS = '${CMAKE_STATIC_LINKER_FLAGS} ${CMAKE_STATIC_LINKER_FLAGS_${CGAL_BUILD_TYPE_UPPER}}'" )
|
||||
endif()
|
||||
else()
|
||||
message( STATUS "USING EXEFLAGS = '${CMAKE_EXE_LINKER_FLAGS} ${CMAKE_EXE_LINKER_FLAGS_${CGAL_BUILD_TYPE_UPPER}}'" )
|
||||
endif()
|
||||
message( STATUS "USING EXEFLAGS = '${CMAKE_EXE_LINKER_FLAGS} ${CMAKE_EXE_LINKER_FLAGS_${CGAL_BUILD_TYPE_UPPER}}'" )
|
||||
|
|
|
|||
|
|
@ -18,10 +18,8 @@ endif()
|
|||
|
||||
list( SORT list )
|
||||
|
||||
if(NOT CGAL_BUILDING_LIBS)
|
||||
find_package(CGAL REQUIRED)
|
||||
include(${CGAL_MODULES_DIR}/CGAL_Macros.cmake)
|
||||
endif()
|
||||
find_package(CGAL REQUIRED)
|
||||
include(${CGAL_MODULES_DIR}/CGAL_Macros.cmake)
|
||||
|
||||
message("== Generating build files for demos ==")
|
||||
foreach( entry ${list} )
|
||||
|
|
|
|||
|
|
@ -18,10 +18,8 @@ endif()
|
|||
|
||||
list( SORT list )
|
||||
|
||||
if(NOT CGAL_BUILDING_LIBS)
|
||||
find_package(CGAL REQUIRED)
|
||||
include(${CGAL_MODULES_DIR}/CGAL_Macros.cmake)
|
||||
endif()
|
||||
find_package(CGAL REQUIRED)
|
||||
include(${CGAL_MODULES_DIR}/CGAL_Macros.cmake)
|
||||
|
||||
message("== Generating build files for examples ==")
|
||||
foreach( entry ${list} )
|
||||
|
|
|
|||
|
|
@ -80,14 +80,11 @@ include(${CGAL_MODULES_DIR}/CGAL_TweakFindBoost.cmake)
|
|||
set(CGAL_USE_FILE ${CGAL_MODULES_DIR}/UseCGAL.cmake)
|
||||
|
||||
|
||||
if(CGAL_BUILDING_LIBS)
|
||||
foreach(comp ${CGAL_FIND_COMPONENTS})
|
||||
if(CGAL_${comp}_FOUND)
|
||||
list(APPEND CGAL_LIBRARIES CGAL_${comp})
|
||||
endif()
|
||||
endforeach()
|
||||
return()
|
||||
endif()
|
||||
foreach(comp ${CGAL_FIND_COMPONENTS})
|
||||
if(CGAL_${comp}_FOUND)
|
||||
list(APPEND CGAL_LIBRARIES CGAL_${comp})
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
foreach(comp ${CGAL_FIND_COMPONENTS})
|
||||
if(NOT comp MATCHES "Core|ImageIO|Qt5")
|
||||
|
|
@ -136,11 +133,7 @@ include(CGAL_setup_target_dependencies)
|
|||
foreach(cgal_lib ${CGAL_LIBRARIES})
|
||||
set(WITH_${cgal_lib} TRUE)
|
||||
if(${cgal_lib}_FOUND AND NOT TARGET ${cgal_lib})
|
||||
if(CGAL_BUILDING_LIBS OR CMAKE_VERSION VERSION_LESS "3.11")
|
||||
add_library(${cgal_lib} INTERFACE)
|
||||
else()
|
||||
add_library(${cgal_lib} INTERFACE IMPORTED GLOBAL)
|
||||
endif()
|
||||
add_library(${cgal_lib} INTERFACE IMPORTED GLOBAL)
|
||||
if(NOT TARGET CGAL::${cgal_lib})
|
||||
add_library(CGAL::${cgal_lib} ALIAS ${cgal_lib})
|
||||
endif()
|
||||
|
|
|
|||
|
|
@ -1,19 +1,10 @@
|
|||
function (collect_cgal_library LIBRARY_NAME ADDITIONAL_FILES)
|
||||
if(CGAL_BUILD_SHARED_LIBS)
|
||||
set(CGAL_LIB_PREFIX "")
|
||||
else()
|
||||
set(CGAL_LIB_PREFIX "lib")
|
||||
endif()
|
||||
set(CGAL_LIB_PREFIX "lib")
|
||||
|
||||
set(RELEASE_MANGLED_NAME "${CGAL_LIB_PREFIX}${LIBRARY_NAME}-${CGAL_TOOLSET}-mt-${CGAL_FULL_VERSION}" )
|
||||
set(DEBUG_MANGLED_NAME "${CGAL_LIB_PREFIX}${LIBRARY_NAME}-${CGAL_TOOLSET}-mt-gd-${CGAL_FULL_VERSION}" )
|
||||
|
||||
if(CGAL_BUILD_SHARED_LIBS AND WIN32)
|
||||
configure_file(${CGAL_INSTALLATION_PACKAGE_DIR}/src/CGAL_libs_verinfo.rc.in ${LIBRARY_NAME}_verinfo.rc @ONLY)
|
||||
set(rc_file ${CMAKE_CURRENT_BINARY_DIR}/${LIBRARY_NAME}_verinfo.rc)
|
||||
else()
|
||||
set(rc_file )
|
||||
endif()
|
||||
set(rc_file )
|
||||
|
||||
add_library(${LIBRARY_NAME} INTERFACE)
|
||||
|
||||
|
|
|
|||
|
|
@ -18,10 +18,8 @@ endif()
|
|||
|
||||
list( SORT list )
|
||||
|
||||
if(NOT CGAL_BUILDING_LIBS)
|
||||
find_package(CGAL REQUIRED)
|
||||
include(${CGAL_MODULES_DIR}/CGAL_Macros.cmake)
|
||||
endif()
|
||||
find_package(CGAL REQUIRED)
|
||||
include(${CGAL_MODULES_DIR}/CGAL_Macros.cmake)
|
||||
|
||||
message("== Generating build files for tests ==")
|
||||
foreach( entry ${list} )
|
||||
|
|
|
|||
|
|
@ -27,8 +27,8 @@ macro(create_link_to_program COMPONENT )
|
|||
add_to_cached_list( CGAL_EXECUTABLE_TARGETS link_to_${COMPONENT} )
|
||||
|
||||
endmacro()
|
||||
|
||||
find_package(CGAL QUIET COMPONENTS Core)
|
||||
find_package(Qt5 QUIET)
|
||||
find_package(CGAL QUIET COMPONENTS Core Qt5)
|
||||
|
||||
if ( CGAL_FOUND )
|
||||
|
||||
|
|
@ -56,27 +56,17 @@ if ( CGAL_FOUND )
|
|||
|
||||
create_link_to_program(CGAL)
|
||||
|
||||
if ( WITH_CGAL_Core )
|
||||
if ( TARGET CGAL::CGAL_Core )
|
||||
create_link_to_program(CGAL_Core)
|
||||
endif()
|
||||
|
||||
if ( WITH_CGAL_ImageIO )
|
||||
if ( TARGET CGAL::CGAL_ImageIO )
|
||||
create_link_to_program(CGAL_ImageIO)
|
||||
endif()
|
||||
|
||||
if ( WITH_CGAL_Qt4 )
|
||||
find_package(Qt4 QUIET)
|
||||
if( QT4_FOUND )
|
||||
include(${QT_USE_FILE})
|
||||
create_link_to_program(CGAL_Qt4)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if ( WITH_CGAL_Qt5 )
|
||||
find_package(Qt5 QUIET)
|
||||
if( Qt5_FOUND )
|
||||
create_link_to_program(CGAL_Qt5)
|
||||
endif()
|
||||
if ( TARGET CGAL::CGAL_Qt5 )
|
||||
create_link_to_program(CGAL_Qt5)
|
||||
endif()
|
||||
|
||||
if(WIN32 OR CMAKE_SYSTEM_NAME STREQUAL Windows)
|
||||
|
|
@ -235,7 +225,7 @@ list(APPEND test_config_lst "test_config_file_3")
|
|||
if(CGAL_Qt5_FOUND)
|
||||
#configure cgal for a non standard install with qt5
|
||||
add_test(NAME config_non_standard_cgal_qt5
|
||||
COMMAND ${CMAKE_COMMAND} ${GENERATOR} ${INIT_FILE} -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=${NON_STANDARD_INSTALL_PREFIX}/non_standard_install_qt5 -DCGAL_INSTALL_LIB_DIR=lib -DWITH_CGAL_Qt5=ON
|
||||
COMMAND ${CMAKE_COMMAND} ${GENERATOR} ${INIT_FILE} -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=${NON_STANDARD_INSTALL_PREFIX}/non_standard_install_qt5 -DCGAL_INSTALL_LIB_DIR=lib
|
||||
"${CGAL_SOURCE_DIR}"
|
||||
WORKING_DIRECTORY "${NON_STANDARD_INSTALL_PREFIX}/non_standard_build_qt5")
|
||||
#install cgal in the non standard place
|
||||
|
|
|
|||
Loading…
Reference in New Issue