#
cmake_policy(SET CMP0054 NEW)
+
+# TODO: for make instal / package we need to use 3.13.3 version because
+# it allows to install targets created outside of current projects
+# See https://blog.kitware.com/cmake-3-13-0-available-for-download/
+
if (APPLE)
# due to https://cmake.org/cmake/help/v3.12/policy/CMP0068.html
cmake_minimum_required(VERSION 3.9 FATAL_ERROR)
else()
- cmake_minimum_required(VERSION 3.5 FATAL_ERROR)
+ cmake_minimum_required(VERSION 3.7.2 FATAL_ERROR)
endif()
project(OpenVINO)
set(OpenVINO_MAIN_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
-set(CMAKE_MODULE_PATH "${OpenVINO_MAIN_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH})
+set(IE_MAIN_SOURCE_DIR ${OpenVINO_MAIN_SOURCE_DIR}/inference-engine)
+list(APPEND CMAKE_MODULE_PATH "${OpenVINO_MAIN_SOURCE_DIR}/cmake")
include(CTest)
include(features)
# These options are shared with 3rdparty plugins
# by means of developer package
include(check_features)
+include(dependencies)
# resolving dependencies for the project
message (STATUS "PROJECT ............................... " ${PROJECT_NAME})
message (STATUS "CMAKE_BINARY_DIR ...................... " ${CMAKE_BINARY_DIR})
message (STATUS "OpenVINO_MAIN_SOURCE_DIR .............. " ${OpenVINO_MAIN_SOURCE_DIR})
-if (ENABLE_INFERENCE_ENGINE)
- set(IE_MAIN_SOURCE_DIR ${OpenVINO_MAIN_SOURCE_DIR}/inference-engine)
- message (STATUS "IE_MAIN_SOURCE_DIR .............. " ${IE_MAIN_SOURCE_DIR})
-endif()
+message (STATUS "IE_MAIN_SOURCE_DIR .................... " ${IE_MAIN_SOURCE_DIR})
message (STATUS "CMAKE_GENERATOR ....................... " ${CMAKE_GENERATOR})
message (STATUS "CMAKE_C_COMPILER_ID ................... " ${CMAKE_C_COMPILER_ID})
message (STATUS "CMAKE_BUILD_TYPE ...................... " ${CMAKE_BUILD_TYPE})
file(REMOVE "${CMAKE_BINARY_DIR}/targets.cmake")
function(build_ngraph)
- if(NOT ENABLE_NGRAPH)
- return()
- endif()
-
function(ngraph_set option value)
if(NOT DEFINED ${option})
set(${option} ${value} CACHE BOOL "" FORCE)
endif()
endfunction()
- add_definitions(-DENABLE_NGRAPH)
set(NGRAPH_BUILD_DIR ${CMAKE_LIBRARY_OUTPUT_DIRECTORY} CACHE STRING "" FORCE)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${OpenVINO_MAIN_SOURCE_DIR}/ngraph/cmake/Modules/")
- ngraph_set(NGRAPH_ADDRESS_SANITIZER FALSE)
- ngraph_set(NGRAPH_TOOLS_ENABLE FALSE)
- ngraph_set(NGRAPH_CPU_ENABLE FALSE)
- ngraph_set(NGRAPH_MLIR_ENABLE FALSE)
- ngraph_set(NGRAPH_INTELGPU_ENABLE FALSE)
- ngraph_set(NGRAPH_GPU_ENABLE FALSE)
- ngraph_set(NGRAPH_INTERPRETER_ENABLE FALSE)
- ngraph_set(NGRAPH_NOP_ENABLE FALSE)
- ngraph_set(NGRAPH_GPUH_ENABLE FALSE)
- ngraph_set(NGRAPH_GENERIC_CPU_ENABLE FALSE)
- ngraph_set(NGRAPH_DEBUG_ENABLE FALSE)
- ngraph_set(NGRAPH_DEPRECATED_ENABLE FALSE)
- ngraph_set(NGRAPH_DEX_ONLY FALSE)
- ngraph_set(NGRAPH_ENABLE_CPU_CONV_AUTO FALSE)
- ngraph_set(NGRAPH_CODE_COVERAGE_ENABLE FALSE)
- ngraph_set(NGRAPH_LIB_VERSIONING_ENABLE FALSE)
- if (ENABLE_PYTHON AND NOT WIN32)
- ngraph_set(NGRAPH_PYTHON_BUILD_ENABLE TRUE)
- else()
- ngraph_set(NGRAPH_PYTHON_BUILD_ENABLE FALSE)
- endif()
- ngraph_set(NGRAPH_PLAIDML_ENABLE FALSE)
- ngraph_set(NGRAPH_DISTRIBUTED_ENABLE FALSE)
- ngraph_set(NGRAPH_FAST_MATH_ENABLE FALSE)
- ngraph_set(NGRAPH_JSON_ENABLE FALSE)
- ngraph_set(NGRAPH_STATIC_LIB_ENABLE FALSE)
- ngraph_set(NGRAPH_INTERPRETER_STATIC_LIB_ENABLE FALSE)
- ngraph_set(NGRAPH_CPU_STATIC_LIB_ENABLE FALSE)
- ngraph_set(NGRAPH_DYNAMIC_COMPONENTS_ENABLE FALSE)
- ngraph_set(NGRAPH_NATIVE_ARCH_ENABLE FALSE)
-
+ if (ENABLE_SANITIZER)
+ ngraph_set(NGRAPH_ADDRESS_SANITIZER TRUE)
+ else ()
+ ngraph_set(NGRAPH_ADDRESS_SANITIZER FALSE)
+ endif ()
+ ngraph_set(NGRAPH_PYTHON_BUILD_ENABLE FALSE)
if (NOT ANDROID)
ngraph_set(NGRAPH_UNIT_TEST_ENABLE TRUE)
- ngraph_set(NGRAPH_UNIT_TEST_OPENVINO_ENABLE TRUE)
+ ngraph_set(NGRAPH_IE_ENABLE TRUE)
+ ngraph_set(NGRAPH_ONNX_IMPORT_ENABLE TRUE)
else()
ngraph_set(NGRAPH_UNIT_TEST_ENABLE FALSE)
- ngraph_set(NGRAPH_UNIT_TEST_OPENVINO_ENABLE FALSE)
+ ngraph_set(NGRAPH_TEST_UTIL_ENABLE FALSE)
+ ngraph_set(NGRAPH_IE_ENABLE FALSE)
+ ngraph_set(NGRAPH_ONNX_IMPORT_ENABLE FALSE)
endif()
+ ngraph_set(NGRAPH_INTERPRETER_ENABLE TRUE)
- if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
+ if(CMAKE_CXX_COMPILER_ID MATCHES "^(Apple)?Clang$")
ie_add_compiler_flags(-Wno-error=uninitialized -Wno-error=literal-conversion)
elseif(UNIX)
ie_add_compiler_flags(-Wno-error=maybe-uninitialized -Wno-error=return-type -fPIC)
if (UNIX)
ie_add_compiler_flags(-Wno-error=return-type -Wno-undef)
elseif(WIN32)
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4308 /wd4146")
- endif()
-
- if(UNIX)
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=default")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4308 /wd4146 /wd4703 /wd4244")
endif()
if(ENABLE_LTO)
ie_cpack_add_component(ngraph)
+ set(SDL_cmake_included ON)
+ # set(NGRAPH_COMPONENT_PREFIX "deployment_tools/ngraph/")
add_subdirectory(ngraph)
+ set(NGRAPH_LIBRARIES ngraph PARENT_SCOPE)
endfunction()
build_ngraph()
-if (ENABLE_INFERENCE_ENGINE)
- add_subdirectory(inference-engine)
-endif()
+add_subdirectory(inference-engine)
+
+add_subdirectory(docs)
# cpack
+# install setupvars
+
+ie_cpack_add_component(setupvars REQUIRED)
+
+if(UNIX)
+ install(PROGRAMS scripts/setupvars/setupvars.sh
+ DESTINATION bin
+ COMPONENT setupvars)
+elseif(WIN32)
+ install(PROGRAMS scripts/setupvars/setupvars.bat
+ DESTINATION bin
+ COMPONENT setupvars)
+endif()
+
+# install install_dependencies
+
+if(UNIX)
+ ie_cpack_add_component(install_dependencies REQUIRED)
+ install(DIRECTORY scripts/install_dependencies/
+ DESTINATION install_dependencies
+ COMPONENT install_dependencies)
+endif()
+
+# install files for demo
+
+ie_cpack_add_component(demo_scripts REQUIRED DEPENDS core)
+
+if(UNIX)
+ install(DIRECTORY scripts/demo/
+ DESTINATION deployment_tools/demo
+ COMPONENT demo_scripts
+ USE_SOURCE_PERMISSIONS
+ PATTERN *.bat EXCLUDE)
+elseif(WIN32)
+ install(DIRECTORY scripts/demo/
+ DESTINATION deployment_tools/demo
+ COMPONENT demo_scripts
+ USE_SOURCE_PERMISSIONS
+ PATTERN *.sh EXCLUDE)
+endif()
+
ie_cpack(${IE_CPACK_COMPONENTS_ALL})