Commit 57fa54ca authored by Adam Simpkins's avatar Adam Simpkins Committed by Facebook Github Bot

fix finding gflags in the CMake build (#957)

Summary:
This reverts D7505908 (github commit ad317726 / issue #805), which broke
finding gflags through it's installed CMake configuration file.

The comment from the original diff indicates that they thought this line was
supposed to find folly's `CMake/FindGFlags.cmake` file.  However, this line is
intended to find the `gflags-config.cmake` file installed by gflags.
The `find_package(GFlags MODULE)` check several lines later will be used to
find folly's `FindGFlags.cmake` module if no installed configuration file is
found.

The change in D7505908 caused the code to never use the cmake config file
installed by gflags, due to the case mistmatch with the `gflags_FOUND` check
on the line below.

Closes https://github.com/facebook/folly/pull/957

Reviewed By: yfeldblum

Differential Revision: D13151340

fbshipit-source-id: 0c7234d264dd26ae028a0ae1155c9ddc3f04ea1e
parent 696338da
......@@ -22,7 +22,7 @@ list(APPEND FOLLY_LINK_LIBRARIES ${DOUBLE_CONVERSION_LIBRARY})
list(APPEND FOLLY_INCLUDE_DIRECTORIES ${DOUBLE_CONVERSION_INCLUDE_DIR})
set(FOLLY_HAVE_LIBGFLAGS OFF)
find_package(GFlags CONFIG QUIET)
find_package(gflags CONFIG QUIET)
if (gflags_FOUND)
message(STATUS "Found gflags from package config")
set(FOLLY_HAVE_LIBGFLAGS ON)
......
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