Commit b0c4cd29 authored by Andreas Schuh's avatar Andreas Schuh

fix: Define both 'gflags' and 'gflags::gflags' alias targets

parent 04c8ce76
...@@ -498,6 +498,10 @@ if (GFLAGS_IS_SUBPROJECT) ...@@ -498,6 +498,10 @@ if (GFLAGS_IS_SUBPROJECT)
foreach (type IN ITEMS static shared) foreach (type IN ITEMS static shared)
foreach (opts IN ITEMS "_nothreads" "") foreach (opts IN ITEMS "_nothreads" "")
if (TARGET gflags${opts}_${type}) if (TARGET gflags${opts}_${type})
# Define "gflags" alias for super-projects treating targets of this library as part of their own project
# (also for backwards compatibility with gflags 2.2.1 which only defined this alias)
add_library (gflags ALIAS gflags${opts}_${type})
# Define "gflags::gflags" alias for projects that support both find_package(gflags) and add_subdirectory(gflags)
add_library (gflags::gflags ALIAS gflags${opts}_${type}) add_library (gflags::gflags ALIAS gflags${opts}_${type})
break () break ()
endif () endif ()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment