Publishing 2019 R1 content
[platform/upstream/dldt.git] / inference-engine / samples / validation_app / CMakeLists.txt
1 # Copyright (C) 2018-2019 Intel Corporation
2 # SPDX-License-Identifier: Apache-2.0
3 #
4
5 set (TARGET_NAME "validation_app")
6
7 file (GLOB MAIN_SRC
8         ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp
9         ${CMAKE_CURRENT_SOURCE_DIR}/pugixml/*.cpp
10         )
11
12 file (GLOB MAIN_HEADERS
13         ${CMAKE_CURRENT_SOURCE_DIR}/*.hpp
14         ${CMAKE_CURRENT_SOURCE_DIR}/pugixml/*.hpp
15         )
16
17 # Create named folders for the sources within the .vcproj
18 # Empty name lists them directly under the .vcproj
19 source_group("src" FILES ${MAIN_SRC})
20 source_group("include" FILES ${MAIN_HEADERS})
21
22 # Find OpenCV components if exist
23 find_package(OpenCV COMPONENTS imgcodecs imgproc QUIET)
24 if(NOT(OpenCV_FOUND))
25     message(WARNING "OPENCV is disabled or not found, " ${TARGET_NAME} " skipped")
26     return()
27 endif()
28
29 # Properties->C/C++->General->Additional Include Directories
30 include_directories (${CMAKE_CURRENT_SOURCE_DIR}/../classification_sample/core
31         ${CMAKE_CURRENT_SOURCE_DIR}/../common
32         ${CMAKE_CURRENT_SOURCE_DIR}/../common/os/windows
33         ${CMAKE_CURRENT_SOURCE_DIR}/../../include)
34
35 link_directories(${LIB_FOLDER})
36
37 # Create library file from sources.
38 add_executable(${TARGET_NAME} ${MAIN_SRC} ${MAIN_HEADERS})
39
40 set_target_properties(${TARGET_NAME} PROPERTIES "CMAKE_CXX_FLAGS" "${CMAKE_CXX_FLAGS} -fPIE" 
41 COMPILE_PDB_NAME ${TARGET_NAME})
42 target_link_libraries(${TARGET_NAME} gflags IE::ie_cpu_extension ${InferenceEngine_LIBRARIES} ${OpenCV_LIBRARIES})
43 if (UNIX)
44     target_link_libraries(${TARGET_NAME} dl)
45 endif()
46