diff --git a/cmake/developer_package/IEDevScriptsConfig.cmake b/cmake/developer_package/IEDevScriptsConfig.cmake index 4b924633d2fb7d..7bdb9315f29fb1 100644 --- a/cmake/developer_package/IEDevScriptsConfig.cmake +++ b/cmake/developer_package/IEDevScriptsConfig.cmake @@ -53,9 +53,6 @@ function(set_temp_directory temp_variable source_tree_dir) if (DEFINED ENV{DL_SDK_TEMP} AND NOT $ENV{DL_SDK_TEMP} STREQUAL "") message(STATUS "DL_SDK_TEMP environment is set : $ENV{DL_SDK_TEMP}") file(TO_CMAKE_PATH $ENV{DL_SDK_TEMP} temp) - if (ENABLE_ALTERNATIVE_TEMP) - set(ALTERNATIVE_PATH ${source_tree_dir}/temp) - endif() else () set(temp ${source_tree_dir}/temp) endif() diff --git a/cmake/developer_package/download/download_and_extract.cmake b/cmake/developer_package/download/download_and_extract.cmake index eda73be1ef1b7f..3f385bf0f6dd88 100644 --- a/cmake/developer_package/download/download_and_extract.cmake +++ b/cmake/developer_package/download/download_and_extract.cmake @@ -175,7 +175,7 @@ function (CheckOrDownloadAndExtract component RELATIVE_URL archive_name unpacked #path exists, so we would like to check what was unpacked version set (version_file ${unpacked_path}/ie_dependency.info) - if (NOT EXISTS ${version_file} AND NOT ${ENABLE_ALTERNATIVE_TEMP}) + if (NOT EXISTS ${version_file}) clean_message(FATAL_ERROR "error: Dependency doesn't contain version file. Please select actions: \n" "if you are not sure about your FS dependency - remove it : \n" "\trm -rf ${unpacked_path}\n" diff --git a/cmake/developer_package/features.cmake b/cmake/developer_package/features.cmake index bc41ce9a065313..813b58b7dc0bce 100644 --- a/cmake/developer_package/features.cmake +++ b/cmake/developer_package/features.cmake @@ -56,8 +56,6 @@ ie_option (VERBOSE_BUILD "shows extra information about build" OFF) ie_option (ENABLE_UNSAFE_LOCATIONS "skip check for MD5 for dependency" OFF) -ie_option (ENABLE_ALTERNATIVE_TEMP "in case of dependency conflict, to avoid modification in master, use local copy of dependency" OFF) - ie_dependent_option (ENABLE_FUZZING "instrument build for fuzzing" OFF "CMAKE_CXX_COMPILER_ID MATCHES ^(Apple)?Clang$; NOT WIN32" OFF) # diff --git a/inference-engine/cmake/templates/InferenceEngineConfig-version.cmake.in b/inference-engine/cmake/templates/InferenceEngineConfig-version.cmake.in index f8018a41815443..a088aa5b6a7c4c 100644 --- a/inference-engine/cmake/templates/InferenceEngineConfig-version.cmake.in +++ b/inference-engine/cmake/templates/InferenceEngineConfig-version.cmake.in @@ -13,6 +13,9 @@ set(PACKAGE_VERSION_COMPATIBLE False) # Compatibility with old versioning for 2.x if(PACKAGE_FIND_VERSION_MAJOR VERSION_EQUAL 2) set(PACKAGE_VERSION_COMPATIBLE True) + if(${CMAKE_FIND_PACKAGE_NAME}_FIND_REQUIRED) + message(WARNING "Inference Engine versioning has changed. Use ${PACKAGE_VERSION} instead of ${PACKAGE_FIND_VERSION}") + endif() endif() if(PACKAGE_FIND_VERSION VERSION_EQUAL PACKAGE_VERSION) diff --git a/inference-engine/cmake/templates/InferenceEngineConfig.cmake.in b/inference-engine/cmake/templates/InferenceEngineConfig.cmake.in index cdaa7e0b2c6c88..cb4c62442c5ed6 100644 --- a/inference-engine/cmake/templates/InferenceEngineConfig.cmake.in +++ b/inference-engine/cmake/templates/InferenceEngineConfig.cmake.in @@ -5,7 +5,7 @@ # Inference Engine cmake config # ------ # -# This will define the following variables: +# This config defines the following variables: # # InferenceEngine_FOUND - True if the system has the Inference Engine library # InferenceEngine_INCLUDE_DIRS - Inference Engine include directories @@ -25,6 +25,11 @@ @PACKAGE_INIT@ +# +# Common functions +# + +# we have to use our own version of find_dependency because of support cmake 3.7 macro(_ie_find_dependency dep) set(cmake_fd_quiet_arg) if(${CMAKE_FIND_PACKAGE_NAME}_FIND_QUIETLY) @@ -56,6 +61,22 @@ macro(_ie_find_dependency dep) set(cmake_fd_quiet_arg) endmacro() +function(_ie_target_no_deprecation_error) + if(NOT MSVC) + if(CMAKE_CXX_COMPILER_ID STREQUAL "Intel") + set(flags "-diag-warning=1786") + else() + set(flags "-Wno-error=deprecated-declarations") + endif() + + set_target_properties(${ARGV} PROPERTIES INTERFACE_COMPILE_OPTIONS ${flags}) + endif() +endfunction() + +# +# Inference Engine config +# + # need to store current PACKAGE_PREFIX_DIR, because it's overwritten by ngraph one set(IE_PACKAGE_PREFIX_DIR "${PACKAGE_PREFIX_DIR}") @@ -78,29 +99,42 @@ _ie_find_dependency(ngraph NO_CMAKE_FIND_ROOT_PATH NO_DEFAULT_PATH) -function(_ie_target_no_deprecation_error) - if(NOT MSVC) - if(CMAKE_CXX_COMPILER_ID STREQUAL "Intel") - set(flags "-diag-warning=1786") - else() - set(flags "-Wno-error=deprecated-declarations") +if(NOT TARGET inference_engine) + set(_ie_as_external_package ON) + include("${CMAKE_CURRENT_LIST_DIR}/InferenceEngineTargets.cmake") +endif() + +# mark components as available +foreach(comp inference_engine inference_engine_c_api) + set(${CMAKE_FIND_PACKAGE_NAME}_${comp}_FOUND ON) +endforeach() + +if(NOT ${CMAKE_FIND_PACKAGE_NAME}_FIND_COMPONENTS) + set(${CMAKE_FIND_PACKAGE_NAME}_FIND_COMPONENTS inference_engine inference_engine_c_api) +endif() + +unset(InferenceEngine_LIBRARIES) +foreach(comp IN LISTS ${CMAKE_FIND_PACKAGE_NAME}_FIND_COMPONENTS) + # check if the component is available + if(${CMAKE_FIND_PACKAGE_NAME}_${comp}_FOUND) + set(pcomp ${comp}) + if(_ie_as_external_package) + set(pcomp IE::${comp}) endif() - set_target_properties(${ARGV} PROPERTIES INTERFACE_COMPILE_OPTIONS ${flags}) + list(APPEND InferenceEngine_LIBRARIES ${pcomp}) endif() -endfunction() +endforeach() -if(TARGET inference_engine) - set(InferenceEngine_LIBRARIES inference_engine inference_engine_c_api) -else() - include("${CMAKE_CURRENT_LIST_DIR}/InferenceEngineTargets.cmake") - set(InferenceEngine_LIBRARIES IE::inference_engine IE::inference_engine_c_api) +if(_ie_as_external_package) _ie_target_no_deprecation_error(${InferenceEngine_LIBRARIES}) endif() +unset(_ie_as_external_package) # restore PACKAGE_PREFIX_DIR set(PACKAGE_PREFIX_DIR ${IE_PACKAGE_PREFIX_DIR}) +unset(IE_PACKAGE_PREFIX_DIR) set_and_check(InferenceEngine_INCLUDE_DIRS "@PACKAGE_IE_INCLUDE_DIR@") -check_required_components(InferenceEngine) +check_required_components(${CMAKE_FIND_PACKAGE_NAME}) diff --git a/inference-engine/samples/CMakeLists.txt b/inference-engine/samples/CMakeLists.txt index e3aa243587a5e4..31a60ddea4844a 100644 --- a/inference-engine/samples/CMakeLists.txt +++ b/inference-engine/samples/CMakeLists.txt @@ -133,8 +133,6 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall") endif() -find_package(InferenceEngine REQUIRED) - if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/common/utils") add_subdirectory(common/utils) endif() @@ -220,6 +218,14 @@ macro(ie_add_sample) set(folder_name c_samples) endif() + if(c_sample) + set(ie_component inference_engine_c_api) + else() + set(ie_component inference_engine) + endif() + + find_package(InferenceEngine REQUIRED COMPONENTS ${ie_component}) + set_target_properties(${IE_SAMPLE_NAME} PROPERTIES FOLDER ${folder_name} COMPILE_PDB_NAME ${IE_SAMPLE_NAME}) diff --git a/inference-engine/tests/functional/plugin/cpu/shared_tests_instances/skip_tests_config.cpp b/inference-engine/tests/functional/plugin/cpu/shared_tests_instances/skip_tests_config.cpp index 2c50910f6f2016..c951427cd8658a 100644 --- a/inference-engine/tests/functional/plugin/cpu/shared_tests_instances/skip_tests_config.cpp +++ b/inference-engine/tests/functional/plugin/cpu/shared_tests_instances/skip_tests_config.cpp @@ -73,7 +73,7 @@ std::vector disabledTestPatterns() { R"(.*BF16NetworkRestore1.*)", R"(.*MobileNet_ssd_with_branching.*)", - // AUTO plugin and QueryNetwork + // TODO: 55656 AUTO plugin and QueryNetwork R"(.*CoreThreading.*smoke_QueryNetwork.*targetDevice=AUTO_config.*)", // TODO: 54718 Accuracy mismatch R"(.*GroupDeconv_2D_DW_BF16.*K\(3\.3\)_S\(1\.1\).*primitive=jit_avx512_dw.*)",