added some guards for forbidden/stupid lib configurations

This commit is contained in:
Eric Berberich 2012-01-11 00:05:00 +00:00
parent fb7bbdb27f
commit 0abb3588b7
4 changed files with 23 additions and 10 deletions

View File

@ -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()

View File

@ -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.")

View File

@ -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()

View File

@ -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 )