Commit 7d4c2a9b authored by Adam Simpkins's avatar Adam Simpkins Committed by Facebook Github Bot

cmake: fix issues in the FindGMock module

Summary:
- Fix the variable name passed to FIND_PACKAGE_HANDLE_STANDARD_ARGS() so that
  it matches the module name (`FindGMock.cmake`).  This makes sure that the
  failure is detected correctly if GMock is not found.
- googletest depends on pthreads, so use `find_package(Threads)` and add
  `Threads::Threads` to the list of required library dependencies.

Reviewed By: yfeldblum

Differential Revision: D9212536

fbshipit-source-id: eae6220a2dbfe777bff1ac0ee0fb4df53de16955
parent f09065c9
...@@ -20,6 +20,7 @@ FIND_LIBRARY(LIBGMOCK_LIBRARY_RELEASE NAMES gmock) ...@@ -20,6 +20,7 @@ FIND_LIBRARY(LIBGMOCK_LIBRARY_RELEASE NAMES gmock)
FIND_LIBRARY(LIBGTEST_LIBRARY_DEBUG NAMES gtestd) FIND_LIBRARY(LIBGTEST_LIBRARY_DEBUG NAMES gtestd)
FIND_LIBRARY(LIBGTEST_LIBRARY_RELEASE NAMES gtest) FIND_LIBRARY(LIBGTEST_LIBRARY_RELEASE NAMES gtest)
find_package(Threads REQUIRED)
INCLUDE(SelectLibraryConfigurations) INCLUDE(SelectLibraryConfigurations)
SELECT_LIBRARY_CONFIGURATIONS(LIBGMOCK_MAIN) SELECT_LIBRARY_CONFIGURATIONS(LIBGMOCK_MAIN)
SELECT_LIBRARY_CONFIGURATIONS(LIBGMOCK) SELECT_LIBRARY_CONFIGURATIONS(LIBGMOCK)
...@@ -29,6 +30,7 @@ set(LIBGMOCK_LIBRARIES ...@@ -29,6 +30,7 @@ set(LIBGMOCK_LIBRARIES
${LIBGMOCK_MAIN_LIBRARY} ${LIBGMOCK_MAIN_LIBRARY}
${LIBGMOCK_LIBRARY} ${LIBGMOCK_LIBRARY}
${LIBGTEST_LIBRARY} ${LIBGTEST_LIBRARY}
Threads::Threads
) )
if(CMAKE_SYSTEM_NAME STREQUAL "Windows") if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
...@@ -44,7 +46,7 @@ endif() ...@@ -44,7 +46,7 @@ endif()
# all listed variables are TRUE # all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs) INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS( FIND_PACKAGE_HANDLE_STANDARD_ARGS(
LIBGMOCK GMock
DEFAULT_MSG DEFAULT_MSG
LIBGMOCK_MAIN_LIBRARY LIBGMOCK_MAIN_LIBRARY
LIBGMOCK_LIBRARY LIBGMOCK_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