Publishing 2019 R1 content
[platform/upstream/dldt.git] / inference-engine / tests / unit / opencv_test_gapi / CMakeLists.txt
1 #
2 # Copyright (C) 2018-2019 Intel Corporation.
3 #
4 # This software and the related documents are Intel copyrighted materials,
5 # and your use of them is governed by the express license under which they
6 # were provided to you (End User License Agreement for the Intel(R) Software
7 # Development Products (Version May 2017)). Unless the License provides
8 # otherwise, you may not use, modify, copy, publish, distribute, disclose or
9 # transmit this software or the related documents without Intel's prior
10 # written permission.
11 #
12 # This software and the related documents are provided as is, with no
13 # express or implied warranties, other than those that are expressly
14 # stated in the License.
15 #
16
17 if(NOT ENABLE_GAPI_TESTS)
18     message(WARNING "Skipping GAPI unit tests")
19     return()
20 endif()
21
22 find_package(OpenCV COMPONENTS gapi)
23 if(NOT OpenCV_FOUND)
24     message(WARNING "No suitable OpenCV version detected, " ${TARGET_NAME} " skipped")
25     return()
26 endif()
27
28 add_subdirectory(fluid_test_computations)
29
30 file(GLOB SOURCES *.cpp common/*.cpp cpu/*.cpp)
31 file(GLOB HEADERS *.hpp common/*.hpp cpu/*.hpp)
32
33 set(TARGET opencv_test_gapi)
34 add_executable(${TARGET} ${SOURCES} ${HEADERS})
35
36 target_include_directories(${TARGET} PRIVATE
37           "${CMAKE_CURRENT_SOURCE_DIR}"
38           "${CMAKE_CURRENT_SOURCE_DIR}/common"
39           "${CMAKE_CURRENT_SOURCE_DIR}/cpu")
40
41 target_link_libraries(${TARGET} PRIVATE ${OpenCV_LIBS} inference_engine_s fluid_test_computations gtest gtest_main)
42
43 if(GAPI_TEST_PERF)
44   target_compile_definitions(${TARGET} PRIVATE -DPERF_TEST=1)
45 else()
46   target_compile_definitions(${TARGET} PRIVATE -DPERF_TEST=0)
47 endif()