Deal with the IPE, RS, and LEDA dependencies

For RS and LEDA, it seems it does not work correctly.
This commit is contained in:
Laurent Rineau 2016-09-26 15:57:37 +02:00
parent 67e9da4770
commit c76eec40b9
1 changed files with 54 additions and 25 deletions

View File

@ -1028,6 +1028,10 @@ if ( CGAL_BRANCH_BUILD )
find_package(Qt5 COMPONENTS Core Widgets Xml OpenGL REQUIRED)
find_package(QGLViewer)
find_package(VTK COMPONENTS vtkImagingGeneral vtkIOImage NO_MODULE)
find_package(IPE)
find_package(RS3)
find_package(LEDA)
set(compile_options "\
${CMAKE_CXX_FLAGS} -DCGAL_EIGEN3_ENABLED \
${Qt5Widgets_DEFINITIONS} ${Qt5Xml_DEFINITIONS} ${Qt5OpenGL_DEFINITIONS} \
@ -1038,6 +1042,24 @@ ${CGAL_3RD_PARTY_DEFINITIONS} ${CGAL_Qt5_3RD_PARTY_DEFINITIONS} \
${CGAL_DEFINITIONS}"
)
if(NOT RS_FOUND AND NOT RS3_FOUND)
set(compile_options "${compile_options} \
-DCGAL_ALGEBRAIC_KERNEL_RS_GMPZ_D_1=1 \
-DCGAL_ALGEBRAIC_KERNEL_RS_GMPQ_D_1=1")
message(STATUS "Skip RS headers \"CGAL/Algebraic_kernel_rs_gmpq_d_1.h\" \
and \"CGAL/Algebraic_kernel_rs_gmpz_d_1.h\" because RS_FOUND is false.")
endif()
if(LEDA_FOUND)
set(compile_options "${compile_options} -DCGAL_USE_LEDA")
endif()
if(NOT IPE_FOUND)
set(compile_options "${compile_options} -DCGAL_IPELET_BASE_H=1")
message(STATUS "Skip header \"CGAL/CGAL_ipelet_base.h\" \
because IPE_FOUND is false.")
endif()
if ("${IPE_VERSION}" EQUAL "7")
set(compile_options "${compile_options} -DCGAL_USE_IPE_7")
endif()
if(NOT DEFINED CGAL_CHECK_SYNTAX_ONLY)
execute_process(COMMAND
@ -1063,6 +1085,8 @@ You must disable CGAL_ENABLE_CHECK_HEADERS.")
endforeach()
foreach (incdir
${VTK_INCLUDE_DIRS}
${LEDA_INCLUDE_DIR}
${RS_INCLUDE_DIR}
${EIGEN3_INCLUDE_DIR}
${QGLVIEWER_INCLUDE_DIR} ${Qt5OpenGL_INCLUDE_DIRS}
${Qt5Widgets_INCLUDE_DIRS} ${Qt5Xml_INCLUDE_DIRS}
@ -1101,6 +1125,8 @@ You must disable CGAL_ENABLE_CHECK_HEADERS.")
OR NOT has_list_of_documented_headers
OR header IN_LIST list_of_documented_headers
)
string(REGEX MATCH "CGAL/leda_.*" is_a_leda_header ${header})
if(LEDA_FOUND OR NOT is_a_leda_header)
string(REPLACE "/" "__" header2 "${header}")
string(REPLACE "." "_" header2 "${header2}")
string(REPLACE ";" " " include_options_str "${include_options}")
@ -1110,7 +1136,6 @@ You must disable CGAL_ENABLE_CHECK_HEADERS.")
"${CMAKE_CXX_COMPILER} ${compile_options_str}
${include_options_str} -x c++ -fsyntax-only \
${compute_deps_extra_args} \
-DCGAL_ALGEBRAIC_KERNEL_RS_GMPZ_D_1=1 \
${CMAKE_CURRENT_SOURCE_DIR}/../${package}/include/${header}"
# The header Algebraic_kernel_rs_gmpz_d_1.h is skipped on purpose: it
# depends on RS.
@ -1129,6 +1154,10 @@ ${CMAKE_CURRENT_SOURCE_DIR}/../${package}/include/${header}"
if(${header2}_deps)
list(REMOVE_DUPLICATES ${header2}_deps)
endif()
else()
message(STATUS "Skip LEDA header \"${header}\" because \
LEDA_FOUND is false.")
endif()
else()
message(STATUS "Skip non-documented header \"${header}\".")
endif() # end the if on list_of_documented_headers