Remove preconfigured 3rd party libs options

This commit is contained in:
Maxime Gimeno 2020-10-05 14:37:38 +02:00
parent 0635d8992a
commit 27589e4b26
4 changed files with 19 additions and 45 deletions

View File

@ -610,8 +610,6 @@ endforeach()
# The following variables are in the cache just so subdirectories can set them persistently.
# But they are not intended to persist from run to run as normal cache variables.
# Similar variables are created when a library is detected.
#
cache_set(CGAL_3RD_PARTY_PRECONFIGURED "" )
cache_set(CGAL_3RD_PARTY_DEFINITIONS "" )
cache_set(CGAL_3RD_PARTY_INCLUDE_DIRS "" )
@ -619,7 +617,6 @@ cache_set(CGAL_3RD_PARTY_LIBRARIES "" )
cache_set(CGAL_3RD_PARTY_LIBRARIES_DIRS "" )
# default is on, but some use-cases need to set it to off, e.g., debian packages
option( CGAL_ENABLE_PRECONFIG "Select to allow to preconfiguration of external libraries" ON)
# additional info: some header files in CGAL add additional code if
# certain optional libs are installed, and some examples/tests rely on
@ -753,8 +750,6 @@ endforeach()
include_directories (${CGAL_INCLUDE_DIRS})
cache_get(CGAL_3RD_PARTY_PRECONFIGURED )
cache_get(CGAL_3RD_PARTY_DEFINITIONS )
cache_get(CGAL_3RD_PARTY_INCLUDE_DIRS )
cache_get(CGAL_3RD_PARTY_LIBRARIES )

View File

@ -308,9 +308,8 @@ if( NOT CGAL_MACROS_FILE_INCLUDED )
set( vlib "${CGAL_EXT_LIB_${component}_PREFIX}" )
if ( NOT CGAL_IGNORE_PRECONFIGURED_${component} AND ${vlib}_FOUND)
if (${vlib}_FOUND)
####message( STATUS "External library ${component} has been preconfigured")
use_lib( ${component} ${${vlib}_USE_FILE})
else()
@ -411,28 +410,24 @@ if( NOT CGAL_MACROS_FILE_INCLUDED )
foreach( lib ${CGAL_SUPPORTING_3RD_PARTY_LIBRARIES} )
list( FIND CGAL_ESSENTIAL_3RD_PARTY_LIBRARIES "${lib}" POSITION )
# if lib is essential or preconfiguration for an activated library ...
if ( ("${POSITION}" STRGREATER "-1") OR ( CGAL_ENABLE_PRECONFIG AND WITH_${lib} ))
# if lib is essential ...
if ( ("${POSITION}" STRGREATER "-1") )
set (vlib ${CGAL_EXT_LIB_${lib}_PREFIX} )
#the next 'if' is needed to avoid ${vlib} config variables to be overidden in case of a local configuration change
file( APPEND ${CMAKE_BINARY_DIR}/CGALConfig.cmake "if (NOT CGAL_IGNORE_PRECONFIGURED_${lib})\n")
file( APPEND ${CMAKE_BINARY_DIR}/CGALConfig.cmake " set( ${vlib}_FOUND \"${${vlib}_FOUND}\" )\n")
file( APPEND ${CMAKE_BINARY_DIR}/CGALConfig.cmake " set( ${vlib}_USE_FILE \"${${vlib}_USE_FILE}\" )\n")
file( APPEND ${CMAKE_BINARY_DIR}/CGALConfig.cmake " set( ${vlib}_INCLUDE_DIR \"${${vlib}_INCLUDE_DIR}\" )\n")
file( APPEND ${CMAKE_BINARY_DIR}/CGALConfig.cmake " set( ${vlib}_LIBRARIES \"${${vlib}_LIBRARIES}\" )\n")
file( APPEND ${CMAKE_BINARY_DIR}/CGALConfig.cmake " set( ${vlib}_DEFINITIONS \"${${vlib}_DEFINITIONS}\" )\n")
file( APPEND ${CMAKE_BINARY_DIR}/CGALConfig.cmake "endif()\n\n")
#the next 'if' is needed to avoid ${vlib} config variables to be overidden in case of a local configuration change
file( APPEND ${CMAKE_BINARY_DIR}/config/CGALConfig.cmake "if (NOT CGAL_IGNORE_PRECONFIGURED_${lib})\n")
file( APPEND ${CMAKE_BINARY_DIR}/config/CGALConfig.cmake " set( ${vlib}_FOUND \"${${vlib}_FOUND}\")\n")
file( APPEND ${CMAKE_BINARY_DIR}/config/CGALConfig.cmake " set( ${vlib}_USE_FILE \"${${vlib}_USE_FILE}\" )\n")
file( APPEND ${CMAKE_BINARY_DIR}/config/CGALConfig.cmake " set( ${vlib}_INCLUDE_DIR \"${${vlib}_INCLUDE_DIR}\" )\n")
file( APPEND ${CMAKE_BINARY_DIR}/config/CGALConfig.cmake " set( ${vlib}_LIBRARIES \"${${vlib}_LIBRARIES}\" )\n")
file( APPEND ${CMAKE_BINARY_DIR}/config/CGALConfig.cmake " set( ${vlib}_DEFINITIONS \"${${vlib}_DEFINITIONS}\" )\n")
file( APPEND ${CMAKE_BINARY_DIR}/config/CGALConfig.cmake "endif()\n\n")
endif()
endforeach()

View File

@ -18,25 +18,13 @@ foreach (lib ${CGAL_SUPPORTING_3RD_PARTY_LIBRARIES})
#message (STATUS "With ${lib} given or essential: pos=${POSITION}")
if ( CGAL_ENABLE_PRECONFIG )
message (STATUS "Preconfiguring library: ${lib} ...")
else()
message (STATUS "Configuring library: ${lib} ...")
endif()
find_package( ${lib} )
if ( ${vlib}_FOUND )
if ( CGAL_ENABLE_PRECONFIG )
message( STATUS "${lib} has been preconfigured:")
message( STATUS " Use${lib}-file: ${${vlib}_USE_FILE}")
message( STATUS " ${lib} include: ${${vlib}_INCLUDE_DIR}" )
message( STATUS " ${lib} libraries: ${${vlib}_LIBRARIES}" )
message( STATUS " ${lib} definitions: ${${vlib}_DEFINITIONS}" )
else()
message( STATUS "${lib} has been configured")
use_lib( ${vlib} ${${vlib}_USE_FILE})
endif()
# TODO EBEB what about Qt5, zlib etc?
set ( CGAL_USE_${vlib} TRUE )

View File

@ -30,11 +30,7 @@ if( MPFI_FOUND AND NOT MPFI_SETUP )
add_definitions( ${MPFI_DEFINITIONS} "-DCGAL_USE_MPFI" )
link_libraries( ${MPFI_LIBRARIES} )
else( COMPILED_MPFI_TEST AND MPFI_TEST_RESULT EQUAL 0)
if (CGAL_ENABLE_PRECONFIG)
message( STATUS "MPFI is incorrectly configured with CGAL" )
else()
message( STATUS "MPFI is incorrectly configured on this system" )
endif()
message( STATUS
"Output of the failed MPFI test was:\n${MPFI_TEST_COMPILATION_OUTPUT}" )
message( STATUS "End of the MPFI test output" )