Publishing 2019 R1.1 content and Myriad plugin sources (#162)
[platform/upstream/dldt.git] / inference-engine / tests / validation_app / CMakeLists.txt
1 # Copyright (C) 2018-2019 Intel Corporation
2 # SPDX-License-Identifier: Apache-2.0
3 #
4
5 set (TARGET_NAME "test_validation_app")
6
7 # Find OpenCV components if exist
8 find_package(OpenCV COMPONENTS imgcodecs)
9 if(NOT(OpenCV_FOUND))
10     message(WARNING "No suitable OpenCV version detected, " ${TARGET_NAME} " skipped")
11     return()
12 endif()
13
14 set(VALIDATION_APP_SOURCE "${IE_MAIN_SOURCE_DIR}/samples/validation_app")
15
16 file (GLOB MAIN_SRC
17         ${VALIDATION_APP_SOURCE}/*.cpp
18         ${VALIDATION_APP_SOURCE}/pugixml/*.cpp
19         )
20
21 file (GLOB MAIN_HEADERS
22         ${VALIDATION_APP_SOURCE}/*.hpp
23         ${VALIDATION_APP_SOURCE}/pugixml/*.hpp
24         )
25
26 # Create named folders for the sources within the .vcproj
27 # Empty name lists them directly under the .vcproj
28 source_group("src" FILES ${MAIN_SRC})
29 source_group("include" FILES ${MAIN_HEADERS})
30
31 if (WIN32)
32     if(NOT "${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
33         message(FATAL_ERROR "Only 64-bit supported on Windows")
34     endif()
35     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_SCL_SECURE_NO_WARNINGS -DNOMINMAX")
36 endif()
37
38 # Properties->C/C++->General->Additional Include Directories
39 include_directories (${VALIDATION_APP_SOURCE}/../classification_sample/core
40         ${VALIDATION_APP_SOURCE}/../common
41         ${VALIDATION_APP_SOURCE}/../common/os/windows
42         ${VALIDATION_APP_SOURCE}/../../include)
43
44 # Create library file from sources.
45
46 list(REMOVE_ITEM MAIN_SRC ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp)
47
48 add_library(${TARGET_NAME} STATIC ${MAIN_SRC} ${MAIN_HEADERS})
49 set_target_properties(${TARGET_NAME} PROPERTIES "COMPILE_PDB_NAME" ${TARGET_NAME})
50 target_link_libraries(${TARGET_NAME} gflags ie_cpu_extension ${OpenCV_LIBRARIES})