mirror of https://github.com/CGAL/cgal
Fix CGAL_USE_VTK/OpenMesh being defined for all programs
but not all programs are linked!
This commit is contained in:
parent
093af2caec
commit
374e1778e5
|
|
@ -31,7 +31,6 @@ find_package( OpenMesh QUIET )
|
|||
|
||||
if ( OpenMesh_FOUND )
|
||||
include( UseOpenMesh )
|
||||
add_definitions( -DCGAL_USE_OPENMESH )
|
||||
else()
|
||||
message(STATUS "Examples that use OpenMesh will not be compiled.")
|
||||
endif()
|
||||
|
|
@ -69,6 +68,7 @@ create_single_source_cgal_program( "copy_polyhedron.cpp" )
|
|||
|
||||
if(OpenMesh_FOUND)
|
||||
target_link_libraries( copy_polyhedron PRIVATE ${OPENMESH_LIBRARIES} )
|
||||
target_compile_definitions( copy_polyhedron PRIVATE -DCGAL_USE_OPENMESH )
|
||||
endif()
|
||||
|
||||
if( METIS_FOUND )
|
||||
|
|
|
|||
|
|
@ -4,39 +4,27 @@
|
|||
cmake_minimum_required(VERSION 3.1...3.15)
|
||||
project( BGL_Tests )
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# CGAL and its components
|
||||
find_package( CGAL QUIET COMPONENTS )
|
||||
find_package(VTK QUIET COMPONENTS
|
||||
vtkCommonCore vtkIOCore vtkIOLegacy vtkIOXML vtkFiltersCore vtkFiltersSources)
|
||||
if ( NOT CGAL_FOUND )
|
||||
|
||||
message(STATUS "This project requires the CGAL library, and will not be compiled.")
|
||||
return()
|
||||
|
||||
endif()
|
||||
|
||||
# Boost and its components
|
||||
find_package( Boost )
|
||||
|
||||
if ( NOT Boost_FOUND )
|
||||
message(STATUS "This project requires the Boost library, and will not be compiled.")
|
||||
return()
|
||||
endif()
|
||||
|
||||
find_package( OpenMesh QUIET )
|
||||
|
||||
if ( OpenMesh_FOUND )
|
||||
include( UseOpenMesh )
|
||||
add_definitions( -DCGAL_USE_OPENMESH )
|
||||
else()
|
||||
message(STATUS "Tests that use OpenMesh will not be compiled.")
|
||||
endif()
|
||||
|
||||
|
||||
# include for local package
|
||||
|
||||
# Creating entries for all .cpp/.C files with "main" routine
|
||||
|
|
@ -102,25 +90,36 @@ create_single_source_cgal_program( "test_Properties.cpp" )
|
|||
create_single_source_cgal_program( "bench_read_from_stream_vs_add_face_and_add_faces.cpp" )
|
||||
|
||||
if(OpenMesh_FOUND)
|
||||
target_link_libraries( test_clear PRIVATE ${OPENMESH_LIBRARIES})
|
||||
target_link_libraries( test_Euler_operations PRIVATE ${OPENMESH_LIBRARIES})
|
||||
target_link_libraries( test_Collapse_edge PRIVATE ${OPENMESH_LIBRARIES})
|
||||
target_link_libraries( test_Face_filtered_graph PRIVATE ${OPENMESH_LIBRARIES})
|
||||
target_link_libraries( test_graph_traits PRIVATE ${OPENMESH_LIBRARIES} )
|
||||
target_link_libraries( test_Properties PRIVATE ${OPENMESH_LIBRARIES})
|
||||
target_link_libraries( test_bgl_read_write PRIVATE ${OPENMESH_LIBRARIES})
|
||||
target_link_libraries(test_clear PRIVATE ${OPENMESH_LIBRARIES})
|
||||
target_compile_definitions(test_clear PRIVATE -DCGAL_USE_OPENMESH)
|
||||
target_link_libraries(test_Euler_operations PRIVATE ${OPENMESH_LIBRARIES})
|
||||
target_compile_definitions(test_Euler_operations PRIVATE -DCGAL_USE_OPENMESH)
|
||||
target_link_libraries(test_Collapse_edge PRIVATE ${OPENMESH_LIBRARIES})
|
||||
target_compile_definitions(test_Collapse_edge PRIVATE -DCGAL_USE_OPENMESH)
|
||||
target_link_libraries(test_Face_filtered_graph PRIVATE ${OPENMESH_LIBRARIES})
|
||||
target_compile_definitions(test_Face_filtered_graph PRIVATE -DCGAL_USE_OPENMESH)
|
||||
target_link_libraries(test_graph_traits PRIVATE ${OPENMESH_LIBRARIES} )
|
||||
target_compile_definitions(test_graph_traits PRIVATE -DCGAL_USE_OPENMESH)
|
||||
target_link_libraries(test_Properties PRIVATE ${OPENMESH_LIBRARIES})
|
||||
target_compile_definitions(test_Properties PRIVATE -DCGAL_USE_OPENMESH)
|
||||
target_link_libraries(test_bgl_read_write PRIVATE ${OPENMESH_LIBRARIES})
|
||||
target_compile_definitions(test_bgl_read_write PRIVATE -DCGAL_USE_OPENMESH)
|
||||
endif()
|
||||
|
||||
find_package(VTK QUIET COMPONENTS vtkCommonCore vtkIOCore vtkIOLegacy vtkIOXML vtkFiltersCore vtkFiltersSources)
|
||||
if (VTK_FOUND)
|
||||
if(VTK_USE_FILE)
|
||||
include(${VTK_USE_FILE})
|
||||
endif()
|
||||
|
||||
if ("${VTK_VERSION_MAJOR}" GREATER "5" OR VTK_VERSION VERSION_GREATER 5)
|
||||
if(TARGET VTK::CommonCore)
|
||||
set(VTK_LIBRARIES VTK::CommonCore VTK::IOCore VTK::IOLegacy VTK::IOXML VTK::FiltersCore VTK::FiltersSources)
|
||||
endif()
|
||||
|
||||
if(VTK_LIBRARIES)
|
||||
add_definitions(-DCGAL_USE_VTK)
|
||||
target_link_libraries( test_bgl_read_write PRIVATE ${VTK_LIBRARIES})
|
||||
target_link_libraries(test_bgl_read_write PRIVATE ${VTK_LIBRARIES})
|
||||
target_compile_definitions(test_bgl_read_write PRIVATE -DCGAL_USE_VTK)
|
||||
else()
|
||||
message(STATUS "Tests that use VTK will not be compiled.")
|
||||
endif()
|
||||
|
|
|
|||
Loading…
Reference in New Issue