@@ -45,44 +45,22 @@ endfunction()
4545
4646function (itlabai_use_opencv target_name )
4747 itlabai_use_externals_scope (_scope ${target_name} )
48- if (TARGET OpenCV::opencv_world)
49- target_link_libraries (${target_name} ${_scope} OpenCV::opencv_world )
50- endif ()
51- if (TARGET opencv_external)
52- add_dependencies (${target_name} opencv_external )
53- endif ()
48+ target_link_libraries (${target_name} ${_scope} OpenCV::opencv_world )
5449endfunction ()
5550
5651function (itlabai_use_tbb target_name )
5752 itlabai_use_externals_scope (_scope ${target_name} )
58- if (TARGET TBB::tbb)
59- target_link_libraries (${target_name} ${_scope} TBB::tbb )
60- elseif (TARGET TBB_unified)
61- target_link_libraries (${target_name} ${_scope} TBB_unified )
62- endif ()
63- if (TARGET tbb_external)
64- add_dependencies (${target_name} tbb_external )
65- endif ()
53+ target_link_libraries (${target_name} ${_scope} TBB::tbb )
6654endfunction ()
6755
6856function (itlabai_use_onednn target_name )
6957 itlabai_use_externals_scope (_scope ${target_name} )
70- if (TARGET dnnl)
71- target_link_libraries (${target_name} ${_scope} dnnl )
72- endif ()
73- if (TARGET onednn_external)
74- add_dependencies (${target_name} onednn_external )
75- endif ()
58+ target_link_libraries (${target_name} ${_scope} dnnl )
7659endfunction ()
7760
7861function (itlabai_use_kokkos target_name )
7962 itlabai_use_externals_scope (_scope ${target_name} )
80- if (TARGET Kokkos_imported)
81- target_link_libraries (${target_name} ${_scope} Kokkos_imported )
82- endif ()
83- if (TARGET kokkos_external)
84- add_dependencies (${target_name} kokkos_external )
85- endif ()
63+ target_link_libraries (${target_name} ${_scope} Kokkos_imported )
8664 if (MSVC )
8765 # Suppress Kokkos header warning C4702 only on targets that use Kokkos.
8866 target_compile_options (${target_name} ${_scope} /wd4702 )
@@ -91,22 +69,12 @@ endfunction()
9169
9270function (itlabai_use_openmp target_name )
9371 itlabai_use_externals_scope (_scope ${target_name} )
94- if (TARGET OpenMP::OpenMP_CXX)
95- target_link_libraries (${target_name} ${_scope} OpenMP::OpenMP_CXX )
96- endif ()
72+ target_link_libraries (${target_name} ${_scope} OpenMP::OpenMP_CXX )
9773endfunction ()
9874
9975function (itlabai_use_gtest target_name )
10076 itlabai_use_externals_scope (_scope ${target_name} )
101- if (TARGET gtest_main)
102- target_link_libraries (${target_name} ${_scope} gtest_main )
103- endif ()
104- if (TARGET gtest)
105- target_link_libraries (${target_name} ${_scope} gtest )
106- endif ()
107- if (TARGET gtest_external)
108- add_dependencies (${target_name} gtest_external )
109- endif ()
77+ target_link_libraries (${target_name} ${_scope} gtest_main gtest )
11078endfunction ()
11179
11280function (itlabai_use_externals_scope out_var target_name )
@@ -129,7 +97,9 @@ function(itlabai_link_externals target_name)
12997 elseif (ext STREQUAL "kokkos" )
13098 itlabai_use_kokkos (${target_name} )
13199 elseif (ext STREQUAL "openmp" )
132- itlabai_use_openmp (${target_name} )
100+ if (ITLABAI_ENABLE_OPENMP)
101+ itlabai_use_openmp (${target_name} )
102+ endif ()
133103 elseif (ext STREQUAL "gtest" )
134104 itlabai_use_gtest (${target_name} )
135105 endif ()
0 commit comments