mirror of https://github.com/CGAL/cgal
added CGAL_ENABLE_PRECONFIG (the default value has to be determined)
This commit is contained in:
parent
7a9557e414
commit
3fde316a6c
|
|
@ -1,7 +1,7 @@
|
||||||
# Created by the script cgal_create_cmake_script_with_options
|
# Created by the script cgal_create_CMakeLists
|
||||||
# This is the CMake script for compiling a set of CGAL applications.
|
# This is the CMake script for compiling a set of CGAL applications.
|
||||||
|
|
||||||
project( Algebraic_kernel_d )
|
project( Algebraic_kernel_d_test )
|
||||||
|
|
||||||
cmake_minimum_required(VERSION 2.6.2)
|
cmake_minimum_required(VERSION 2.6.2)
|
||||||
if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" VERSION_GREATER 2.6)
|
if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" VERSION_GREATER 2.6)
|
||||||
|
|
@ -12,16 +12,9 @@ if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" VERSION_GREATER 2.6)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set( CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS true )
|
|
||||||
|
|
||||||
if ( COMMAND cmake_policy )
|
|
||||||
|
|
||||||
cmake_policy( SET CMP0003 NEW )
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# CGAL and its components
|
# CGAL and its components
|
||||||
#find_package( CGAL QUIET COMPONENTS GMP MPFR MPFI RS3 )
|
find_package( CGAL QUIET COMPONENTS Core GMP MPFR MPFI RS3 )
|
||||||
find_package( CGAL QUIET COMPONENTS ALL_PRECONFIGURED_LIBS )
|
|
||||||
if ( NOT CGAL_FOUND )
|
if ( NOT CGAL_FOUND )
|
||||||
|
|
||||||
message(STATUS "This project requires the CGAL library, and will not be compiled.")
|
message(STATUS "This project requires the CGAL library, and will not be compiled.")
|
||||||
|
|
|
||||||
|
|
@ -541,11 +541,13 @@ cache_set(CGAL_3RD_PARTY_INCLUDE_DIRS "" )
|
||||||
cache_set(CGAL_3RD_PARTY_LIBRARIES "" )
|
cache_set(CGAL_3RD_PARTY_LIBRARIES "" )
|
||||||
cache_set(CGAL_3RD_PARTY_LIBRARIES_DIRS "" )
|
cache_set(CGAL_3RD_PARTY_LIBRARIES_DIRS "" )
|
||||||
|
|
||||||
include(CGAL_SetupDependencies)
|
# TODO default for CGAL_ENABLE_PRECONFIG = ON?
|
||||||
|
option( CGAL_ENABLE_PRECONFIG "Select to allow to preconfiguration of external libraries" OFF)
|
||||||
option( CGAL_ALLOW_ALL_PRECONFIGURED_LIBS_COMPONENT "Select to allow
|
option( CGAL_ALLOW_ALL_PRECONFIGURED_LIBS_COMPONENT "Select to allow
|
||||||
to use all preconfigured external libraries" OFF)
|
to use all preconfigured external libraries" OFF)
|
||||||
|
|
||||||
|
include(CGAL_SetupDependencies)
|
||||||
|
|
||||||
message("== Detect external libraries (DONE) ==\n")
|
message("== Detect external libraries (DONE) ==\n")
|
||||||
|
|
||||||
#--------------------------------------------------------------------------------------------------
|
#--------------------------------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
|
@ -134,6 +134,7 @@ endforeach()
|
||||||
set( CGAL_REQUESTED_COMPONENTS ${CGAL_FIND_COMPONENTS} )
|
set( CGAL_REQUESTED_COMPONENTS ${CGAL_FIND_COMPONENTS} )
|
||||||
|
|
||||||
# for preconfigured libs
|
# for preconfigured libs
|
||||||
|
set(CGAL_ENABLE_PRECONFIG "@CGAL_ENABLE_PRECONFIG@")
|
||||||
set(CGAL_SUPPORTING_3RD_PARTY_LIBRARIES "@CGAL_SUPPORTING_3RD_PARTY_LIBRARIES@")
|
set(CGAL_SUPPORTING_3RD_PARTY_LIBRARIES "@CGAL_SUPPORTING_3RD_PARTY_LIBRARIES@")
|
||||||
set(CGAL_MANDATORY_3RD_PARTY_LIBRARIES "@CGAL_MANDATORY_3RD_PARTY_LIBRARIES@")
|
set(CGAL_MANDATORY_3RD_PARTY_LIBRARIES "@CGAL_MANDATORY_3RD_PARTY_LIBRARIES@")
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -134,6 +134,7 @@ endforeach()
|
||||||
set( CGAL_REQUESTED_COMPONENTS ${CGAL_FIND_COMPONENTS} )
|
set( CGAL_REQUESTED_COMPONENTS ${CGAL_FIND_COMPONENTS} )
|
||||||
|
|
||||||
# for preconfigured libs
|
# for preconfigured libs
|
||||||
|
set(CGAL_ENABLE_PRECONFIG "@CGAL_ENABLE_PRECONFIG@")
|
||||||
set(CGAL_SUPPORTING_3RD_PARTY_LIBRARIES "@CGAL_SUPPORTING_3RD_PARTY_LIBRARIES@")
|
set(CGAL_SUPPORTING_3RD_PARTY_LIBRARIES "@CGAL_SUPPORTING_3RD_PARTY_LIBRARIES@")
|
||||||
set(CGAL_MANDATORY_3RD_PARTY_LIBRARIES "@CGAL_MANDATORY_3RD_PARTY_LIBRARIES@")
|
set(CGAL_MANDATORY_3RD_PARTY_LIBRARIES "@CGAL_MANDATORY_3RD_PARTY_LIBRARIES@")
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -380,6 +380,8 @@ if( NOT CGAL_MACROS_FILE_INCLUDED )
|
||||||
# There is also a version of CGALConfig.cmake that is prepared in case CGAL in installed in CMAKE_INSTALL_PREFIX.
|
# There is also a version of CGALConfig.cmake that is prepared in case CGAL in installed in CMAKE_INSTALL_PREFIX.
|
||||||
configure_file("${CGAL_MODULES_DIR}/CGALConfig_install.cmake.in" "${CMAKE_BINARY_DIR}/config/CGALConfig.cmake" @ONLY)
|
configure_file("${CGAL_MODULES_DIR}/CGALConfig_install.cmake.in" "${CMAKE_BINARY_DIR}/config/CGALConfig.cmake" @ONLY)
|
||||||
|
|
||||||
|
if (CGAL_ENABLE_PRECONFIG)
|
||||||
|
|
||||||
foreach( lib ${CGAL_SUPPORTING_3RD_PARTY_LIBRARIES} )
|
foreach( lib ${CGAL_SUPPORTING_3RD_PARTY_LIBRARIES} )
|
||||||
|
|
||||||
if ( WITH_${lib} )
|
if ( WITH_${lib} )
|
||||||
|
|
@ -403,6 +405,7 @@ if( NOT CGAL_MACROS_FILE_INCLUDED )
|
||||||
endif ( WITH_${lib} )
|
endif ( WITH_${lib} )
|
||||||
|
|
||||||
endforeach()
|
endforeach()
|
||||||
|
endif()
|
||||||
|
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -14,20 +14,30 @@ foreach (lib ${CGAL_SUPPORTING_3RD_PARTY_LIBRARIES})
|
||||||
|
|
||||||
# message (STATUS "With ${lib} given")
|
# message (STATUS "With ${lib} given")
|
||||||
|
|
||||||
|
if ( CGAL_ENABLE_PRECONFIG )
|
||||||
message (STATUS "Preconfiguring library: ${lib} ...")
|
message (STATUS "Preconfiguring library: ${lib} ...")
|
||||||
|
else()
|
||||||
|
message (STATUS "Configuring library: ${lib} ...")
|
||||||
|
endif()
|
||||||
|
|
||||||
find_package( ${lib} )
|
find_package( ${lib} )
|
||||||
|
|
||||||
if ( ${vlib}_FOUND )
|
if ( ${vlib}_FOUND )
|
||||||
|
if ( CGAL_ENABLE_PRECONFIG )
|
||||||
message( STATUS "${lib} has been preconfigured:")
|
message( STATUS "${lib} has been preconfigured:")
|
||||||
message( STATUS " CGAL_Use${lib}-file: ${${vlib}_USE_FILE}")
|
message( STATUS " CGAL_Use${lib}-file: ${${vlib}_USE_FILE}")
|
||||||
message( STATUS " ${lib} include: ${${vlib}_INCLUDE_DIR}" )
|
message( STATUS " ${lib} include: ${${vlib}_INCLUDE_DIR}" )
|
||||||
message( STATUS " ${lib} libraries: ${${vlib}_LIBRARIES}" )
|
message( STATUS " ${lib} libraries: ${${vlib}_LIBRARIES}" )
|
||||||
message( STATUS " ${lib} definitions: ${${vlib}_DEFINITIONS}" )
|
message( STATUS " ${lib} definitions: ${${vlib}_DEFINITIONS}" )
|
||||||
|
else()
|
||||||
|
message( STATUS "${lib} has been configured")
|
||||||
|
use_lib( ${vlib} "###${${vlib}_USE_FILE}")
|
||||||
|
endif()
|
||||||
|
|
||||||
# TODO EBEB what about Qt3, Qt4, zlib etc?
|
# TODO EBEB what about Qt3, Qt4, zlib etc?
|
||||||
set ( CGAL_USE_${vlib} TRUE )
|
set ( CGAL_USE_${vlib} TRUE )
|
||||||
|
|
||||||
|
|
||||||
# Part 2: Add some lib-specific definitions or obtain version
|
# Part 2: Add some lib-specific definitions or obtain version
|
||||||
|
|
||||||
if (${lib} STREQUAL "GMP")
|
if (${lib} STREQUAL "GMP")
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,11 @@ if( MPFI_FOUND AND NOT MPFI_SETUP )
|
||||||
add_definitions( ${MPFI_DEFINITIONS} "-DCGAL_USE_MPFI" )
|
add_definitions( ${MPFI_DEFINITIONS} "-DCGAL_USE_MPFI" )
|
||||||
link_libraries( ${MPFI_LIBRARIES} )
|
link_libraries( ${MPFI_LIBRARIES} )
|
||||||
else( COMPILED_MPFI_TEST AND MPFI_TEST_RESULT EQUAL 0)
|
else( COMPILED_MPFI_TEST AND MPFI_TEST_RESULT EQUAL 0)
|
||||||
message( STATUS "MPFI was incorrectly configured on this system" )
|
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
|
message( STATUS
|
||||||
"Output of the failed MPFI test was:\n${MPFI_TEST_COMPILATION_OUTPUT}" )
|
"Output of the failed MPFI test was:\n${MPFI_TEST_COMPILATION_OUTPUT}" )
|
||||||
message( STATUS "End of the MPFI test output" )
|
message( STATUS "End of the MPFI test output" )
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue