Skip to content

Commit 58ced23

Browse files
committed
Fix system gflags
1 parent 661c04e commit 58ced23

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

third-party/gflags/CMakeLists.txt

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
11
if (NOT CLANG_FORCE_LIBCPP)
2-
find_package(gflags CONFIG)
32

4-
if (TARGET gflags::gflags)
5-
message(STATUS "Using system gflags")
6-
7-
add_library(gflags INTERFACE)
8-
add_dependencies(gflags gflags::gflags)
9-
target_link_libraries(gflags INTERFACE gflags::gflags)
3+
add_library(gflags INTERFACE)
4+
find_package(gflags)
105

11-
get_target_property(GFLAGS_INCLUDE_DIR gflags::gflags INTERFACE_INCLUDE_DIRECTORIES)
6+
if (${gflags_FOUND})
7+
message(STATUS "Using system gflags")
128

13-
target_include_directories(gflags INTERFACE ${GFLAGS_INCLUDE_DIR})
9+
target_link_libraries(gflags INTERFACE ${gflags_LIBRARIES})
10+
target_include_directories(gflags INTERFACE ${gflags_INCLUDE_DIR})
1411

1512
return()
1613
endif()

0 commit comments

Comments
 (0)