diff --git a/samples/cpp/CMakeLists.txt b/samples/cpp/CMakeLists.txt index 25d85ba213..204ce3f941 100644 --- a/samples/cpp/CMakeLists.txt +++ b/samples/cpp/CMakeLists.txt @@ -112,6 +112,10 @@ if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/common/utils") set(gflags_required ON) endif() +if(NOT TARGET gflags) + find_package(gflags QUIET) +endif() + if(TARGET gflags) set(GFLAGS_TARGET gflags) elseif(gflags_required) diff --git a/samples/cpp/benchmark_app/CMakeLists.txt b/samples/cpp/benchmark_app/CMakeLists.txt index ef339e0a5d..7451e896fd 100644 --- a/samples/cpp/benchmark_app/CMakeLists.txt +++ b/samples/cpp/benchmark_app/CMakeLists.txt @@ -14,6 +14,10 @@ ov_add_sample(NAME ${TARGET_NAME} # Required nlohmann_json dependency +if(NOT TARGET nlohmann_json::nlohmann_json) + find_package(nlohmann_json QUIET) +endif() + if(NOT TARGET nlohmann_json::nlohmann_json) if(EXISTS "${Samples_SOURCE_DIR}/thirdparty/nlohmann_json") # OpenVINO package puts thirdparty to samples dir