diff --git a/cmake/developer_package/IEDevScriptsConfig.cmake b/cmake/developer_package/IEDevScriptsConfig.cmake index ed6971fd374..8d8b3c329e4 100644 --- a/cmake/developer_package/IEDevScriptsConfig.cmake +++ b/cmake/developer_package/IEDevScriptsConfig.cmake @@ -202,6 +202,9 @@ endif() # General flags +set(THREADS_PREFER_PTHREAD_FLAG ON) +find_package(Threads REQUIRED) + include(compile_flags/sdl) include(compile_flags/os_flags) include(compile_flags/sanitizer) diff --git a/cmake/developer_package/compile_flags/os_flags.cmake b/cmake/developer_package/compile_flags/os_flags.cmake index 4a3db9f4282..2115b6864d9 100644 --- a/cmake/developer_package/compile_flags/os_flags.cmake +++ b/cmake/developer_package/compile_flags/os_flags.cmake @@ -183,7 +183,6 @@ endfunction() # set(CMAKE_POSITION_INDEPENDENT_CODE ON) -set(THREADS_PREFER_PTHREAD_FLAG ON) # to allows to override CMAKE_CXX_STANDARD from command line if(NOT DEFINED CMAKE_CXX_STANDARD) diff --git a/cmake/developer_package/compile_flags/sanitizer.cmake b/cmake/developer_package/compile_flags/sanitizer.cmake index a9b8a47c72a..07acd541fc0 100644 --- a/cmake/developer_package/compile_flags/sanitizer.cmake +++ b/cmake/developer_package/compile_flags/sanitizer.cmake @@ -1,17 +1,9 @@ -# Copyright (C) 2018-2020 Intel Corporation +# Copyright (C) 2018-2021 Intel Corporation # SPDX-License-Identifier: Apache-2.0 # include(CheckCXXCompilerFlag) -if (ENABLE_SANITIZER OR ENABLE_THREAD_SANITIZER) - # This is workaround for https://gitlab.kitware.com/cmake/cmake/-/issues/16609. - # It ensures pthread is searched without ASAN linking. - # Line bellow must be before adding -fsanitize=address or -fsanitize=thread to - # build options for the trick to work. - find_package(Threads REQUIRED) -endif() - if (ENABLE_SANITIZER) set(SANITIZER_COMPILER_FLAGS "-g -fsanitize=address -fno-omit-frame-pointer") CHECK_CXX_COMPILER_FLAG("-fsanitize-recover=address" SANITIZE_RECOVER_SUPPORTED) diff --git a/inference-engine/CMakeLists.txt b/inference-engine/CMakeLists.txt index 95c657222ef..d4f5a85b1ce 100644 --- a/inference-engine/CMakeLists.txt +++ b/inference-engine/CMakeLists.txt @@ -13,8 +13,6 @@ include(cmake/features.cmake) # resolving dependencies for the project include(cmake/dependencies.cmake) -find_package(Threads REQUIRED) - function(ie_developer_export_targets) openvino_developer_export_targets(COMPONENT inference_engine TARGETS ${ARGN}) endfunction() diff --git a/inference-engine/cmake/features.cmake b/inference-engine/cmake/features.cmake index 56aeba29020..df6cef35ce5 100644 --- a/inference-engine/cmake/features.cmake +++ b/inference-engine/cmake/features.cmake @@ -126,8 +126,4 @@ if (ENABLE_GNA) endif() endif() -if (ENABLE_SPEECH_DEMO) - add_definitions(-DENABLE_SPEECH_DEMO) -endif() - print_enabled_features() diff --git a/inference-engine/cmake/templates/InferenceEngineConfig-build.cmake.in b/inference-engine/cmake/templates/InferenceEngineConfig-build.cmake.in index 723d6f8cf85..3aee97e834f 100644 --- a/inference-engine/cmake/templates/InferenceEngineConfig-build.cmake.in +++ b/inference-engine/cmake/templates/InferenceEngineConfig-build.cmake.in @@ -1,6 +1,21 @@ -# Copyright (C) 2018-2020 Intel Corporation +# Copyright (C) 2018-2021 Intel Corporation # SPDX-License-Identifier: Apache-2.0 # +# +# FindIE +# ------ +# +# This will define the following variables: +# +# InferenceEngine_FOUND - True if the system has the Inference Engine library +# InferenceEngine_INCLUDE_DIRS - Inference Engine include directories +# InferenceEngine_LIBRARIES - Inference Engine libraries +# +# and the following imported targets: +# +# IE::inference_engine - The Inference Engine library +# IE::inference_engine_c_api - The Inference Engine C API library +# if(DEFINED IE_MAIN_SOURCE_DIR AND TARGET inference_engine) set(InferenceEngine_LIBRARIES inference_engine inference_engine_c_api) @@ -12,14 +27,11 @@ if(DEFINED IE_MAIN_SOURCE_DIR AND TARGET inference_engine) endif() else() include("${CMAKE_CURRENT_LIST_DIR}/inference_engine_targets.cmake") - if(NOT MSVC) - set_target_properties(IE::inference_engine PROPERTIES INTERFACE_COMPILE_OPTIONS "-Wno-error=deprecated-declarations") - endif() file(TO_CMAKE_PATH "${CMAKE_CURRENT_LIST_DIR}" cache_path) set (ie_options THREADING) load_cache("${cache_path}" READ_WITH_PREFIX "" ${ie_options}) - message(STATUS "The following CMake options are exported from the Inference Engine build") + message(STATUS "The following CMake options are exported from the Inference Engine build tree") message("") foreach(option IN LISTS ie_options) message(" ${option}: ${${option}}") @@ -42,4 +54,9 @@ else() INTERFACE_LINK_OPTIONS "-Wl,--allow-shlib-undefined") endif() endforeach() + + if(NOT MSVC) + set_target_properties(${InferenceEngine_LIBRARIES} PROPERTIES + INTERFACE_COMPILE_OPTIONS "-Wno-error=deprecated-declarations") + endif() endif() diff --git a/inference-engine/cmake/templates/InferenceEngineDeveloperPackageConfig.cmake.in b/inference-engine/cmake/templates/InferenceEngineDeveloperPackageConfig.cmake.in index 092a6af0876..2527401804d 100644 --- a/inference-engine/cmake/templates/InferenceEngineDeveloperPackageConfig.cmake.in +++ b/inference-engine/cmake/templates/InferenceEngineDeveloperPackageConfig.cmake.in @@ -1,34 +1,29 @@ -# Copyright (C) 2018-2020 Intel Corporation +# Copyright (C) 2018-2021 Intel Corporation # SPDX-License-Identifier: Apache-2.0 # # TODO: remove after changing [private plugins] -set(OpenVINO_MAIN_SOURCE_DIR "@OpenVINO_MAIN_SOURCE_DIR@") # KMB, HDDL -set(IE_MAIN_SOURCE_DIR "@IE_MAIN_SOURCE_DIR@") # KMB, HDDL +set(OpenVINO_MAIN_SOURCE_DIR "@OpenVINO_MAIN_SOURCE_DIR@") # KMB +set(IE_MAIN_SOURCE_DIR "@IE_MAIN_SOURCE_DIR@") # HDDL # Variables to export in plugin's projects set(ie_options "@IE_OPTIONS@;CMAKE_BUILD_TYPE;CMAKE_SKIP_RPATH") file(TO_CMAKE_PATH "${CMAKE_CURRENT_LIST_DIR}" cache_path) -foreach(option IN LISTS ie_options) - if(NOT DEFINED "${option}") - load_cache("${cache_path}" READ_WITH_PREFIX "" ${option}) - endif() -endforeach() - message(STATUS "The following CMake options are exported from Inference Engine Developer package") message("") foreach(option IN LISTS ie_options) + if(NOT DEFINED "${option}") + load_cache("${cache_path}" READ_WITH_PREFIX "" ${option}) + endif() message(" ${option}: ${${option}}") endforeach() message("") +# for samples in 3rd party projects set(gflags_DIR "@gflags_BINARY_DIR@") -# GNA lib dir -set(GNA "@GNA@") - # Targets if(USE_SYSTEM_PUGIXML) @@ -40,7 +35,6 @@ foreach(component @openvino_export_components@) include("${CMAKE_CURRENT_LIST_DIR}/${component}_dev_targets.cmake") endforeach() -get_target_property(InferenceEngine_INCLUDE_DIRS IE::inference_engine INTERFACE_INCLUDE_DIRECTORIES) set(InferenceEngine_LIBRARIES IE::inference_engine) # @@ -75,5 +69,3 @@ if (THREADING STREQUAL "TBB" OR THREADING STREQUAL "TBB_AUTO") load_cache("${cache_path}" READ_WITH_PREFIX "" TBB_DIR) find_package(TBB) endif() - -find_package(Threads REQUIRED) diff --git a/inference-engine/scripts/create_vs2017_proj_x64.cmd b/inference-engine/scripts/create_vs2017_proj_x64.cmd deleted file mode 100644 index ff91c5945a5..00000000000 --- a/inference-engine/scripts/create_vs2017_proj_x64.cmd +++ /dev/null @@ -1,31 +0,0 @@ -@echo off -:: Copyright (C) 2018-2020 Intel Corporation -:: SPDX-License-Identifier: Apache-2.0 - -pushd ..\.. -if not exist "vs2017x64" ( - mkdir "vs2017x64" -) - -cmake -E chdir "vs2017x64" cmake -G "Visual Studio 15 2017 Win64" -T "Intel C++ Compiler 18.0" -DOS_FOLDER=ON ^ - -DENABLE_MYRIAD=OFF -DENABLE_VPU=OFF -DENABLE_GNA=ON -DENABLE_CLDNN=OFF ^ - -DENABLE_OPENCV=ON -DENABLE_MKL_DNN=ON ^ - -DVERBOSE_BUILD=ON -DENABLE_TESTS=ON -DTHREADING=TBB .. - - -chdir -cd "vs2017x64\thirdparty\" -"C:\Program Files (x86)\Common Files\Intel\shared files\ia32\Bin\ICProjConvert180.exe" mkldnn.vcxproj /IC - -chdir -cd "..\src\mkldnn_plugin" -"C:\Program Files (x86)\Common Files\Intel\shared files\ia32\Bin\ICProjConvert180.exe" MKLDNNPlugin.vcxproj /IC -"C:\Program Files (x86)\Common Files\Intel\shared files\ia32\Bin\ICProjConvert180.exe" test_MKLDNNPlugin.vcxproj /IC - -chdir -cd "..\..\tests\unit" -"C:\Program Files (x86)\Common Files\Intel\shared files\ia32\Bin\ICProjConvert180.exe" InferenceEngineUnitTests.vcxproj /IC - - -popd -pause diff --git a/inference-engine/tests_deprecated/behavior/shared_tests/CMakeLists.txt b/inference-engine/tests_deprecated/behavior/shared_tests/CMakeLists.txt index d18283e4b25..34fa1008adf 100644 --- a/inference-engine/tests_deprecated/behavior/shared_tests/CMakeLists.txt +++ b/inference-engine/tests_deprecated/behavior/shared_tests/CMakeLists.txt @@ -20,11 +20,6 @@ target_link_libraries(${TARGET_NAME} PUBLIC ieTestHelpers ) -if(UNIX) - find_package(Threads REQUIRED) - target_link_libraries(${TARGET_NAME} PRIVATE Threads::Threads) -endif() - target_link_libraries(${TARGET_NAME} PUBLIC gmock) target_include_directories(${TARGET_NAME} PUBLIC diff --git a/inference-engine/tools/vpu/vpu_perfcheck/CMakeLists.txt b/inference-engine/tools/vpu/vpu_perfcheck/CMakeLists.txt index b000e63c001..89087c8f65e 100644 --- a/inference-engine/tools/vpu/vpu_perfcheck/CMakeLists.txt +++ b/inference-engine/tools/vpu/vpu_perfcheck/CMakeLists.txt @@ -17,8 +17,6 @@ disable_deprecated_warnings() function(add_perfcheck_target TARGET_NAME PLUGIN_NAME) - find_package(Threads REQUIRED) - file(GLOB SOURCES *.cpp) add_executable(${TARGET_NAME} ${SOURCES}) diff --git a/tests/stress_tests/memleaks_tests/CMakeLists.txt b/tests/stress_tests/memleaks_tests/CMakeLists.txt index 037bfbd7a65..b953e7218f1 100644 --- a/tests/stress_tests/memleaks_tests/CMakeLists.txt +++ b/tests/stress_tests/memleaks_tests/CMakeLists.txt @@ -21,7 +21,6 @@ file (GLOB HDR add_executable(${TARGET_NAME} ${HDR} ${SRC}) find_package(gflags REQUIRED) -find_package(Threads REQUIRED) target_link_libraries(${TARGET_NAME} IE::gtest diff --git a/tests/stress_tests/unittests/CMakeLists.txt b/tests/stress_tests/unittests/CMakeLists.txt index b3cd52c9cb0..b0c18ef1b1a 100644 --- a/tests/stress_tests/unittests/CMakeLists.txt +++ b/tests/stress_tests/unittests/CMakeLists.txt @@ -21,7 +21,6 @@ file (GLOB HDR add_executable(${TARGET_NAME} ${HDR} ${SRC}) find_package(gflags REQUIRED) -find_package(Threads REQUIRED) target_link_libraries(${TARGET_NAME} IE::gtest