mirror of https://github.com/CGAL/cgal
Fix CMake scripts when GMP or MPFR is found under auxiliary/
This commit is contained in:
parent
160d36af18
commit
ee61c2752c
|
|
@ -902,7 +902,7 @@ install(PROGRAMS ${scripts} DESTINATION ${CGAL_INSTALL_BIN_DIR})
|
||||||
install(DIRECTORY ${CGAL_MODULES_REL_DIR}/ DESTINATION ${CGAL_INSTALL_CMAKE_DIR} )
|
install(DIRECTORY ${CGAL_MODULES_REL_DIR}/ DESTINATION ${CGAL_INSTALL_CMAKE_DIR} )
|
||||||
install(FILES ${CGAL_MODULES_REL_DIR}/UseCGAL.cmake DESTINATION ${CGAL_INSTALL_CMAKE_DIR} )
|
install(FILES ${CGAL_MODULES_REL_DIR}/UseCGAL.cmake DESTINATION ${CGAL_INSTALL_CMAKE_DIR} )
|
||||||
|
|
||||||
if ( GMP_IN_AUXILIARY )
|
if ( GMP_IN_CGAL_AUXILIARY OR MPFR_IN_CGAL_AUXILIARY )
|
||||||
install(DIRECTORY auxiliary/gmp/include/ DESTINATION ${CGAL_INSTALL_INC_DIR} )
|
install(DIRECTORY auxiliary/gmp/include/ DESTINATION ${CGAL_INSTALL_INC_DIR} )
|
||||||
install(DIRECTORY auxiliary/gmp/lib/ DESTINATION ${CGAL_INSTALL_LIB_DIR} )
|
install(DIRECTORY auxiliary/gmp/lib/ DESTINATION ${CGAL_INSTALL_LIB_DIR} )
|
||||||
endif()
|
endif()
|
||||||
|
|
|
||||||
|
|
@ -54,8 +54,22 @@ function(use_CGAL_GMP_support target)
|
||||||
return()
|
return()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
target_include_directories(${target} SYSTEM ${keyword} ${GMP_INCLUDE_DIR} ${MPFR_INCLUDE_DIR})
|
if(NOT GMP_IN_CGAL_AUXILIARY)
|
||||||
target_link_libraries(${target} ${keyword} ${GMP_LIBRARIES} ${MPFR_LIBRARIES})
|
target_include_directories(${target} SYSTEM ${keyword} ${GMP_INCLUDE_DIR})
|
||||||
|
else()
|
||||||
|
target_include_directories(${target} SYSTEM ${keyword}
|
||||||
|
$<BUILD_INTERFACE:${GMP_INCLUDE_DIR}>
|
||||||
|
$<INSTALL_INTERFACE:include>)
|
||||||
|
endif()
|
||||||
|
target_link_libraries(${target} ${keyword} ${GMP_LIBRARIES})
|
||||||
|
if(NOT MPFR_IN_CGAL_AUXILIARY)
|
||||||
|
target_include_directories(${target} SYSTEM ${keyword} ${MPFR_INCLUDE_DIR})
|
||||||
|
else()
|
||||||
|
target_include_directories(${target} SYSTEM ${keyword}
|
||||||
|
$<BUILD_INTERFACE:${MPFR_INCLUDE_DIR}>
|
||||||
|
$<INSTALL_INTERFACE:include>)
|
||||||
|
endif()
|
||||||
|
target_link_libraries(${target} ${keyword} ${MPFR_LIBRARIES})
|
||||||
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 ${keyword} ${GMPXX_INCLUDE_DIR})
|
||||||
target_link_libraries(${target} ${keyword} ${GMPXX_LIBRARIES})
|
target_link_libraries(${target} ${keyword} ${GMPXX_LIBRARIES})
|
||||||
|
|
|
||||||
|
|
@ -21,11 +21,7 @@ if(NOT GMP_LIBRARIES)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Is it already configured?
|
# Is it already configured?
|
||||||
if (GMP_in_cache)
|
if( NOT GMP_in_cache )
|
||||||
|
|
||||||
set(GMP_FOUND TRUE)
|
|
||||||
|
|
||||||
else()
|
|
||||||
|
|
||||||
find_path(GMP_INCLUDE_DIR
|
find_path(GMP_INCLUDE_DIR
|
||||||
NAMES gmp.h
|
NAMES gmp.h
|
||||||
|
|
@ -36,10 +32,6 @@ else()
|
||||||
DOC "The directory containing the GMP header files"
|
DOC "The directory containing the GMP header files"
|
||||||
)
|
)
|
||||||
|
|
||||||
if ( GMP_INCLUDE_DIR STREQUAL "${CGAL_INSTALLATION_PACKAGE_DIR}/auxiliary/gmp/include" )
|
|
||||||
cache_set( GMP_IN_CGAL_AUXILIARY TRUE )
|
|
||||||
endif()
|
|
||||||
|
|
||||||
find_library(GMP_LIBRARIES NAMES gmp libgmp-10 mpir
|
find_library(GMP_LIBRARIES NAMES gmp libgmp-10 mpir
|
||||||
HINTS ENV GMP_LIB_DIR
|
HINTS ENV GMP_LIB_DIR
|
||||||
ENV GMP_DIR
|
ENV GMP_DIR
|
||||||
|
|
@ -57,6 +49,11 @@ else()
|
||||||
include( GMPConfig OPTIONAL )
|
include( GMPConfig OPTIONAL )
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
find_package_handle_standard_args(GMP "DEFAULT_MSG" GMP_LIBRARIES GMP_INCLUDE_DIR)
|
|
||||||
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
find_package_handle_standard_args(GMP "DEFAULT_MSG" GMP_LIBRARIES GMP_INCLUDE_DIR)
|
||||||
|
|
||||||
|
if ( GMP_INCLUDE_DIR STREQUAL "${CGAL_INSTALLATION_PACKAGE_DIR}/auxiliary/gmp/include" )
|
||||||
|
cache_set( GMP_IN_CGAL_AUXILIARY TRUE )
|
||||||
|
endif()
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -20,11 +20,7 @@ if(NOT MPFR_LIBRARIES)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Is it already configured?
|
# Is it already configured?
|
||||||
if (MPFR_in_cache)
|
if (NOT MPFR_in_cache)
|
||||||
|
|
||||||
set(MPFR_FOUND TRUE)
|
|
||||||
|
|
||||||
else()
|
|
||||||
|
|
||||||
find_path(MPFR_INCLUDE_DIR
|
find_path(MPFR_INCLUDE_DIR
|
||||||
NAMES mpfr.h
|
NAMES mpfr.h
|
||||||
|
|
@ -35,10 +31,6 @@ else()
|
||||||
DOC "The directory containing the MPFR header files"
|
DOC "The directory containing the MPFR header files"
|
||||||
)
|
)
|
||||||
|
|
||||||
if ( MPFR_INCLUDE_DIR STREQUAL "${CGAL_INSTALLATION_PACKAGE_DIR}/auxiliary/gmp/include" )
|
|
||||||
cache_set( MPFR_IN_CGAL_AUXILIARY TRUE )
|
|
||||||
endif()
|
|
||||||
|
|
||||||
find_library(MPFR_LIBRARIES NAMES mpfr libmpfr-4 libmpfr-1
|
find_library(MPFR_LIBRARIES NAMES mpfr libmpfr-4 libmpfr-1
|
||||||
HINTS ENV MPFR_LIB_DIR
|
HINTS ENV MPFR_LIB_DIR
|
||||||
ENV MPFR_DIR
|
ENV MPFR_DIR
|
||||||
|
|
@ -56,7 +48,10 @@ else()
|
||||||
include( MPFRConfig OPTIONAL )
|
include( MPFRConfig OPTIONAL )
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
find_package_handle_standard_args(MPFR "DEFAULT_MSG" MPFR_LIBRARIES MPFR_INCLUDE_DIR)
|
|
||||||
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
find_package_handle_standard_args(MPFR "DEFAULT_MSG" MPFR_LIBRARIES MPFR_INCLUDE_DIR)
|
||||||
|
|
||||||
|
if ( MPFR_INCLUDE_DIR STREQUAL "${CGAL_INSTALLATION_PACKAGE_DIR}/auxiliary/gmp/include" )
|
||||||
|
cache_set( MPFR_IN_CGAL_AUXILIARY TRUE )
|
||||||
|
endif()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue