publish master branch snapshot, revision 0110d9c98fd7209589d06344f0d836f61d81f4b3
[platform/upstream/dldt.git] / inference-engine / thirdparty / CMakeLists.txt
1 # Copyright (C) 2018-2020 Intel Corporation
2 # SPDX-License-Identifier: Apache-2.0
3 #
4
5 if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
6   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-error=unknown-warning-option -Wno-error=inconsistent-missing-override -Wno-error=pass-failed")
7   set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-error=unknown-warning-option -Wno-error=inconsistent-missing-override -Wno-error=pass-failed")
8 endif()
9
10 function(build_with_lto)
11     if(ENABLE_LTO)
12         ie_enable_lto()
13     endif()
14
15     if (ENABLE_CLDNN)
16         set(CLDNN__OUTPUT_BIN_DIR ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
17         set(CLDNN__OUTPUT_LIB_DIR ${CMAKE_LIBRARY_OUTPUT_DIRECTORY})
18         if (ENABLE_TESTS AND ENABLE_CLDNN_TESTS)
19             set(CLDNN__INCLUDE_TESTS ON CACHE BOOL "" FORCE)
20             set(CLDNN__INCLUDE_CORE_INTERNAL_TESTS ON CACHE BOOL "" FORCE)
21         else()
22             set(CLDNN__INCLUDE_TESTS OFF CACHE BOOL "" FORCE)
23             set(CLDNN__INCLUDE_CORE_INTERNAL_TESTS OFF CACHE BOOL "" FORCE)
24         endif()
25         set(CLDNN__INCLUDE_EXAMPLES OFF CACHE BOOL "" FORCE)
26         set(CLDNN__INCLUDE_TUTORIAL OFF CACHE BOOL "" FORCE)
27         if (WIN32)
28             set(CLDNN__ARCHITECTURE_TARGET "Windows64" CACHE STRING "" FORCE)
29         elseif (ANDROID)
30             set(CLDNN__ARCHITECTURE_TARGET "Android64" CACHE STRING "" FORCE)
31         else()
32             set(CLDNN__ARCHITECTURE_TARGET "Linux64" CACHE STRING "" FORCE)
33         endif()
34
35         add_subdirectory(clDNN)
36     endif()
37
38     function(ie_build_pugixml)
39         set(BUILD_TESTS_current ${BUILD_TESTS})
40         set(BUILD_TESTS OFF CACHE BOOL "Build tests" FORCE)
41         add_subdirectory(pugixml)
42         set(BUILD_TESTS ${BUILD_TESTS_current} CACHE BOOL "Build tests" FORCE)
43     endfunction()
44
45     ie_build_pugixml()
46     add_subdirectory(stb_lib)
47     add_subdirectory(ade)
48     add_subdirectory(fluid/modules/gapi)
49
50     target_include_directories(pugixml INTERFACE "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/pugixml/src>")
51
52     set_target_properties(pugixml ade fluid stb_image
53                           PROPERTIES FOLDER thirdparty)
54
55     # developer package
56
57     ie_developer_export_targets(ade fluid pugixml)
58     if(TARGET pugixml_mt)
59         ie_developer_export_targets(pugixml_mt)
60         set_target_properties(pugixml_mt PROPERTIES FOLDER thirdparty)
61     endif()
62 endfunction()
63
64 build_with_lto()
65
66 if(ENABLE_MKL_DNN)
67     set(SDL_cmake_included ON)
68     include(mkldnn.cmake)
69 endif()