Adjusted dependencies (#13942)

* Adjusted dependencies

* Fixed paths on Windows

* Move dependencies close to usage

* Updates
This commit is contained in:
Ilya Lavrenov
2022-11-14 12:57:27 +04:00
committed by GitHub
parent fce64834d2
commit 55a45a4d1a
11 changed files with 118 additions and 81 deletions

View File

@@ -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}