mirror of https://github.com/CGAL/cgal
Better CMake API for TBB
- new CMake module `CGAL_target_use_TBB` that defines a function, that enables TBB per target. - `UseTBB.cmake` is deprecated.
This commit is contained in:
parent
eb5f52869f
commit
af38caef16
|
|
@ -0,0 +1,12 @@
|
|||
if (CGAL_target_use_TBB_included)
|
||||
return()
|
||||
endif()
|
||||
set(CGAL_target_use_TBB_included TRUE)
|
||||
|
||||
function(CGAL_target_use_TBB target)
|
||||
set(keyword PUBLIC)
|
||||
|
||||
target_include_directories ( ${target} SYSTEM ${keyword} ${TBB_INCLUDE_DIRS} )
|
||||
target_link_libraries( ${target} ${keyword} ${TBB_LIBRARIES} )
|
||||
target_compile_options( ${target} ${keyword} -DNOMINMAX -DCGAL_LINKED_WITH_TBB )
|
||||
endfunction()
|
||||
|
|
@ -4,3 +4,5 @@
|
|||
include_directories ( ${TBB_INCLUDE_DIRS} )
|
||||
link_directories( ${TBB_LIBRARY_DIRS} )
|
||||
add_definitions( -DNOMINMAX -DCGAL_LINKED_WITH_TBB )
|
||||
|
||||
message(DEPRECATION "This file UseTBB.cmake is deprecated, and the function `CGAL_target_use_TBB` from CGAL_target_use_TBB.cmake should be used instead.")
|
||||
|
|
|
|||
|
|
@ -1,10 +1,6 @@
|
|||
# Created by the script cgal_create_cmake_script
|
||||
# This is the CMake script for compiling a CGAL application.
|
||||
|
||||
|
||||
project( Mesh_2_Examples )
|
||||
|
||||
cmake_minimum_required(VERSION 2.8.10)
|
||||
cmake_minimum_required(VERSION 2.8.12)
|
||||
|
||||
find_package(CGAL QUIET)
|
||||
|
||||
|
|
|
|||
|
|
@ -1,29 +1,11 @@
|
|||
# Created by the script cgal_create_cmake_script
|
||||
# This is the CMake script for compiling a CGAL application.
|
||||
|
||||
|
||||
project( Triangulation_3_Examples )
|
||||
|
||||
cmake_minimum_required(VERSION 2.8.11)
|
||||
cmake_minimum_required(VERSION 2.8.12)
|
||||
|
||||
|
||||
find_package(CGAL QUIET)
|
||||
|
||||
if ( CGAL_FOUND )
|
||||
|
||||
include( ${CGAL_USE_FILE} )
|
||||
|
||||
find_package( TBB QUIET )
|
||||
|
||||
if( TBB_FOUND )
|
||||
include(${TBB_USE_FILE})
|
||||
list(APPEND CGAL_3RD_PARTY_LIBRARIES ${TBB_LIBRARIES})
|
||||
endif()
|
||||
|
||||
include( CGAL_CreateSingleSourceCGALProgram )
|
||||
|
||||
include_directories (BEFORE "../../include")
|
||||
|
||||
create_single_source_cgal_program( "adding_handles_3.cpp" )
|
||||
create_single_source_cgal_program( "color.cpp" )
|
||||
create_single_source_cgal_program( "copy_triangulation_3.cpp" )
|
||||
|
|
@ -33,14 +15,27 @@ if ( CGAL_FOUND )
|
|||
create_single_source_cgal_program( "info_insert_with_pair_iterator_regular.cpp" )
|
||||
create_single_source_cgal_program( "info_insert_with_transform_iterator.cpp" )
|
||||
create_single_source_cgal_program( "info_insert_with_zip_iterator.cpp" )
|
||||
create_single_source_cgal_program( "parallel_insertion_and_removal_in_regular_3.cpp" )
|
||||
create_single_source_cgal_program( "parallel_insertion_in_delaunay_3.cpp" )
|
||||
create_single_source_cgal_program( "regular_3.cpp" )
|
||||
create_single_source_cgal_program( "regular_with_info_3.cpp" )
|
||||
create_single_source_cgal_program( "sequential_parallel.cpp" )
|
||||
create_single_source_cgal_program( "simple_triangulation_3.cpp" )
|
||||
create_single_source_cgal_program( "simplex.cpp" )
|
||||
|
||||
find_package( TBB QUIET )
|
||||
|
||||
if( TBB_FOUND )
|
||||
include( CGAL_target_use_TBB )
|
||||
|
||||
create_single_source_cgal_program( "parallel_insertion_and_removal_in_regular_3.cpp" )
|
||||
create_single_source_cgal_program( "parallel_insertion_in_delaunay_3.cpp" )
|
||||
create_single_source_cgal_program( "sequential_parallel.cpp" )
|
||||
CGAL_target_use_TBB( parallel_insertion_and_removal_in_regular_3 )
|
||||
CGAL_target_use_TBB( parallel_insertion_in_delaunay_3 )
|
||||
CGAL_target_use_TBB( sequential_parallel )
|
||||
else()
|
||||
message(STATUS "NOTICE: a few examples require TBB and will not be compiled.")
|
||||
endif()
|
||||
|
||||
else()
|
||||
|
||||
message(STATUS "This program requires the CGAL library, and will not be compiled.")
|
||||
|
|
|
|||
Loading…
Reference in New Issue