1 # - Find gflags library
2 # Find the gflags includes and library
4 # gflags_INCLUDE_DIR - where to find gflags.h.
5 # gflags_LIBRARIES - List of libraries when using gflags.
6 # gflags_FOUND - True if gflags found.
8 find_path(GFLAGS_INCLUDE_DIR
11 find_library(GFLAGS_LIBRARIES
14 include(FindPackageHandleStandardArgs)
15 find_package_handle_standard_args(gflags
16 DEFAULT_MSG GFLAGS_LIBRARIES GFLAGS_INCLUDE_DIR)
22 if(gflags_FOUND AND NOT (TARGET gflags::gflags))
23 add_library(gflags::gflags UNKNOWN IMPORTED)
24 set_target_properties(gflags::gflags
26 IMPORTED_LOCATION ${GFLAGS_LIBRARIES}
27 INTERFACE_INCLUDE_DIRECTORIES ${GFLAGS_INCLUDE_DIR}
28 IMPORTED_LINK_INTERFACE_LANGUAGES "CXX")