Skip to content

glog fails to resolve its gflags dependency when GFLAGS_USE_TARGET_NAMESPACE is ON #18733

@bobuc-havok

Description

@bobuc-havok

Describe the bug
glog fails to link gflags if used in a project that defines GFLAGS_USE_TARGET_NAMESPACE

Environment

  • OS: any
  • Compiler: any

To Reproduce
Steps to reproduce the behavior:

  1. ./vcpkg install glog --triplet=x64-windows-static
  2. The above will install both glog and its dependency gflags
  3. Create a dummy project with a CMakefile that does: set(GFLAGS_USE_TARGET_NAMESPACE ON) find_package(glog CONFIG REQUIRED) find_package(gflags CONFIG REQUIRED)
  4. Have a cmake target that target_link_libraries(blah glog::glog gflags::gflags_static)

Notice how target blah fails to link as glog depends on target gflags which is not defined due to the gflags:: namespace.

Expected behavior
glog should be able to find gflags::gflags in this case. More generally for the static build case it probably doesn't make a lot of sense to be able to mix gflags and gflags::gflags, so it should be possible to decide on either with or without namespace and have all dependent libraries respect that setting.

Failure logs
N/A

Additional context
N/A

Metadata

Metadata

Assignees

Labels

category:port-bugThe issue is with a library, which is something the port should already support

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions