Revert "Use system gflags only in samples (#18478)" (#18543)

This reverts commit bca3f3e441.
This commit is contained in:
Ilya Lavrenov
2023-07-13 21:05:55 +04:00
committed by GitHub
parent bca3f3e441
commit 82fe1677d0
3 changed files with 56 additions and 8 deletions

View File

@@ -100,11 +100,12 @@ endif()
if(TARGET gflags)
set(GFLAGS_TARGET gflags)
elseif(gflags_required)
set(GFLAGS_USE_TARGET_NAMESPACE ON)
set(GFLAGS_SHARED OFF)
set(GFLAGS_NOTHREADS ON)
find_package(gflags QUIET)
if(EXISTS /etc/debian_version)
set(gflags_component nothreads_static)
else()
set(gflags_component shared)
endif()
find_package(gflags QUIET OPTIONAL_COMPONENTS ${gflags_component})
if(gflags_FOUND)
if(TARGET ${GFLAGS_TARGET})
# nothing