Skip to content

Commit

Permalink
cmake: prefer linking against gflags::gflags (fixes google#683)
Browse files Browse the repository at this point in the history
  • Loading branch information
sergiud committed Jul 13, 2021
1 parent 42ce901 commit 5bf7fde
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -630,7 +630,12 @@ if (HAVE_PTHREAD)
endif (HAVE_PTHREAD)

if (gflags_FOUND)
target_link_libraries (glog PUBLIC gflags)
# Prefer the gflags target that uses double colon convention
if (TARGET gflags::gflags)
target_link_libraries (glog PUBLIC gflags::gflags)
else (TARGET gflags::gflags)
target_link_libraries (glog PUBLIC gflags)
endif (TARGET gflags::gflags)

target_compile_definitions (glog PRIVATE
GFLAGS_DLL_DECLARE_FLAG=GOOGLE_GLOG_DLL_DECL
Expand Down

0 comments on commit 5bf7fde

Please sign in to comment.