Package: libgflags-dev
Version: 2.2.2-3
Severity: normal
Hi. I'm building a project that uses cmake and libgflags-dev. It has
this:
find_package(gflags NO_MODULE
NO_CMAKE_PACKAGE_REGISTRY
NO_CMAKE_BUILDS_PATH)
And says this:
-- Found installed version of gflags: /lib/x86_64-linux-gnu/cmake/gflags
-- Detected gflags version: 2.2.2
CMake Error at cmake/FindGflags.cmake:118 (message):
Failed to find gflags - Could not find file: //include/gflags/gflags.h
containing namespace information in gflags install located at: //include.
Because /usr/lib/x86_64-linux-gnu/cmake/gflags/gflags-config.cmake has:
## gflags CMake configuration file
# library version information
set (GFLAGS_VERSION_STRING "2.2.2")
set (GFLAGS_VERSION_MAJOR 2)
set (GFLAGS_VERSION_MINOR 2)
set (GFLAGS_VERSION_PATCH 0)
# import targets
if (NOT DEFINED GFLAGS_USE_TARGET_NAMESPACE)
set (GFLAGS_USE_TARGET_NAMESPACE FALSE)
endif ()
if (GFLAGS_USE_TARGET_NAMESPACE)
include ("${CMAKE_CURRENT_LIST_DIR}/gflags-targets.cmake")
set (GFLAGS_TARGET_NAMESPACE gflags)
else ()
include ("${CMAKE_CURRENT_LIST_DIR}/gflags-nonamespace-targets.cmake")
set (GFLAGS_TARGET_NAMESPACE)
endif ()
if (GFLAGS_TARGET_NAMESPACE)
set (GFLAGS_TARGET_PREFIX ${GFLAGS_TARGET_NAMESPACE}::)
else ()
set (GFLAGS_TARGET_PREFIX)
endif ()
# installation prefix
get_filename_component (CMAKE_CURRENT_LIST_DIR "${CMAKE_CURRENT_LIST_FILE}"
PATH)
get_filename_component (_INSTALL_PREFIX
"${CMAKE_CURRENT_LIST_DIR}/../../../../" ABSOLUTE)
# include directory
#
# Newer versions of CMake set the INTERFACE_INCLUDE_DIRECTORIES property
# of the imported targets. It is hence not necessary to add this path
# manually to the include search path for targets which link to gflags.
set (GFLAGS_INCLUDE_DIR "${_INSTALL_PREFIX}/include")
Note the line:
get_filename_component (_INSTALL_PREFIX
"${CMAKE_CURRENT_LIST_DIR}/../../../../" ABSOLUTE)
If we have usrmerge, and stuff uses /lib, then _INSTALL_PREFIX becomes
/, and GFLAGS_INCLUDE_DIR is broken.
Thanks.