Skip to content

Commit 9972dc1

Browse files
Fix standalone gflags search (#28930)
### Details: - Unknown issue with `PACKAGE_PREFIX_DIR` after upgrading to cmake 3.30. The PR replaces it with the explicit OV root directory definition. ### Tickets: - *ticket-id*
1 parent 4d01e56 commit 9972dc1

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

src/plugins/intel_npu/tools/compile_tool/cmake/standalone.cmake

+3-2
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,9 @@ find_package(OpenVINO REQUIRED COMPONENTS Runtime)
2121
# gflags is distributed in sources in OpenVINO packages so we need to build it explicitly
2222
#
2323

24-
if(EXISTS "${PACKAGE_PREFIX_DIR}/samples/cpp/thirdparty/gflags")
25-
add_subdirectory("${PACKAGE_PREFIX_DIR}/samples/cpp/thirdparty/gflags" gflags EXCLUDE_FROM_ALL)
24+
get_filename_component(OpenVINO_PACKAGE_DIR "${OpenVINO_DIR}/../.." REALPATH)
25+
if(EXISTS "${OpenVINO_PACKAGE_DIR}/samples/cpp/thirdparty/gflags")
26+
add_subdirectory("${OpenVINO_PACKAGE_DIR}/samples/cpp/thirdparty/gflags" gflags EXCLUDE_FROM_ALL)
2627
else()
2728
find_package(gflags REQUIRED)
2829
endif()

src/plugins/intel_npu/tools/protopipe/cmake/standalone.cmake

+2-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ if (NOT yaml-cpp_FOUND)
2929
endif()
3030

3131
if (NOT gflags_FOUND)
32-
set(GFLAGS_SOURCES_PATH "${PACKAGE_PREFIX_DIR}/samples/cpp/thirdparty/gflags")
32+
get_filename_component(OpenVINO_PACKAGE_DIR "${OpenVINO_DIR}/../.." REALPATH)
33+
set(GFLAGS_SOURCES_PATH "${OpenVINO_PACKAGE_DIR}/samples/cpp/thirdparty/gflags")
3334
message(STATUS "gflags package was not found. Trying to find source package in ${GFLAGS_SOURCES_PATH}.")
3435
if(EXISTS ${GFLAGS_SOURCES_PATH})
3536
message(STATUS "gflags source package found. gflags will be built from sources.")

src/plugins/intel_npu/tools/single-image-test/cmake/standalone.cmake

+3-2
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,9 @@ add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/../common" common EXCLUDE_FROM_ALL
2727
# gflags is distributed in sources in OpenVINO packages so we need to build it explicitly
2828
#
2929

30-
if(EXISTS "${PACKAGE_PREFIX_DIR}/samples/cpp/thirdparty/gflags")
31-
add_subdirectory("${PACKAGE_PREFIX_DIR}/samples/cpp/thirdparty/gflags" gflags EXCLUDE_FROM_ALL)
30+
get_filename_component(OpenVINO_PACKAGE_DIR "${OpenVINO_DIR}/../.." REALPATH)
31+
if(EXISTS "${OpenVINO_PACKAGE_DIR}/samples/cpp/thirdparty/gflags")
32+
add_subdirectory("${OpenVINO_PACKAGE_DIR}/samples/cpp/thirdparty/gflags" gflags EXCLUDE_FROM_ALL)
3233
else()
3334
find_package(gflags REQUIRED)
3435
endif()

0 commit comments

Comments
 (0)