Publishing 2019 R1 content
[platform/upstream/dldt.git] / inference-engine / samples / common / format_reader / CMakeLists.txt
1 # Copyright (C) 2018-2019 Intel Corporation
2 # SPDX-License-Identifier: Apache-2.0
3 #
4
5 set (TARGET_NAME "format_reader")
6
7 file (GLOB MAIN_SRC
8         ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp
9         )
10
11 file (GLOB LIBRARY_HEADERS
12         ${CMAKE_CURRENT_SOURCE_DIR}/*.h
13         )
14
15 # Find OpenCV components if exist
16 find_package(OpenCV COMPONENTS imgcodecs videoio imgproc  QUIET)
17 if(NOT(OpenCV_FOUND))
18     message(WARNING "OPENCV is disabled or not found, " ${TARGET_NAME} " is built without OPENCV support")
19 else()
20     add_definitions(-DUSE_OPENCV)
21 endif()
22
23 add_definitions(-DIMPLEMENT_FORMAT_READER)
24
25 if(UNIX)
26     list(REMOVE_ITEM MAIN_SRC ${CMAKE_CURRENT_SOURCE_DIR}/dllmain.cpp)
27 endif()
28 add_definitions(-DIMPLEMENT_INFERENCE_ENGINE_API)
29
30 # Create named folders for the sources within the .vcproj
31 # Empty name lists them directly under the .vcproj
32 source_group("src" FILES ${LIBRARY_SRC})
33 source_group("include" FILES ${LIBRARY_HEADERS})
34
35
36 # Create library file from sources.
37 add_library(${TARGET_NAME} SHARED ${MAIN_SRC} ${LIBRARY_HEADERS})
38 target_link_libraries(${TARGET_NAME} ${OpenCV_LIBRARIES})
39
40 if(CMAKE_VERSION VERSION_LESS "2.8.11")
41         include_directories (${CMAKE_CURRENT_SOURCE_DIR})
42 else()
43         target_include_directories(${TARGET_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
44 endif()
45
46 set_target_properties(${TARGET_NAME} PROPERTIES COMPILE_PDB_NAME ${TARGET_NAME})