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(Qt5 COMPONENTS Core Widgets Xml OpenGL REQUIRED)
find_package(QGLViewer) find_package(QGLViewer)
find_package(VTK COMPONENTS vtkImagingGeneral vtkIOImage NO_MODULE) find_package(VTK COMPONENTS vtkImagingGeneral vtkIOImage NO_MODULE)
find_package(IPE)
find_package(RS3)
find_package(LEDA)
set(compile_options "\ set(compile_options "\
${CMAKE_CXX_FLAGS} -DCGAL_EIGEN3_ENABLED \ ${CMAKE_CXX_FLAGS} -DCGAL_EIGEN3_ENABLED \
${Qt5Widgets_DEFINITIONS} ${Qt5Xml_DEFINITIONS} ${Qt5OpenGL_DEFINITIONS} \ ${Qt5Widgets_DEFINITIONS} ${Qt5Xml_DEFINITIONS} ${Qt5OpenGL_DEFINITIONS} \
@ -1038,6 +1042,24 @@ ${CGAL_3RD_PARTY_DEFINITIONS} ${CGAL_Qt5_3RD_PARTY_DEFINITIONS} \
${CGAL_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) if(NOT DEFINED CGAL_CHECK_SYNTAX_ONLY)
execute_process(COMMAND execute_process(COMMAND
@ -1063,6 +1085,8 @@ You must disable CGAL_ENABLE_CHECK_HEADERS.")
endforeach() endforeach()
foreach (incdir foreach (incdir
${VTK_INCLUDE_DIRS} ${VTK_INCLUDE_DIRS}
${LEDA_INCLUDE_DIR}
${RS_INCLUDE_DIR}
${EIGEN3_INCLUDE_DIR} ${EIGEN3_INCLUDE_DIR}
${QGLVIEWER_INCLUDE_DIR} ${Qt5OpenGL_INCLUDE_DIRS} ${QGLVIEWER_INCLUDE_DIR} ${Qt5OpenGL_INCLUDE_DIRS}
${Qt5Widgets_INCLUDE_DIRS} ${Qt5Xml_INCLUDE_DIRS} ${Qt5Widgets_INCLUDE_DIRS} ${Qt5Xml_INCLUDE_DIRS}
@ -1100,34 +1124,39 @@ You must disable CGAL_ENABLE_CHECK_HEADERS.")
if(NOT POLICY CMP0057 if(NOT POLICY CMP0057
OR NOT has_list_of_documented_headers OR NOT has_list_of_documented_headers
OR header IN_LIST list_of_documented_headers OR header IN_LIST list_of_documented_headers
) )
string(REPLACE "/" "__" header2 "${header}") string(REGEX MATCH "CGAL/leda_.*" is_a_leda_header ${header})
string(REPLACE "." "_" header2 "${header2}") if(LEDA_FOUND OR NOT is_a_leda_header)
string(REPLACE ";" " " include_options_str "${include_options}") string(REPLACE "/" "__" header2 "${header}")
string(REPLACE ";" " " compile_options_str "${compile_options}") string(REPLACE "." "_" header2 "${header2}")
separate_arguments(CMD string(REPLACE ";" " " include_options_str "${include_options}")
UNIX_COMMAND string(REPLACE ";" " " compile_options_str "${compile_options}")
"${CMAKE_CXX_COMPILER} ${compile_options_str} separate_arguments(CMD
UNIX_COMMAND
"${CMAKE_CXX_COMPILER} ${compile_options_str}
${include_options_str} -x c++ -fsyntax-only \ ${include_options_str} -x c++ -fsyntax-only \
${compute_deps_extra_args} \ ${compute_deps_extra_args} \
-DCGAL_ALGEBRAIC_KERNEL_RS_GMPZ_D_1=1 \
${CMAKE_CURRENT_SOURCE_DIR}/../${package}/include/${header}" ${CMAKE_CURRENT_SOURCE_DIR}/../${package}/include/${header}"
# The header Algebraic_kernel_rs_gmpz_d_1.h is skipped on purpose: it # The header Algebraic_kernel_rs_gmpz_d_1.h is skipped on purpose: it
# depends on RS. # depends on RS.
) )
add_custom_command(OUTPUT check_${header2} add_custom_command(OUTPUT check_${header2}
COMMAND ${CMAKE_COMMAND} COMMAND ${CMAKE_COMMAND}
-DCERR:STRING=${CMAKE_CURRENT_BINARY_DIR}/check_${header2} -DCERR:STRING=${CMAKE_CURRENT_BINARY_DIR}/check_${header2}
"-DCMD:STRING=${CMD}" "-DCMD:STRING=${CMD}"
-P "${CGAL_MODULES_DIR}/run_cmd_redirection_cerr.cmake" -P "${CGAL_MODULES_DIR}/run_cmd_redirection_cerr.cmake"
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/../${package}/include/${header} DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/../${package}/include/${header}
DEPENDS ${CGAL_MODULES_DIR}/run_cmd_redirection_cerr.cmake DEPENDS ${CGAL_MODULES_DIR}/run_cmd_redirection_cerr.cmake
VERBATIM VERBATIM
COMMENT "Check header ${package}/include/${header}" COMMENT "Check header ${package}/include/${header}"
) )
list(APPEND check_pkg_headers_depends check_${header2}) list(APPEND check_pkg_headers_depends check_${header2})
if(${header2}_deps) if(${header2}_deps)
list(REMOVE_DUPLICATES ${header2}_deps) list(REMOVE_DUPLICATES ${header2}_deps)
endif()
else()
message(STATUS "Skip LEDA header \"${header}\" because \
LEDA_FOUND is false.")
endif() endif()
else() else()
message(STATUS "Skip non-documented header \"${header}\".") message(STATUS "Skip non-documented header \"${header}\".")