diff --git a/cmake/developer_package/packaging/common-libraries.cmake b/cmake/developer_package/packaging/common-libraries.cmake index 25dbb36ae70..daf708cebb0 100644 --- a/cmake/developer_package/packaging/common-libraries.cmake +++ b/cmake/developer_package/packaging/common-libraries.cmake @@ -14,10 +14,14 @@ macro(ov_common_libraries_cpack_set_dirs) set(OV_CPACK_TOOLSDIR ${CMAKE_INSTALL_BINDIR}) # only C++ tools are here set(OV_CPACK_INCLUDEDIR ${CMAKE_INSTALL_INCLUDEDIR}) set(OV_CPACK_LIBRARYDIR ${CMAKE_INSTALL_LIBDIR}) - set(OV_CPACK_RUNTIMEDIR ${CMAKE_INSTALL_LIBDIR}) + if(WIN32) + set(OV_CPACK_RUNTIMEDIR ${CMAKE_INSTALL_BINDIR}) + else() + set(OV_CPACK_RUNTIMEDIR ${CMAKE_INSTALL_LIBDIR}) + endif() set(OV_WHEEL_RUNTIMEDIR ${OV_CPACK_RUNTIMEDIR}) set(OV_CPACK_ARCHIVEDIR ${CMAKE_INSTALL_LIBDIR}) - set(OV_CPACK_PLUGINSDIR ${CMAKE_INSTALL_LIBDIR}/openvino-${OpenVINO_VERSION}) + set(OV_CPACK_PLUGINSDIR ${OV_CPACK_RUNTIMEDIR}/openvino-${OpenVINO_VERSION}) set(OV_CPACK_IE_CMAKEDIR ${CMAKE_INSTALL_LIBDIR}/cmake/inferenceengine${OpenVINO_VERSION}) set(OV_CPACK_NGRAPH_CMAKEDIR ${CMAKE_INSTALL_LIBDIR}/cmake/ngraph${OpenVINO_VERSION}) set(OV_CPACK_OPENVINO_CMAKEDIR ${CMAKE_INSTALL_LIBDIR}/cmake/openvino${OpenVINO_VERSION}) diff --git a/cmake/extra_modules.cmake b/cmake/extra_modules.cmake index 41f0aea1037..5393c403e42 100644 --- a/cmake/extra_modules.cmake +++ b/cmake/extra_modules.cmake @@ -14,15 +14,19 @@ function(ie_generate_dev_package_config) endforeach() add_custom_target(ie_dev_targets DEPENDS ${all_dev_targets}) - # if we've found system gflags - if(gflags_DIR) - set(gflags_BINARY_DIR "${gflags_DIR}") + set(PATH_VARS "OpenVINO_SOURCE_DIR") + if(ENABLE_SAMPLES OR ENABLE_COMPILE_TOOL OR ENABLE_TESTS) + list(APPEND PATH_VARS "gflags_BINARY_DIR") + # if we've found system gflags + if(gflags_DIR) + set(gflags_BINARY_DIR "${gflags_DIR}") + endif() endif() configure_package_config_file("${OpenVINO_SOURCE_DIR}/cmake/templates/InferenceEngineDeveloperPackageConfig.cmake.in" "${CMAKE_BINARY_DIR}/InferenceEngineDeveloperPackageConfig.cmake" INSTALL_DESTINATION share # not used - PATH_VARS "OpenVINO_SOURCE_DIR;gflags_BINARY_DIR" + PATH_VARS ${PATH_VARS} NO_CHECK_REQUIRED_COMPONENTS_MACRO) configure_file("${OpenVINO_SOURCE_DIR}/cmake/templates/InferenceEngineConfig-version.cmake.in" @@ -47,15 +51,19 @@ function(ov_generate_dev_package_config) endforeach() add_custom_target(ov_dev_targets DEPENDS ${all_dev_targets}) - # if we've found system gflags - if(gflags_DIR) - set(gflags_BINARY_DIR "${gflags_DIR}") + set(PATH_VARS "OpenVINO_SOURCE_DIR") + if(ENABLE_SAMPLES OR ENABLE_COMPILE_TOOL OR ENABLE_TESTS) + list(APPEND PATH_VARS "gflags_BINARY_DIR") + # if we've found system gflags + if(gflags_DIR) + set(gflags_BINARY_DIR "${gflags_DIR}") + endif() endif() configure_package_config_file("${OpenVINO_SOURCE_DIR}/cmake/templates/OpenVINODeveloperPackageConfig.cmake.in" "${CMAKE_BINARY_DIR}/OpenVINODeveloperPackageConfig.cmake" INSTALL_DESTINATION share # not used - PATH_VARS "OpenVINO_SOURCE_DIR;gflags_BINARY_DIR" + PATH_VARS ${PATH_VARS} NO_CHECK_REQUIRED_COMPONENTS_MACRO) configure_file("${OpenVINO_SOURCE_DIR}/cmake/templates/OpenVINOConfig-version.cmake.in" diff --git a/cmake/packaging/common-libraries.cmake b/cmake/packaging/common-libraries.cmake index f23a8116618..bde4e20ce29 100644 --- a/cmake/packaging/common-libraries.cmake +++ b/cmake/packaging/common-libraries.cmake @@ -10,8 +10,10 @@ macro(ov_cpack_settings) set(cpack_components_all ${CPACK_COMPONENTS_ALL}) unset(CPACK_COMPONENTS_ALL) foreach(item IN LISTS cpack_components_all) - # filter out some components, which are not needed to be wrapped to conda-forge - if(# python wheels are not needed to be wrapped by conda | brew packages + # filter out some components, which are not needed to be wrapped to conda-forge | brew + if(# python is not a part of conda | brew + NOT item MATCHES "^${OV_CPACK_COMP_PYTHON_OPENVINO}_python.*" AND + # python wheels are not needed to be wrapped by conda | brew packages NOT item STREQUAL OV_CPACK_COMP_PYTHON_WHEELS AND # skip C / C++ / Python samples NOT item STREQUAL OV_CPACK_COMP_CPP_SAMPLES AND diff --git a/cmake/templates/InferenceEngineDeveloperPackageConfig.cmake.in b/cmake/templates/InferenceEngineDeveloperPackageConfig.cmake.in index c731c86449e..c930331b0f8 100644 --- a/cmake/templates/InferenceEngineDeveloperPackageConfig.cmake.in +++ b/cmake/templates/InferenceEngineDeveloperPackageConfig.cmake.in @@ -30,7 +30,9 @@ endforeach() message(" ") # for samples in 3rd party projects -set_and_check(gflags_DIR "@gflags_BINARY_DIR@") +if(ENABLE_SAMPLES) + set_and_check(gflags_DIR "@gflags_BINARY_DIR@") +endif() if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") # Disable warning as error for private components diff --git a/cmake/templates/OpenVINODeveloperPackageConfig.cmake.in b/cmake/templates/OpenVINODeveloperPackageConfig.cmake.in index 97a97e2151c..2372ae7e6bf 100644 --- a/cmake/templates/OpenVINODeveloperPackageConfig.cmake.in +++ b/cmake/templates/OpenVINODeveloperPackageConfig.cmake.in @@ -28,7 +28,9 @@ endforeach() message(" ") # for samples in 3rd party projects -set_and_check(gflags_DIR "@gflags_BINARY_DIR@") +if(ENABLE_SAMPLES) + set_and_check(gflags_DIR "@gflags_BINARY_DIR@") +endif() if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") # Disable warning as error for private components diff --git a/samples/cpp/CMakeLists.txt b/samples/cpp/CMakeLists.txt index 8a2fc5a621e..aa3d4bc1c86 100644 --- a/samples/cpp/CMakeLists.txt +++ b/samples/cpp/CMakeLists.txt @@ -126,51 +126,6 @@ else() set(GFLAGS_TARGET gflags) endif() -if(NOT ANDROID) - find_package(PkgConfig QUIET) -endif() - -if(NOT TARGET zlib::zlib) - if(PkgConfig_FOUND) - pkg_search_module(zlib QUIET - IMPORTED_TARGET GLOBAL - zlib) - if(zlib_FOUND) - add_library(zlib::zlib ALIAS PkgConfig::zlib) - endif() - endif() - - if(zlib_FOUND) - message(STATUS "${PKG_CONFIG_EXECUTABLE}: zlib (${zlib_VERSION}) is found at ${zlib_PREFIX}") - elseif(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/zlib") - add_subdirectory(thirdparty/zlib EXCLUDE_FROM_ALL) - endif() -endif() - -if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/cnpy") - add_subdirectory(thirdparty/cnpy EXCLUDE_FROM_ALL) -endif() - -if(NOT TARGET nlohmann_json::nlohmann_json) - find_package(nlohmann_json QUIET) - if(nlohmann_json_FOUND) - message(STATUS "nlohmann_json (${nlohmann_json_VERSION}) is found at ${nlohmann_json_DIR}") - elseif(PkgConfig_FOUND) - pkg_search_module(nlohmann_json QUIET - IMPORTED_TARGET GLOBAL - nlohmann_json) - if(nlohmann_json_FOUND) - add_library(nlohmann_json::nlohmann_json ALIAS PkgConfig::nlohmann_json) - endif() - endif() - - if(NOT nlohmann_json_FOUND AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/nlohmann_json") - # suppress shadowing names warning - set(JSON_SystemInclude ON CACHE BOOL "" FORCE) - add_subdirectory(thirdparty/nlohmann_json EXCLUDE_FROM_ALL) - endif() -endif() - if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/common/utils") add_subdirectory(common/utils) endif() diff --git a/samples/cpp/benchmark_app/CMakeLists.txt b/samples/cpp/benchmark_app/CMakeLists.txt index f437e872525..c1bb3816d78 100644 --- a/samples/cpp/benchmark_app/CMakeLists.txt +++ b/samples/cpp/benchmark_app/CMakeLists.txt @@ -10,7 +10,36 @@ file (GLOB HDR ${CMAKE_CURRENT_SOURCE_DIR}/*.hpp) ie_add_sample(NAME ${TARGET_NAME} SOURCES ${SRC} HEADERS ${HDR} - DEPENDENCIES nlohmann_json::nlohmann_json format_reader ie_samples_utils) + DEPENDENCIES format_reader ie_samples_utils) + +# Required nlohmann_json dependency + +if(NOT ANDROID) + find_package(PkgConfig QUIET) +endif() + +if(NOT TARGET nlohmann_json::nlohmann_json) + find_package(nlohmann_json QUIET) + if(nlohmann_json_FOUND) + message(STATUS "nlohmann_json (${nlohmann_json_VERSION}) is found at ${nlohmann_json_DIR}") + elseif(PkgConfig_FOUND) + pkg_search_module(nlohmann_json QUIET + IMPORTED_TARGET GLOBAL + nlohmann_json) + if(nlohmann_json_FOUND) + add_library(nlohmann_json::nlohmann_json ALIAS PkgConfig::nlohmann_json) + endif() + endif() + + if(NOT nlohmann_json_FOUND AND EXISTS "${Samples_SOURCE_DIR}/thirdparty/nlohmann_json") + # suppress shadowing names warning + set(JSON_SystemInclude ON CACHE BOOL "" FORCE) + add_subdirectory("${Samples_SOURCE_DIR}/thirdparty/nlohmann_json" + "${Samples_BINARY_DIR}/thirdparty/nlohmann_json" EXCLUDE_FROM_ALL) + endif() +endif() + +target_link_libraries(${TARGET_NAME} PRIVATE nlohmann_json::nlohmann_json) # Optional OpenCL dependnency diff --git a/samples/cpp/speech_sample/CMakeLists.txt b/samples/cpp/speech_sample/CMakeLists.txt index 5fe3a8afc12..8822668c07b 100644 --- a/samples/cpp/speech_sample/CMakeLists.txt +++ b/samples/cpp/speech_sample/CMakeLists.txt @@ -6,6 +6,37 @@ file (GLOB SRC ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp file (GLOB HDR ${CMAKE_CURRENT_SOURCE_DIR}/*.hpp) ${CMAKE_CURRENT_SOURCE_DIR}/*.h) +# Required zlib and cnpy dependencies + +if(NOT ANDROID) + find_package(PkgConfig QUIET) +endif() + +if(NOT TARGET zlib::zlib) + if(PkgConfig_FOUND) + pkg_search_module(zlib QUIET + IMPORTED_TARGET GLOBAL + zlib) + if(zlib_FOUND) + add_library(zlib::zlib ALIAS PkgConfig::zlib) + endif() + endif() + + if(zlib_FOUND) + message(STATUS "${PKG_CONFIG_EXECUTABLE}: zlib (${zlib_VERSION}) is found at ${zlib_PREFIX}") + elseif(EXISTS "${Samples_SOURCE_DIR}/thirdparty/zlib") + add_subdirectory("${Samples_SOURCE_DIR}/thirdparty/zlib" + "${Samples_BINARY_DIR}/thirdparty/zlib" EXCLUDE_FROM_ALL) + endif() +endif() + +if(EXISTS "${Samples_SOURCE_DIR}/thirdparty/cnpy") + add_subdirectory("${Samples_SOURCE_DIR}/thirdparty/cnpy" + "${Samples_BINARY_DIR}/thirdparty/cnpy" EXCLUDE_FROM_ALL) +endif() + +# add sample + ie_add_sample(NAME speech_sample SOURCES ${SRC} HEADERS ${HDR} diff --git a/src/tests_deprecated/functional/shared_tests/io_blob_tests/cropResize_tests.hpp b/src/tests_deprecated/functional/shared_tests/io_blob_tests/cropResize_tests.hpp index 99965680241..2dc087caf56 100644 --- a/src/tests_deprecated/functional/shared_tests/io_blob_tests/cropResize_tests.hpp +++ b/src/tests_deprecated/functional/shared_tests/io_blob_tests/cropResize_tests.hpp @@ -11,7 +11,6 @@ #include #include "tests_common.hpp" -#include "format_reader_ptr.h" #include "single_layer_common.hpp" #include "functional_test_utils/plugin_cache.hpp" diff --git a/src/tests_deprecated/functional/vpu/common/myriad_hw_tests_base.hpp b/src/tests_deprecated/functional/vpu/common/myriad_hw_tests_base.hpp index 6ee59dcc8c3..5764b125d7e 100644 --- a/src/tests_deprecated/functional/vpu/common/myriad_hw_tests_base.hpp +++ b/src/tests_deprecated/functional/vpu/common/myriad_hw_tests_base.hpp @@ -10,7 +10,6 @@ #include #include -#include #include #include diff --git a/thirdparty/CMakeLists.txt b/thirdparty/CMakeLists.txt index e2820d483f3..a24dcc437db 100644 --- a/thirdparty/CMakeLists.txt +++ b/thirdparty/CMakeLists.txt @@ -15,7 +15,9 @@ if(ENABLE_PROFILING_ITT) add_subdirectory(itt_collector EXCLUDE_FROM_ALL) endif() -add_subdirectory(cnpy EXCLUDE_FROM_ALL) +if(ENABLE_SAMPLES OR ENABLE_TESTS) + add_subdirectory(cnpy EXCLUDE_FROM_ALL) +endif() if(ENABLE_INTEL_GPU) add_subdirectory(ocl) @@ -29,21 +31,23 @@ ov_install_static_lib(xbyak ${OV_CPACK_COMP_CORE}) # zlib # -if(NOT ANDROID) - find_package(PkgConfig QUIET) - if(PkgConfig_FOUND) - pkg_search_module(zlib QUIET - IMPORTED_TARGET GLOBAL - zlib) - if(zlib_FOUND) - add_library(zlib::zlib ALIAS PkgConfig::zlib) - message(STATUS "${PKG_CONFIG_EXECUTABLE}: zlib (${zlib_VERSION}) is found at ${zlib_PREFIX}") +if(ENABLE_SAMPLES OR ENABLE_TESTS) + if(NOT ANDROID) + find_package(PkgConfig QUIET) + if(PkgConfig_FOUND) + pkg_search_module(zlib QUIET + IMPORTED_TARGET GLOBAL + zlib) + if(zlib_FOUND) + add_library(zlib::zlib ALIAS PkgConfig::zlib) + message(STATUS "${PKG_CONFIG_EXECUTABLE}: zlib (${zlib_VERSION}) is found at ${zlib_PREFIX}") + endif() endif() endif() -endif() -if(NOT zlib_FOUND) - add_subdirectory(zlib EXCLUDE_FROM_ALL) + if(NOT zlib_FOUND) + add_subdirectory(zlib EXCLUDE_FROM_ALL) + endif() endif() # @@ -171,7 +175,7 @@ endif() # Gflags # -if(ENABLE_SAMPLES OR ENABLE_COMPILE_TOOL) +if(ENABLE_SAMPLES OR ENABLE_COMPILE_TOOL OR ENABLE_TESTS) if(NOT APPLE OR CPACK_GENERATOR MATCHES "^(BREW|CONDA-FORGE)$") # - on Apple only dynamic libraries are available # also, we can easily mix arm64 and x86_64 binaries when cross-compile for Intel CPU @@ -297,11 +301,13 @@ ov_install_static_lib(nlohmann_json_schema_validator ${OV_CPACK_COMP_CORE}) if(CPACK_GENERATOR MATCHES "^(DEB|RPM|CONDA-FORGE|BREW)$") # These libraries are dependencies for openvino-samples package - if((ENABLE_SAMPLES OR ENABLE_COMPILE_TOOL) AND NOT gflags_FOUND) - message(FATAL_ERROR "gflags must be used as a ${CPACK_GENERATOR} package. Install libgflags-dev / gflags-devel") - endif() - if(NOT zlib_FOUND) - message(FATAL_ERROR "zlib must be used as a ${CPACK_GENERATOR} package. Install zlib1g-dev / zlib-devel") + if(ENABLE_SAMPLES OR ENABLE_COMPILE_TOOL OR ENABLE_TESTS) + if(NOT gflags_FOUND) + message(FATAL_ERROR "gflags must be used as a ${CPACK_GENERATOR} package. Install libgflags-dev / gflags-devel") + endif() + if(NOT zlib_FOUND) + message(FATAL_ERROR "zlib must be used as a ${CPACK_GENERATOR} package. Install zlib1g-dev / zlib-devel") + endif() endif() if(NOT ENABLE_SYSTEM_PUGIXML AND NOT LINUX_OS_NAME STREQUAL "CentOS 7") message(FATAL_ERROR "Pugixml must be used as a ${CPACK_GENERATOR} package. Install libpugixml-dev / pugixml-devel")