make GMP+MPFR mandatory

This commit is contained in:
Eric Berberich 2012-01-31 10:47:45 +00:00
parent 88229aa30e
commit dc2fb9242a
2 changed files with 76 additions and 63 deletions

View File

@ -262,6 +262,76 @@ if( NOT CGAL_MACROS_FILE_INCLUDED )
endmacro()
macro( use_component component)
message (STATUS "CGAL requested component: ${component}")
if(WITH_CGAL_${component})
if(TARGET CGAL_${component})
add_to_list( CGAL_LIBRARIES CGAL_${component} )
else()
add_to_list( CGAL_LIBRARIES ${CGAL_${component}_LIBRARY} )
endif()
add_to_list( CGAL_3RD_PARTY_LIBRARIES ${CGAL_${component}_3RD_PARTY_LIBRARIES} )
add_to_list( CGAL_3RD_PARTY_INCLUDE_DIRS ${CGAL_${component}_3RD_PARTY_INCLUDE_DIRS} )
add_to_list( CGAL_3RD_PARTY_DEFINITIONS ${CGAL_${component}_3RD_PARTY_DEFINITIONS} )
add_to_list( CGAL_3RD_PARTY_LIBRARIES_DIRS ${CGAL_${component}_3RD_PARTY_LIBRARIES_DIRS} )
# TODO EBEB: What about GMP, MPFR, zlib used in other libCGALxyz
if (${component} STREQUAL "Qt3")
find_package( Qt3-patched )
endif()
if (${component} STREQUAL "Qt4")
find_package( Qt4 )
endif()
else(WITH_CGAL_${component})
# now we are talking about 3rd party libs
if ( ${component} STREQUAL "ALL_PRECONFIGURED_LIBS" )
if (CGAL_ALLOW_ALL_PRECONFIGURED_LIBS_COMPONENT)
message( STATUS "External libraries are all used")
foreach ( CGAL_3RD_PARTY_LIB ${CGAL_SUPPORTING_3RD_PARTY_LIRARIES})
if (${CGAL_3RD_PARTY_LIB}_FOUND)
use_lib( ${CGAL_3RD_PARTY_LIB} "###${${CGAL_3RD_PARTY_LIB}_USE_FILE}")
endif()
endforeach()
else()
message( SEND_ERROR "Component ALL_PRECONFIGURED_LIBS only allow with CGAL_ALLOW_ALL_PRECONFIGURED_LIBS_COMPONENT=ON")
endif()
else()
set( vlib "${CGAL_EXT_LIB_${component}_PREFIX}" )
if ( ${vlib}_FOUND)
message( STATUS "External library ${component} has been preconfigured")
use_lib( ${component} "###${${vlib}_USE_FILE}")
else()
message( STATUS "External library ${component} has not been preconfigured")
find_package( ${component} )
message( STATUS "External library ${vlib} after find")
if (${vlib}_FOUND)
use_lib( ${component} "###${${vlib}_USE_FILE}")
endif()
endif()
endif()
endif(WITH_CGAL_${component})
endmacro()
function( cgal_setup_module_path )
# Avoid to modify the modules path twice
if(NOT CGAL_MODULE_PATH_IS_SET)

View File

@ -21,72 +21,15 @@ if(NOT USE_CGAL_FILE_INCLUDED)
set( CGAL_LIBRARIES )
foreach ( CGAL_COMPONENT ${CGAL_REQUESTED_COMPONENTS} )
message (STATUS "CGAL requested component: ${CGAL_COMPONENT}")
foreach ( component ${CGAL_REQUESTED_COMPONENTS} )
if(WITH_CGAL_${CGAL_COMPONENT})
if(TARGET CGAL_${CGAL_COMPONENT})
add_to_list( CGAL_LIBRARIES CGAL_${CGAL_COMPONENT} )
else()
add_to_list( CGAL_LIBRARIES ${CGAL_${CGAL_COMPONENT}_LIBRARY} )
endif()
add_to_list( CGAL_3RD_PARTY_LIBRARIES ${CGAL_${CGAL_COMPONENT}_3RD_PARTY_LIBRARIES} )
add_to_list( CGAL_3RD_PARTY_INCLUDE_DIRS ${CGAL_${CGAL_COMPONENT}_3RD_PARTY_INCLUDE_DIRS} )
add_to_list( CGAL_3RD_PARTY_DEFINITIONS ${CGAL_${CGAL_COMPONENT}_3RD_PARTY_DEFINITIONS} )
add_to_list( CGAL_3RD_PARTY_LIBRARIES_DIRS ${CGAL_${CGAL_COMPONENT}_3RD_PARTY_LIBRARIES_DIRS} )
# TODO EBEB: What about GMP, MPFR, zlib used in other libCGALxyz
if (${CGAL_COMPONENT} STREQUAL "Qt3")
find_package( Qt3-patched )
endif()
if (${CGAL_COMPONENT} STREQUAL "Qt4")
find_package( Qt4 )
endif()
else(WITH_CGAL_${CGAL_COMPONENT})
# now we are talking about 3rd party libs
if ( ${CGAL_COMPONENT} STREQUAL "ALL_PRECONFIGURED_LIBS" )
if (CGAL_ALLOW_ALL_PRECONFIGURED_LIBS_COMPONENT)
message( STATUS "External libraries are all used")
foreach ( CGAL_3RD_PARTY_LIB ${CGAL_SUPPORTING_3RD_PARTY_LIRARIES})
if (${CGAL_3RD_PARTY_LIB}_FOUND)
use_lib( ${CGAL_3RD_PARTY_LIB} "###${${CGAL_3RD_PARTY_LIB}_USE_FILE}")
endif()
endforeach()
else()
message( SEND_ERROR "Component ALL_PRECONFIGURED_LIBS only allow with CGAL_ALLOW_ALL_PRECONFIGURED_LIBS_COMPONENT=ON")
endif()
else()
set( vlib "${CGAL_EXT_LIB_${CGAL_COMPONENT}_PREFIX}" )
if ( ${vlib}_FOUND)
message( STATUS "External library ${CGAL_COMPONENT} has been preconfigured")
use_lib( ${CGAL_COMPONENT} "###${${vlib}_USE_FILE}")
else()
message( STATUS "External library ${CGAL_COMPONENT} has not been preconfigured")
find_package( ${CGAL_COMPONENT} )
message( STATUS "External library ${vlib} after find")
if (${vlib}_FOUND)
use_lib( ${CGAL_COMPONENT} "###${${vlib}_USE_FILE}")
endif()
endif()
endif()
endif(WITH_CGAL_${CGAL_COMPONENT})
use_component( ${component} )
endforeach()
# these two are mandatory
use_component( GMP )
use_component( MPFR )
include_directories( "${CMAKE_CURRENT_BINARY_DIR}" )