Skip to content

Commit

Permalink
Merge pull request #8556 from soesau/PSP3-cmake_tbb-GF
Browse files Browse the repository at this point in the history
[PSP3] Updated TBB support in PSP3 CMakeLists.txt
  • Loading branch information
sloriot committed Oct 18, 2024
2 parents aed66d9 + ba33ac6 commit 6065757
Showing 1 changed file with 42 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,9 @@ endif()
# Activate concurrency?
option(CGAL_ACTIVATE_CONCURRENT_PSP3 "Enable concurrency" OFF)

set(CGAL_libs CGAL::CGAL)
if(CGAL_ACTIVATE_CONCURRENT_PSP3 OR "$ENV{CGAL_ACTIVATE_CONCURRENT_PSP3}")
find_package(TBB REQUIRED)
include(CGAL_TBB_support)
if(TARGET CGAL::TBB_support)
set(CGAL_TBB_target ${CGAL_libs} CGAL::TBB_support)
endif()
endif()

# Executables that do *not* require EIGEN
Expand Down Expand Up @@ -61,8 +57,8 @@ if(NOT MSVC_VERSION OR MSVC_VERSION GREATER_EQUAL 1919 OR MSVC_VERSION LESS 1910
if (TARGET CGAL::LASLIB_support)
create_single_source_cgal_program("read_las_example.cpp")
create_single_source_cgal_program("write_las_example.cpp")
target_link_libraries(read_las_example PRIVATE ${CGAL_libs} CGAL::LASLIB_support)
target_link_libraries(write_las_example PRIVATE ${CGAL_libs} CGAL::LASLIB_support)
target_link_libraries(read_las_example PRIVATE CGAL::LASLIB_support)
target_link_libraries(write_las_example PRIVATE CGAL::LASLIB_support)
else()
message(STATUS "NOTICE : the LAS reader test requires LASlib and will not be compiled.")
endif()
Expand All @@ -74,35 +70,51 @@ endif()
find_package(Eigen3 3.1.0 QUIET) #(requires 3.1.0 or greater)
include(CGAL_Eigen3_support)
if(TARGET CGAL::Eigen3_support)
set(CGAL_libs ${CGAL_libs} CGAL::Eigen3_support)

# Executables that require Eigen
foreach(
target
jet_smoothing_example
normal_estimation
callback_example
clustering_example
edges_example
callback_example
scale_estimation_example
scale_estimation_2d_example
hierarchy_simplification_example
normals_example)
jet_smoothing_example
normal_estimation
normals_example
scale_estimation_example
scale_estimation_2d_example)
create_single_source_cgal_program("${target}.cpp")
target_link_libraries(${target} PRIVATE ${CGAL_libs})
target_link_libraries(${target} PRIVATE CGAL::Eigen3_support)
endforeach()

if (TARGET CGAL::TBB_support)
foreach(
target
callback_example
clustering_example
jet_smoothing_example
normal_estimation
normals_example
scale_estimation_example)
target_link_libraries(${target} PRIVATE CGAL::TBB_support)
endforeach()
endif()

if (TARGET CGAL::Eigen3_support AND TARGET CGAL::LASLIB_support)
create_single_source_cgal_program( "orient_scanlines_example.cpp" )
target_link_libraries(orient_scanlines_example PRIVATE ${CGAL_libs}
target_link_libraries(orient_scanlines_example PRIVATE
CGAL::Eigen3_support CGAL::LASLIB_support)
if (TARGET CGAL::TBB_support)
target_link_libraries(orient_scanlines_example PRIVATE CGAL::TBB_support)
endif()
endif()

# Executables that require libpointmatcher
find_package(libpointmatcher QUIET)
include(CGAL_pointmatcher_support)
if(TARGET CGAL::pointmatcher_support)
create_single_source_cgal_program("registration_with_pointmatcher.cpp")
target_link_libraries(registration_with_pointmatcher PRIVATE ${CGAL_libs}
target_link_libraries(registration_with_pointmatcher PRIVATE CGAL::Eigen3_support
CGAL::pointmatcher_support)
else()
message(STATUS "NOTICE: registration with pointmatcher requires libpointmatcher and will not be compiled.")
Expand All @@ -120,7 +132,7 @@ if(TARGET CGAL::Eigen3_support)

if(TARGET CGAL::OpenGR_support)
create_single_source_cgal_program("registration_with_OpenGR.cpp")
target_link_libraries(registration_with_OpenGR PRIVATE ${CGAL_libs}
target_link_libraries(registration_with_OpenGR PRIVATE CGAL::Eigen3_support
CGAL::OpenGR_support)
else()
message(STATUS "NOTICE: registration_with_OpenGR requires OpenGR, and will not be compiled.")
Expand All @@ -131,7 +143,7 @@ if(TARGET CGAL::Eigen3_support)
TARGET CGAL::OpenGR_support)
create_single_source_cgal_program("registration_with_opengr_pointmatcher_pipeline.cpp")
target_link_libraries(
registration_with_opengr_pointmatcher_pipeline PRIVATE ${CGAL_libs}
registration_with_opengr_pointmatcher_pipeline PRIVATE CGAL::Eigen3_support
CGAL::pointmatcher_support CGAL::OpenGR_support)
else()
message(STATUS "NOTICE: registration with OpenGR and pointmatcher requires both libpointmatcher and OpenGR, and will not be compiled.")
Expand All @@ -140,3 +152,15 @@ if(TARGET CGAL::Eigen3_support)
else()
message(STATUS "NOTICE: Some of the executables in this directory require Eigen 3.1 (or greater), and will not be compiled.")
endif()

if(CGAL_ACTIVATE_CONCURRENT_MESH_3 AND TARGET CGAL::TBB_support)
foreach(
target
average_spacing_example
bilateral_smooth_point_set_example
edge_aware_upsample_point_set_example
remove_outliers_example
wlop_simplify_and_regularize_point_set_example)
target_link_libraries(${target} PRIVATE CGAL::TBB_support)
endforeach()
endif()

0 comments on commit 6065757

Please sign in to comment.