CMAKE: moved GNA var setting to proper place; removed find_package when build python...
[platform/upstream/dldt.git] / inference-engine / ie_bridges / python / CMakeLists.txt
1 # Copyright (C) 2019 Intel Corporation
2 # SPDX-License-Identifier: Apache-2.0
3
4 # Defines the CMake commands/policies
5 cmake_minimum_required (VERSION 3.3)
6
7 # Set the project name
8 project (ie_python_api)
9 set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_LIST_DIR}/cmake")
10
11 string(TOLOWER ${CMAKE_SYSTEM_PROCESSOR} ARCH)
12 if(ARCH STREQUAL "x86_64" OR ARCH STREQUAL "amd64") # Windows detects Intel's 64-bit CPU as AMD64
13     set(ARCH intel64)
14 elseif(ARCH STREQUAL "i386")
15     set(ARCH ia32)
16 endif()
17
18 if(DEFINED IE_MAIN_SOURCE_DIR)
19     set(InferenceEngine_LIBRARIES inference_engine)
20 else()
21     find_package(InferenceEngineDeveloperPackage REQUIRED)
22 endif()
23
24 if(UNIX)
25     # cython generated files requires public visibility. Force visibility required.
26     set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -fvisibility=default")
27 endif()
28
29 include (UseCython)
30
31 if(PYTHONINTERP_FOUND)
32     set(PYTHON_VERSION python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR})
33 else()
34     message(FATAL_ERROR "Python Interpretator was not found!")
35 endif()
36
37 if(WIN32)
38     set(PYTHON_BRIDGE_OUTPUT_DIRECTORY ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/$<CONFIG>/python_api/${PYTHON_VERSION}/openvino)
39 else()
40     set(PYTHON_BRIDGE_OUTPUT_DIRECTORY ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/python_api/${PYTHON_VERSION}/openvino)
41 endif()
42
43 set (PYTHON_BRIDGE_SRC_ROOT ${CMAKE_CURRENT_SOURCE_DIR})
44 add_subdirectory (src/openvino/inference_engine)
45 add_subdirectory (src/openvino/tools/statistics_collector)