diff --git a/Installation/cmake/modules/CGAL_Macros.cmake b/Installation/cmake/modules/CGAL_Macros.cmake index 7ab86320278..099e3f133e8 100644 --- a/Installation/cmake/modules/CGAL_Macros.cmake +++ b/Installation/cmake/modules/CGAL_Macros.cmake @@ -208,7 +208,7 @@ if( NOT CGAL_MACROS_FILE_INCLUDED ) set (vlib ${CGAL_EXT_LIB_${lib}_PREFIX} ) - if ( ${vlib}_FOUND ) + if ( WITH_${lib} AND ${vlib}_FOUND ) if ( NOT ${vlib}_SETUP ) # avoid double usage @@ -222,6 +222,7 @@ if( NOT CGAL_MACROS_FILE_INCLUDED ) message (STATUS "Configured ${lib} from UseLIB-file: ${filename}") # UseLIB-file has to set ${vlib}_SETUP to TRUE + # TODO EBEB what about Qt4, Qt3, zlib? else() @@ -253,7 +254,9 @@ if( NOT CGAL_MACROS_FILE_INCLUDED ) else() - message( FATAL_ERROR "Try to use ${lib} that is not found") + if ( WITH_${lib} ) + message( SEND_ERROR "Try to use ${lib} that is not found") + endif() endif() diff --git a/Installation/cmake/modules/CGAL_SetupDependencies.cmake b/Installation/cmake/modules/CGAL_SetupDependencies.cmake index ee59161a576..4187bf3e50e 100644 --- a/Installation/cmake/modules/CGAL_SetupDependencies.cmake +++ b/Installation/cmake/modules/CGAL_SetupDependencies.cmake @@ -9,11 +9,12 @@ foreach (lib ${CGAL_SUPPORTING_3RD_PARTY_LIRARIES}) set (vlib "${CGAL_EXT_LIB_${lib}_PREFIX}") list(FIND CGAL_MANDATORY_3RD_PARTY_LIBRARIES "${lib}" POSITION) - if ("${POSITION}" STRGREATER "-1" OR WITH_${lib}) - + #if ("${POSITION}" STRGREATER "-1" OR WITH_${lib}) + if (WITH_${lib}) + # message (STATUS "With ${lib} given") - message (STATUS "Checking expected library: ${lib} ...") + message (STATUS "Preconfiguring library: ${lib} ...") find_package( ${lib} ) @@ -24,7 +25,8 @@ foreach (lib ${CGAL_SUPPORTING_3RD_PARTY_LIRARIES}) message( STATUS " ${lib} libraries: ${${vlib}_LIBRARIES}" ) message( STATUS " ${lib} definitions: ${${vlib}_DEFINITIONS}" ) - set ( CGAL_USE_${vlib} TRUE ) + # TODO EBEB delete CGAL_USE_${vlib} TRUE here as set in "use_lib" macro, what about Qt3, Qt4, zlib etc? + ### set ( CGAL_USE_${vlib} TRUE ) # Part 2: Add some lib-specific definitions or obtain version @@ -62,6 +64,10 @@ foreach (lib ${CGAL_SUPPORTING_3RD_PARTY_LIRARIES}) endforeach() +if( (GMP_FOUND AND NOT MPFR_FOUND) OR (NOT GMP_FOUND AND MPFR_FOUND) ) + message( FATAL_ERROR "CGAL needs for its full functionality both GMP and MPFR.") +endif() + if( NOT GMP_FOUND ) set(CGAL_NO_CORE ON) message( STATUS "CGAL_Core needs GMP, cannot be configured.") diff --git a/Installation/cmake/modules/FindGMPXX.cmake b/Installation/cmake/modules/FindGMPXX.cmake index 333cd1d44b6..e24a62316fa 100644 --- a/Installation/cmake/modules/FindGMPXX.cmake +++ b/Installation/cmake/modules/FindGMPXX.cmake @@ -9,7 +9,7 @@ find_package( GMP QUIET ) -if(GMP_FOUND) +if(WITH_GMP AND GMP_FOUND) if (GMPXX_INCLUDE_DIR AND GMPXX_LIBRARIES) # Already in cache, be silent @@ -30,4 +30,8 @@ if(GMP_FOUND) find_package_handle_standard_args(GMPXX "DEFAULT_MSG" GMPXX_LIBRARIES GMPXX_INCLUDE_DIR ) +else() + + message( FATAL_ERROR "GMPXX needs GMP") + endif() diff --git a/Installation/cmake/modules/FindNTL.cmake b/Installation/cmake/modules/FindNTL.cmake index 594a37d3dd0..32c89b87102 100644 --- a/Installation/cmake/modules/FindNTL.cmake +++ b/Installation/cmake/modules/FindNTL.cmake @@ -3,12 +3,12 @@ find_package( GMP REQUIRED ) -if( NOT GMP_FOUND ) +if( NOT WITH_GMP OR NOT GMP_FOUND ) message( FATAL_ERROR "NTL requires GMP" ) set( NTL_FOUND FALSE ) -else( NOT GMP_FOUND ) +else( NOT WITH_GMP OR NOT GMP_FOUND ) include( CGAL_VersionUtils ) @@ -96,7 +96,7 @@ else( NOT GMP_FOUND ) endif( _IS_GMP_VERSION_TOO_LOW ) -endif( NOT GMP_FOUND ) +endif( NOT WITH_GMP OR NOT GMP_FOUND ) if ( NTL_FOUND ) # if ( NOT NTL_FIND_QUIETLY )