Commit 1ddcfc5c authored by Alexander Alekhin's avatar Alexander Alekhin

gapi: update CMakeLists.txt, fix TBB dependency handling

parent 774d28ef
...@@ -1412,7 +1412,9 @@ function(ocv_target_link_libraries target) ...@@ -1412,7 +1412,9 @@ function(ocv_target_link_libraries target)
foreach(dep ${LINK_DEPS}) foreach(dep ${LINK_DEPS})
if(" ${dep}" STREQUAL " ${target}") if(" ${dep}" STREQUAL " ${target}")
# prevent "link to itself" warning (world problem) # prevent "link to itself" warning (world problem)
elseif(" ${dep}" STREQUAL " LINK_PRIVATE" OR " ${dep}" STREQUAL "LINK_PUBLIC") elseif(" ${dep}" STREQUAL " LINK_PRIVATE" OR " ${dep}" STREQUAL "LINK_PUBLIC"
OR " ${dep}" STREQUAL " PRIVATE" OR " ${dep}" STREQUAL "PUBLIC"
)
if(NOT LINK_PENDING STREQUAL "") if(NOT LINK_PENDING STREQUAL "")
__ocv_push_target_link_libraries(${LINK_MODE} ${LINK_PENDING}) __ocv_push_target_link_libraries(${LINK_MODE} ${LINK_PENDING})
set(LINK_PENDING "") set(LINK_PENDING "")
......
# FIXME: Rework standalone build in more generic maner # FIXME: Rework standalone build in more generic maner
# (Restructure directories, add common pass, etc) # (Restructure directories, add common pass, etc)
if (NOT DEFINED OPENCV_INITIAL_PASS) if(NOT DEFINED OPENCV_INITIAL_PASS)
cmake_minimum_required(VERSION 3.3) cmake_minimum_required(VERSION 3.3)
project(gapi_standalone) project(gapi_standalone)
include("cmake/standalone.cmake") include("cmake/standalone.cmake")
return() return()
endif() endif()
# FIXME: Remove CXX11 check after complete switch to OpenCV 4 branch if(NOT TARGET ade)
# (CI, bundle, workloads, etc)
if (NOT HAVE_CXX11 OR NOT TARGET ade)
# can't build G-API because of the above reasons # can't build G-API because of the above reasons
ocv_module_disable(gapi) ocv_module_disable(gapi)
return() return()
...@@ -131,9 +129,13 @@ ocv_source_group("Include" FILES ${gapi_ext_hdrs}) ...@@ -131,9 +129,13 @@ ocv_source_group("Include" FILES ${gapi_ext_hdrs})
ocv_set_module_sources(HEADERS ${gapi_ext_hdrs} SOURCES ${gapi_srcs}) ocv_set_module_sources(HEADERS ${gapi_ext_hdrs} SOURCES ${gapi_srcs})
ocv_module_include_directories("${CMAKE_CURRENT_LIST_DIR}/src") ocv_module_include_directories("${CMAKE_CURRENT_LIST_DIR}/src")
# Note `ade` is not a module name but link dependency for ${the_module} ocv_create_module()
# (which is opencv_gapi)
ocv_create_module(ade ${INF_ENGINE_TARGET}) ocv_target_link_libraries(${the_module} PRIVATE ade ${INF_ENGINE_TARGET})
if(HAVE_TBB)
ocv_target_link_libraries(${the_module} PRIVATE tbb)
endif()
ocv_add_accuracy_tests(${INF_ENGINE_TARGET}) ocv_add_accuracy_tests(${INF_ENGINE_TARGET})
# FIXME: test binary is linked with ADE directly since ADE symbols # FIXME: test binary is linked with ADE directly since ADE symbols
# are not exported from libopencv_gapi.so in any form - thus # are not exported from libopencv_gapi.so in any form - thus
...@@ -144,17 +146,17 @@ if(TARGET opencv_test_gapi) ...@@ -144,17 +146,17 @@ if(TARGET opencv_test_gapi)
target_link_libraries(opencv_test_gapi PRIVATE ade) target_link_libraries(opencv_test_gapi PRIVATE ade)
endif() endif()
if (HAVE_FREETYPE) if(HAVE_FREETYPE)
ocv_target_compile_definitions(opencv_gapi PRIVATE -DHAVE_FREETYPE) ocv_target_compile_definitions(opencv_gapi PRIVATE -DHAVE_FREETYPE)
ocv_target_compile_definitions(opencv_test_gapi PRIVATE -DHAVE_FREETYPE) ocv_target_compile_definitions(opencv_test_gapi PRIVATE -DHAVE_FREETYPE)
ocv_target_link_libraries(opencv_gapi LINK_PRIVATE ${FREETYPE_LIBRARIES}) ocv_target_link_libraries(opencv_gapi PRIVATE ${FREETYPE_LIBRARIES})
ocv_target_include_directories(opencv_gapi PRIVATE ${FREETYPE_INCLUDE_DIRS}) ocv_target_include_directories(opencv_gapi PRIVATE ${FREETYPE_INCLUDE_DIRS})
endif() endif()
if(HAVE_PLAIDML) if(HAVE_PLAIDML)
ocv_target_compile_definitions(opencv_gapi PRIVATE -DHAVE_PLAIDML) ocv_target_compile_definitions(opencv_gapi PRIVATE -DHAVE_PLAIDML)
ocv_target_compile_definitions(opencv_test_gapi PRIVATE -DHAVE_PLAIDML) ocv_target_compile_definitions(opencv_test_gapi PRIVATE -DHAVE_PLAIDML)
ocv_target_link_libraries(opencv_gapi LINK_PRIVATE ${PLAIDML_LIBRARIES}) ocv_target_link_libraries(opencv_gapi PRIVATE ${PLAIDML_LIBRARIES})
ocv_target_include_directories(opencv_gapi SYSTEM PRIVATE ${PLAIDML_INCLUDE_DIRS}) ocv_target_include_directories(opencv_gapi SYSTEM PRIVATE ${PLAIDML_INCLUDE_DIRS})
endif() endif()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment