1 # Copyright (C) 2018-2019 Intel Corporation
2 # SPDX-License-Identifier: Apache-2.0
5 set (TARGET_NAME "format_reader")
8 ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp
11 file (GLOB LIBRARY_HEADERS
12 ${CMAKE_CURRENT_SOURCE_DIR}/*.h
15 # Find OpenCV components if exist
16 find_package(OpenCV COMPONENTS imgcodecs videoio imgproc QUIET)
18 message(WARNING "OPENCV is disabled or not found, " ${TARGET_NAME} " is built without OPENCV support")
20 add_definitions(-DUSE_OPENCV)
23 add_definitions(-DIMPLEMENT_FORMAT_READER)
26 list(REMOVE_ITEM MAIN_SRC ${CMAKE_CURRENT_SOURCE_DIR}/dllmain.cpp)
28 add_definitions(-DIMPLEMENT_INFERENCE_ENGINE_API)
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})
36 # Create library file from sources.
37 add_library(${TARGET_NAME} SHARED ${MAIN_SRC} ${LIBRARY_HEADERS})
38 target_link_libraries(${TARGET_NAME} ${OpenCV_LIBRARIES})
40 if(CMAKE_VERSION VERSION_LESS "2.8.11")
41 include_directories (${CMAKE_CURRENT_SOURCE_DIR})
43 target_include_directories(${TARGET_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
46 set_target_properties(${TARGET_NAME} PROPERTIES COMPILE_PDB_NAME ${TARGET_NAME})