mirror of https://github.com/CGAL/cgal
simplify CGAL_setup dependencies.
This commit is contained in:
parent
0f46df37df
commit
2ed89ef35e
|
|
@ -5,9 +5,7 @@ if(CGAL_Core_FOUND)
|
||||||
|
|
||||||
collect_cgal_library(CGAL_Core "")
|
collect_cgal_library(CGAL_Core "")
|
||||||
|
|
||||||
set(keyword INTERFACE)
|
CGAL_setup_CGAL_Core_dependencies(CGAL_Core)
|
||||||
|
|
||||||
CGAL_setup_CGAL_Core_dependencies(CGAL_Core ${keyword})
|
|
||||||
|
|
||||||
message("libCGAL_Core is configured")
|
message("libCGAL_Core is configured")
|
||||||
endif()
|
endif()
|
||||||
|
|
|
||||||
|
|
@ -4,9 +4,7 @@ collect_cgal_library( CGAL_ImageIO "")
|
||||||
|
|
||||||
include(CGAL_SetupCGAL_ImageIODependencies)
|
include(CGAL_SetupCGAL_ImageIODependencies)
|
||||||
|
|
||||||
set(keyword "INTERFACE")
|
CGAL_setup_CGAL_ImageIO_dependencies(CGAL_ImageIO)
|
||||||
|
|
||||||
CGAL_setup_CGAL_ImageIO_dependencies(CGAL_ImageIO ${keyword})
|
|
||||||
|
|
||||||
if(COMMAND add_config_flag)
|
if(COMMAND add_config_flag)
|
||||||
set( CGAL_HAS_IMAGEIO TRUE )
|
set( CGAL_HAS_IMAGEIO TRUE )
|
||||||
|
|
|
||||||
|
|
@ -16,9 +16,7 @@ message( STATUS "USING Qt5_VERSION = '${Qt5Core_VERSION_STRING}'" )
|
||||||
|
|
||||||
collect_cgal_library( CGAL_Qt5 "")
|
collect_cgal_library( CGAL_Qt5 "")
|
||||||
|
|
||||||
set(keyword "INTERFACE")
|
CGAL_setup_CGAL_Qt5_dependencies( CGAL_Qt5 )
|
||||||
|
|
||||||
CGAL_setup_CGAL_Qt5_dependencies( CGAL_Qt5 ${keyword})
|
|
||||||
|
|
||||||
if(COMMAND add_config_flag)
|
if(COMMAND add_config_flag)
|
||||||
set( CGAL_HAS_QT5 TRUE )
|
set( CGAL_HAS_QT5 TRUE )
|
||||||
|
|
|
||||||
|
|
@ -67,52 +67,47 @@ endif()
|
||||||
#
|
#
|
||||||
# Link the target with the dependencies of CGAL::
|
# Link the target with the dependencies of CGAL::
|
||||||
#
|
#
|
||||||
# CGAL_setup_CGAL_dependencies( target [INTERFACE] )
|
# CGAL_setup_CGAL_dependencies( target )
|
||||||
#
|
#
|
||||||
# If the option ``INTERFACE`` is passed, the dependencies are
|
# The dependencies are
|
||||||
# added using :command:`target_link_libraries` with the ``INTERFACE``
|
# added using :command:`target_link_libraries` with the ``INTERFACE``
|
||||||
# keyword, or ``PUBLIC`` otherwise.
|
# keyword.
|
||||||
#
|
#
|
||||||
function(CGAL_setup_CGAL_dependencies target)
|
function(CGAL_setup_CGAL_dependencies target)
|
||||||
if(ARGV1 STREQUAL INTERFACE)
|
|
||||||
set(keyword INTERFACE)
|
|
||||||
else()
|
|
||||||
set(keyword PUBLIC)
|
|
||||||
endif()
|
|
||||||
if(CGAL_DISABLE_GMP)
|
if(CGAL_DISABLE_GMP)
|
||||||
target_compile_definitions(${target} ${keyword} CGAL_DISABLE_GMP=1)
|
target_compile_definitions(${target} INTERFACE CGAL_DISABLE_GMP=1)
|
||||||
else()
|
else()
|
||||||
use_CGAL_GMP_support(${target} ${keyword})
|
use_CGAL_GMP_support(${target} INTERFACE)
|
||||||
set(CGAL_USE_GMP TRUE CACHE INTERNAL "CGAL library is configured to use GMP")
|
set(CGAL_USE_GMP TRUE CACHE INTERNAL "CGAL library is configured to use GMP")
|
||||||
set(CGAL_USE_MPFR TRUE CACHE INTERNAL "CGAL library is configured to use MPFR")
|
set(CGAL_USE_MPFR TRUE CACHE INTERNAL "CGAL library is configured to use MPFR")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(WITH_LEDA)
|
if(WITH_LEDA)
|
||||||
use_CGAL_LEDA_support(${target} ${keyword})
|
use_CGAL_LEDA_support(${target} INTERFACE)
|
||||||
endif()
|
endif()
|
||||||
if (RUNNING_CGAL_AUTO_TEST OR CGAL_TEST_SUITE)
|
if (RUNNING_CGAL_AUTO_TEST OR CGAL_TEST_SUITE)
|
||||||
target_compile_definitions(${target} ${keyword} CGAL_TEST_SUITE=1)
|
target_compile_definitions(${target} INTERFACE CGAL_TEST_SUITE=1)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# CGAL now requires C++14. `decltype(auto)` is used as a marker of
|
# CGAL now requires C++14. `decltype(auto)` is used as a marker of
|
||||||
# C++14.
|
# C++14.
|
||||||
target_compile_features(${target} ${keyword} cxx_decltype_auto)
|
target_compile_features(${target} INTERFACE cxx_decltype_auto)
|
||||||
|
|
||||||
use_CGAL_Boost_support(${target} ${keyword})
|
use_CGAL_Boost_support(${target} INTERFACE)
|
||||||
|
|
||||||
foreach(dir ${CGAL_INCLUDE_DIRS})
|
foreach(dir ${CGAL_INCLUDE_DIRS})
|
||||||
target_include_directories(${target} ${keyword}
|
target_include_directories(${target} INTERFACE
|
||||||
$<BUILD_INTERFACE:${dir}>)
|
$<BUILD_INTERFACE:${dir}>)
|
||||||
endforeach()
|
endforeach()
|
||||||
target_include_directories(${target} ${keyword}
|
target_include_directories(${target} INTERFACE
|
||||||
$<INSTALL_INTERFACE:include>)
|
$<INSTALL_INTERFACE:include>)
|
||||||
|
|
||||||
# Now setup compilation flags
|
# Now setup compilation flags
|
||||||
if(MSVC)
|
if(MSVC)
|
||||||
target_compile_options(${target} ${keyword}
|
target_compile_options(${target} INTERFACE
|
||||||
"-D_SCL_SECURE_NO_DEPRECATE;-D_SCL_SECURE_NO_WARNINGS")
|
"-D_SCL_SECURE_NO_DEPRECATE;-D_SCL_SECURE_NO_WARNINGS")
|
||||||
if(CMAKE_VERSION VERSION_LESS 3.11)
|
if(CMAKE_VERSION VERSION_LESS 3.11)
|
||||||
target_compile_options(${target} ${keyword}
|
target_compile_options(${target} INTERFACE
|
||||||
/fp:strict
|
/fp:strict
|
||||||
/fp:except-
|
/fp:except-
|
||||||
/wd4503 # Suppress warnings C4503 about "decorated name length exceeded"
|
/wd4503 # Suppress warnings C4503 about "decorated name length exceeded"
|
||||||
|
|
@ -120,7 +115,7 @@ function(CGAL_setup_CGAL_dependencies target)
|
||||||
)
|
)
|
||||||
else()
|
else()
|
||||||
# The MSVC generator supports `$<COMPILE_LANGUAGE: >` since CMake 3.11.
|
# The MSVC generator supports `$<COMPILE_LANGUAGE: >` since CMake 3.11.
|
||||||
target_compile_options(${target} ${keyword}
|
target_compile_options(${target} INTERFACE
|
||||||
$<$<COMPILE_LANGUAGE:CXX>:/fp:strict>
|
$<$<COMPILE_LANGUAGE:CXX>:/fp:strict>
|
||||||
$<$<COMPILE_LANGUAGE:CXX>:/fp:except->
|
$<$<COMPILE_LANGUAGE:CXX>:/fp:except->
|
||||||
$<$<COMPILE_LANGUAGE:CXX>:/wd4503> # Suppress warnings C4503 about "decorated name length exceeded"
|
$<$<COMPILE_LANGUAGE:CXX>:/wd4503> # Suppress warnings C4503 about "decorated name length exceeded"
|
||||||
|
|
@ -131,39 +126,39 @@ function(CGAL_setup_CGAL_dependencies target)
|
||||||
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 11.0.3)
|
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 11.0.3)
|
||||||
message(STATUS "Apple Clang version ${CMAKE_CXX_COMPILER_VERSION} compiler detected")
|
message(STATUS "Apple Clang version ${CMAKE_CXX_COMPILER_VERSION} compiler detected")
|
||||||
message(STATUS "Boost MP is turned off for all Apple Clang versions below 11.0.3!")
|
message(STATUS "Boost MP is turned off for all Apple Clang versions below 11.0.3!")
|
||||||
target_compile_options(${target} ${keyword} "-DCGAL_DO_NOT_USE_BOOST_MP")
|
target_compile_options(${target} INTERFACE "-DCGAL_DO_NOT_USE_BOOST_MP")
|
||||||
endif()
|
endif()
|
||||||
elseif(CMAKE_CXX_COMPILER_ID MATCHES "Intel")
|
elseif(CMAKE_CXX_COMPILER_ID MATCHES "Intel")
|
||||||
message( STATUS "Using Intel Compiler. Adding -fp-model strict" )
|
message( STATUS "Using Intel Compiler. Adding -fp-model strict" )
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
target_compile_options(${target} ${keyword} "/fp:strict")
|
target_compile_options(${target} INTERFACE "/fp:strict")
|
||||||
else()
|
else()
|
||||||
target_compile_options(${target} ${keyword} "-fp-model" "strict")
|
target_compile_options(${target} INTERFACE "-fp-model" "strict")
|
||||||
endif()
|
endif()
|
||||||
elseif(CMAKE_CXX_COMPILER_ID MATCHES "SunPro")
|
elseif(CMAKE_CXX_COMPILER_ID MATCHES "SunPro")
|
||||||
message( STATUS "Using SunPro compiler, using STLPort 4." )
|
message( STATUS "Using SunPro compiler, using STLPort 4." )
|
||||||
target_compile_options(${target} ${keyword}
|
target_compile_options(${target} INTERFACE
|
||||||
"-features=extensions;-library=stlport4;-D_GNU_SOURCE")
|
"-features=extensions;-library=stlport4;-D_GNU_SOURCE")
|
||||||
target_link_libraries(${target} ${keyword} "-library=stlport4")
|
target_link_libraries(${target} INTERFACE "-library=stlport4")
|
||||||
elseif(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
|
elseif(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
|
||||||
if ( RUNNING_CGAL_AUTO_TEST )
|
if ( RUNNING_CGAL_AUTO_TEST )
|
||||||
target_compile_options(${target} ${keyword} "-Wall")
|
target_compile_options(${target} INTERFACE "-Wall")
|
||||||
endif()
|
endif()
|
||||||
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 3)
|
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 3)
|
||||||
message( STATUS "Using gcc version 4 or later. Adding -frounding-math" )
|
message( STATUS "Using gcc version 4 or later. Adding -frounding-math" )
|
||||||
if(CMAKE_VERSION VERSION_LESS 3.3)
|
if(CMAKE_VERSION VERSION_LESS 3.3)
|
||||||
target_compile_options(${target} ${keyword} "-frounding-math")
|
target_compile_options(${target} INTERFACE "-frounding-math")
|
||||||
else()
|
else()
|
||||||
target_compile_options(${target} ${keyword} "$<$<COMPILE_LANGUAGE:CXX>:-frounding-math>")
|
target_compile_options(${target} INTERFACE "$<$<COMPILE_LANGUAGE:CXX>:-frounding-math>")
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
if ( "${GCC_VERSION}" MATCHES "^4.2" )
|
if ( "${GCC_VERSION}" MATCHES "^4.2" )
|
||||||
message( STATUS "Using gcc version 4.2. Adding -fno-strict-aliasing" )
|
message( STATUS "Using gcc version 4.2. Adding -fno-strict-aliasing" )
|
||||||
target_compile_options(${target} ${keyword} "-fno-strict-aliasing" )
|
target_compile_options(${target} INTERFACE "-fno-strict-aliasing" )
|
||||||
endif()
|
endif()
|
||||||
if ( "${CMAKE_SYSTEM_PROCESSOR}" MATCHES "alpha" )
|
if ( "${CMAKE_SYSTEM_PROCESSOR}" MATCHES "alpha" )
|
||||||
message( STATUS "Using gcc on alpha. Adding -mieee -mfp-rounding-mode=d" )
|
message( STATUS "Using gcc on alpha. Adding -mieee -mfp-rounding-mode=d" )
|
||||||
target_compile_options(${target} ${keyword} "-mieee" "-mfp-rounding-mode=d" )
|
target_compile_options(${target} INTERFACE "-mieee" "-mfp-rounding-mode=d" )
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
|
||||||
|
|
@ -46,22 +46,16 @@ endif()
|
||||||
#
|
#
|
||||||
# Link the target with the dependencies of `CGAL_Core`::
|
# Link the target with the dependencies of `CGAL_Core`::
|
||||||
#
|
#
|
||||||
# CGAL_setup_CGAL_Core_dependencies( target [INTERFACE] )
|
# CGAL_setup_CGAL_Core_dependencies( target)
|
||||||
#
|
#
|
||||||
# If the option ``INTERFACE`` is passed, the dependencies are
|
# The dependencies are
|
||||||
# added using :command:`target_link_libraries` with the ``INTERFACE``
|
# added using :command:`target_link_libraries` with the ``INTERFACE``
|
||||||
# keyword, or ``PUBLIC`` otherwise.
|
# keyword.
|
||||||
#
|
#
|
||||||
|
|
||||||
function(CGAL_setup_CGAL_Core_dependencies target)
|
function(CGAL_setup_CGAL_Core_dependencies target)
|
||||||
if(ARGV1 STREQUAL INTERFACE)
|
use_CGAL_GMP_support(CGAL_Core INTERFACE)
|
||||||
set(keyword INTERFACE)
|
target_compile_definitions(${target} INTERFACE CGAL_USE_CORE=1)
|
||||||
else()
|
target_link_libraries( CGAL_Core INTERFACE CGAL::CGAL )
|
||||||
set(keyword PUBLIC)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
use_CGAL_GMP_support(CGAL_Core ${keyword})
|
|
||||||
target_compile_definitions(${target} ${keyword} CGAL_USE_CORE=1)
|
|
||||||
target_link_libraries( CGAL_Core ${keyword} CGAL::CGAL )
|
|
||||||
|
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
|
||||||
|
|
@ -51,22 +51,14 @@ set(CGAL_ImageIO_FOUND TRUE)
|
||||||
set_property(GLOBAL PROPERTY CGAL_ImageIO_FOUND TRUE)
|
set_property(GLOBAL PROPERTY CGAL_ImageIO_FOUND TRUE)
|
||||||
|
|
||||||
function(CGAL_setup_CGAL_ImageIO_dependencies target)
|
function(CGAL_setup_CGAL_ImageIO_dependencies target)
|
||||||
if(ARGV1 STREQUAL INTERFACE)
|
|
||||||
set(keyword INTERFACE)
|
|
||||||
else()
|
|
||||||
set(keyword PUBLIC)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
target_link_libraries( CGAL_ImageIO ${keyword} CGAL::CGAL)
|
target_link_libraries( CGAL_ImageIO INTERFACE CGAL::CGAL)
|
||||||
|
|
||||||
if(ZLIB_FOUND)
|
if(ZLIB_FOUND)
|
||||||
target_include_directories( CGAL_ImageIO SYSTEM ${keyword} ${ZLIB_INCLUDE_DIRS})
|
target_include_directories( CGAL_ImageIO SYSTEM INTERFACE ${ZLIB_INCLUDE_DIRS})
|
||||||
target_link_libraries( CGAL_ImageIO ${keyword} ${ZLIB_LIBRARIES})
|
target_link_libraries( CGAL_ImageIO INTERFACE ${ZLIB_LIBRARIES})
|
||||||
|
|
||||||
target_compile_definitions( CGAL_ImageIO ${keyword} CGAL_USE_ZLIB=1)
|
target_compile_definitions( CGAL_ImageIO INTERFACE CGAL_USE_ZLIB=1)
|
||||||
if(NOT ARGV1 STREQUAL INTERFACE)
|
|
||||||
set_target_properties(CGAL_ImageIO PROPERTIES CGAL_TARGET_USES_ZLIB TRUE)
|
|
||||||
endif()
|
|
||||||
else()
|
else()
|
||||||
message( STATUS "NOTICE: libCGAL_ImageIO needs ZLib to read compressed files. That feature will not be activated.")
|
message( STATUS "NOTICE: libCGAL_ImageIO needs ZLib to read compressed files. That feature will not be activated.")
|
||||||
endif()
|
endif()
|
||||||
|
|
|
||||||
|
|
@ -99,31 +99,26 @@ endif()
|
||||||
#
|
#
|
||||||
# Link the target with the dependencies of `CGAL_Qt5`::
|
# Link the target with the dependencies of `CGAL_Qt5`::
|
||||||
#
|
#
|
||||||
# CGAL_setup_CGAL_Qt5_dependencies( target [INTERFACE] )
|
# CGAL_setup_CGAL_Qt5_dependencies( target )
|
||||||
#
|
#
|
||||||
# If the option ``INTERFACE`` is passed, the dependencies are
|
# The dependencies are
|
||||||
# added using :command:`target_link_libraries` with the ``INTERFACE``
|
# added using :command:`target_link_libraries` with the ``INTERFACE``
|
||||||
# keyword, or ``PUBLIC`` otherwise.
|
# keyword.
|
||||||
#
|
#
|
||||||
function(CGAL_setup_CGAL_Qt5_dependencies target)
|
function(CGAL_setup_CGAL_Qt5_dependencies target)
|
||||||
if(ARGV1 STREQUAL INTERFACE)
|
|
||||||
set(keyword INTERFACE)
|
|
||||||
else()
|
|
||||||
set(keyword PUBLIC)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if($ENV{CGAL_FAKE_PUBLIC_RELEASE})
|
if($ENV{CGAL_FAKE_PUBLIC_RELEASE})
|
||||||
target_compile_definitions( ${target} ${keyword} CGAL_FAKE_PUBLIC_RELEASE=1 )
|
target_compile_definitions( ${target} INTERFACE CGAL_FAKE_PUBLIC_RELEASE=1 )
|
||||||
endif()
|
endif()
|
||||||
target_link_libraries( ${target} ${keyword} CGAL::CGAL)
|
target_link_libraries( ${target} INTERFACE CGAL::CGAL)
|
||||||
target_link_libraries( ${target} ${keyword} CGAL::Qt5_moc_and_resources)
|
target_link_libraries( ${target} INTERFACE CGAL::Qt5_moc_and_resources)
|
||||||
target_link_libraries( ${target} ${keyword} Qt5::OpenGL Qt5::Svg Qt5::Xml)
|
target_link_libraries( ${target} INTERFACE Qt5::OpenGL Qt5::Svg Qt5::Xml)
|
||||||
|
|
||||||
# Remove -Wdeprecated-copy, for g++ >= 9.0, because Qt5, as of
|
# Remove -Wdeprecated-copy, for g++ >= 9.0, because Qt5, as of
|
||||||
# version 5.12, has a lot of [-Wdeprecated-copy] warnings.
|
# version 5.12, has a lot of [-Wdeprecated-copy] warnings.
|
||||||
if( CMAKE_CXX_COMPILER_ID STREQUAL "GNU"
|
if( CMAKE_CXX_COMPILER_ID STREQUAL "GNU"
|
||||||
AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS "9" )
|
AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS "9" )
|
||||||
target_compile_options( ${target} ${keyword} "-Wno-deprecated-copy" "-Wno-cast-function-type" )
|
target_compile_options( ${target} INTERFACE "-Wno-deprecated-copy" "-Wno-cast-function-type" )
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
|
||||||
|
|
@ -46,34 +46,29 @@ endif()
|
||||||
# keyword, or ``PUBLIC`` otherwise.
|
# keyword, or ``PUBLIC`` otherwise.
|
||||||
|
|
||||||
function(use_CGAL_GMP_support target)
|
function(use_CGAL_GMP_support target)
|
||||||
if(ARGV1 STREQUAL INTERFACE)
|
|
||||||
set(keyword INTERFACE)
|
|
||||||
else()
|
|
||||||
set(keyword PUBLIC)
|
|
||||||
endif()
|
|
||||||
if(NOT GMP_FOUND OR NOT MPFR_FOUND)
|
if(NOT GMP_FOUND OR NOT MPFR_FOUND)
|
||||||
message(FATAL_ERROR "CGAL requires GMP and MPFR.")
|
message(FATAL_ERROR "CGAL requires GMP and MPFR.")
|
||||||
return()
|
return()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(NOT GMP_INCLUDE_DIR STREQUAL "${CGAL_INSTALLATION_PACKAGE_DIR}/auxiliary/gmp/include")
|
if(NOT GMP_INCLUDE_DIR STREQUAL "${CGAL_INSTALLATION_PACKAGE_DIR}/auxiliary/gmp/include")
|
||||||
target_include_directories(${target} SYSTEM ${keyword} ${GMP_INCLUDE_DIR})
|
target_include_directories(${target} SYSTEM INTERFACE ${GMP_INCLUDE_DIR})
|
||||||
else()
|
else()
|
||||||
target_include_directories(${target} SYSTEM ${keyword}
|
target_include_directories(${target} SYSTEM INTERFACE
|
||||||
$<BUILD_INTERFACE:${GMP_INCLUDE_DIR}>
|
$<BUILD_INTERFACE:${GMP_INCLUDE_DIR}>
|
||||||
$<INSTALL_INTERFACE:include>)
|
$<INSTALL_INTERFACE:include>)
|
||||||
endif()
|
endif()
|
||||||
if(NOT MPFR_INCLUDE_DIR STREQUAL "${CGAL_INSTALLATION_PACKAGE_DIR}/auxiliary/gmp/include")
|
if(NOT MPFR_INCLUDE_DIR STREQUAL "${CGAL_INSTALLATION_PACKAGE_DIR}/auxiliary/gmp/include")
|
||||||
target_include_directories(${target} SYSTEM ${keyword} ${MPFR_INCLUDE_DIR})
|
target_include_directories(${target} SYSTEM INTERFACE ${MPFR_INCLUDE_DIR})
|
||||||
else()
|
else()
|
||||||
target_include_directories(${target} SYSTEM ${keyword}
|
target_include_directories(${target} SYSTEM INTERFACE
|
||||||
$<BUILD_INTERFACE:${MPFR_INCLUDE_DIR}>
|
$<BUILD_INTERFACE:${MPFR_INCLUDE_DIR}>
|
||||||
$<INSTALL_INTERFACE:include>)
|
$<INSTALL_INTERFACE:include>)
|
||||||
endif()
|
endif()
|
||||||
if(WITH_GMPXX OR CGAL_WITH_GMPXX)
|
if(WITH_GMPXX OR CGAL_WITH_GMPXX)
|
||||||
target_include_directories(${target} SYSTEM ${keyword} ${GMPXX_INCLUDE_DIR})
|
target_include_directories(${target} SYSTEM INTERFACE ${GMPXX_INCLUDE_DIR})
|
||||||
target_link_libraries(${target} ${keyword} ${GMPXX_LIBRARIES})
|
target_link_libraries(${target} INTERFACE ${GMPXX_LIBRARIES})
|
||||||
target_compile_definitions(${target} ${keyword} CGAL_USE_GMPXX=1)
|
target_compile_definitions(${target} INTERFACE CGAL_USE_GMPXX=1)
|
||||||
endif()
|
endif()
|
||||||
target_link_libraries(${target} ${keyword} ${MPFR_LIBRARIES} ${GMP_LIBRARIES})
|
target_link_libraries(${target} INTERFACE ${MPFR_LIBRARIES} ${GMP_LIBRARIES})
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
|
||||||
|
|
@ -32,11 +32,6 @@ find_package(LEDA)
|
||||||
# keyword, or ``PUBLIC`` otherwise.
|
# keyword, or ``PUBLIC`` otherwise.
|
||||||
|
|
||||||
function(use_CGAL_LEDA_support target)
|
function(use_CGAL_LEDA_support target)
|
||||||
if(ARGV1 STREQUAL INTERFACE)
|
|
||||||
set(keyword INTERFACE)
|
|
||||||
else()
|
|
||||||
set(keyword PUBLIC)
|
|
||||||
endif()
|
|
||||||
if(NOT LEDA_FOUND)
|
if(NOT LEDA_FOUND)
|
||||||
message(FATAL_ERROR "use_CGAL_LEDA_support is use whereas LEDA_FOUND is false.")
|
message(FATAL_ERROR "use_CGAL_LEDA_support is use whereas LEDA_FOUND is false.")
|
||||||
return()
|
return()
|
||||||
|
|
@ -45,12 +40,12 @@ function(use_CGAL_LEDA_support target)
|
||||||
separate_arguments(LIST_LEDA_DEFINITIONS UNIX_COMMAND "${LEDA_DEFINITIONS} -DCGAL_USE_LEDA")
|
separate_arguments(LIST_LEDA_DEFINITIONS UNIX_COMMAND "${LEDA_DEFINITIONS} -DCGAL_USE_LEDA")
|
||||||
|
|
||||||
if(CMAKE_VERSION VERSION_LESS 3.3)
|
if(CMAKE_VERSION VERSION_LESS 3.3)
|
||||||
target_compile_options(${target} ${keyword} ${LIST_LEDA_CXX_FLAGS})
|
target_compile_options(${target} INTERFACE ${LIST_LEDA_CXX_FLAGS})
|
||||||
else()
|
else()
|
||||||
target_compile_options(${target} ${keyword} $<$<COMPILE_LANGUAGE:CXX>:${LIST_LEDA_CXX_FLAGS}>)
|
target_compile_options(${target} INTERFACE $<$<COMPILE_LANGUAGE:CXX>:${LIST_LEDA_CXX_FLAGS}>)
|
||||||
endif()
|
endif()
|
||||||
target_compile_options(${target} ${keyword} ${LIST_LEDA_DEFINITIONS})
|
target_compile_options(${target} INTERFACE ${LIST_LEDA_DEFINITIONS})
|
||||||
|
|
||||||
target_include_directories(${target} SYSTEM ${keyword} ${LEDA_INCLUDE_DIR})
|
target_include_directories(${target} SYSTEM INTERFACE ${LEDA_INCLUDE_DIR})
|
||||||
target_link_libraries(${target} ${keyword} ${LEDA_LIBRARIES} ${LEDA_LINKER_FLAGS})
|
target_link_libraries(${target} INTERFACE ${LEDA_LIBRARIES} ${LEDA_LINKER_FLAGS})
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
|
||||||
|
|
@ -1,17 +1,11 @@
|
||||||
function(CGAL_setup_target_dependencies target)
|
function(CGAL_setup_target_dependencies target)
|
||||||
if(ARGV1 STREQUAL INTERFACE)
|
|
||||||
set(keyword INTERFACE)
|
|
||||||
else()
|
|
||||||
set(keyword PUBLIC)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(${target} STREQUAL CGAL)
|
if(${target} STREQUAL CGAL)
|
||||||
CGAL_setup_CGAL_dependencies(${target} ${keyword})
|
CGAL_setup_CGAL_dependencies(${target})
|
||||||
elseif(${target} STREQUAL CGAL_Core)
|
elseif(${target} STREQUAL CGAL_Core)
|
||||||
CGAL_setup_CGAL_Core_dependencies(${target} ${keyword})
|
CGAL_setup_CGAL_Core_dependencies(${target})
|
||||||
elseif(${target} STREQUAL CGAL_ImageIO)
|
elseif(${target} STREQUAL CGAL_ImageIO)
|
||||||
CGAL_setup_CGAL_ImageIO_dependencies(${target} ${keyword})
|
CGAL_setup_CGAL_ImageIO_dependencies(${target})
|
||||||
elseif(${target} STREQUAL CGAL_Qt5)
|
elseif(${target} STREQUAL CGAL_Qt5)
|
||||||
CGAL_setup_CGAL_Qt5_dependencies(${target} ${keyword})
|
CGAL_setup_CGAL_Qt5_dependencies(${target})
|
||||||
endif()
|
endif()
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
|
||||||
|
|
@ -144,7 +144,7 @@ foreach(cgal_lib ${CGAL_LIBRARIES})
|
||||||
if(NOT TARGET CGAL::${cgal_lib})
|
if(NOT TARGET CGAL::${cgal_lib})
|
||||||
add_library(CGAL::${cgal_lib} ALIAS ${cgal_lib})
|
add_library(CGAL::${cgal_lib} ALIAS ${cgal_lib})
|
||||||
endif()
|
endif()
|
||||||
CGAL_setup_target_dependencies(${cgal_lib} INTERFACE)
|
CGAL_setup_target_dependencies(${cgal_lib})
|
||||||
endif()
|
endif()
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,9 +4,7 @@ collect_cgal_library(CGAL "")
|
||||||
|
|
||||||
include(CGAL_SetupCGALDependencies)
|
include(CGAL_SetupCGALDependencies)
|
||||||
|
|
||||||
set(keyword "INTERFACE")
|
CGAL_setup_CGAL_dependencies(CGAL)
|
||||||
|
|
||||||
CGAL_setup_CGAL_dependencies(CGAL ${keyword})
|
|
||||||
|
|
||||||
if(NOT CGAL_DISABLE_GMP)
|
if(NOT CGAL_DISABLE_GMP)
|
||||||
get_dependency_version(GMP)
|
get_dependency_version(GMP)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue