Commit 7187a3af authored by Adam Simpkins's avatar Adam Simpkins Committed by Facebook GitHub Bot

fix FindDoubleConversion.cmake to work properly

Summary:
The code in `FindDoubleConversion.cmake` called
`FIND_PACKAGE_HANDLE_STANDARD_ARGS()` with the wrong arguments.  The first
argument must match the package name: since this file is called
`FindDoubleConversion` the first argument must be `DoubleConversion`.

Previously this code was passing in `DOUBLE_CONVERSION`, causing it to set
`DOUBLE_CONVERSION_FOUND` instead of `DoubleConversion_FOUND`.  Since this
module did not set `DoubleConversion_FOUND` the `find_package()` call assumed
it always succeeded, even when the double-conversion library was not found.

Also remove the extra status message.  `FIND_PACKAGE_HANDLE_STANDARD_ARGS()`
already prints out a status message as long as `find_package()` was called
without the `QUIET` argument.

Reviewed By: yfeldblum

Differential Revision: D23588980

fbshipit-source-id: 8c088930b1b01c027403c3e425f1924f6149f72a
parent 41b44bcf
......@@ -23,14 +23,9 @@ find_path(DOUBLE_CONVERSION_INCLUDE_DIR double-conversion/double-conversion.h)
find_library(DOUBLE_CONVERSION_LIBRARY NAMES double-conversion)
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(
DOUBLE_CONVERSION DEFAULT_MSG
find_package_handle_standard_args(
DoubleConversion
DEFAULT_MSG
DOUBLE_CONVERSION_LIBRARY DOUBLE_CONVERSION_INCLUDE_DIR)
if (NOT DOUBLE_CONVERSION_FOUND)
message(STATUS "Using third-party bundled double-conversion")
else()
message(STATUS "Found double-conversion: ${DOUBLE_CONVERSION_LIBRARY}")
endif (NOT DOUBLE_CONVERSION_FOUND)
mark_as_advanced(DOUBLE_CONVERSION_INCLUDE_DIR DOUBLE_CONVERSION_LIBRARY)
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