#
# Find libgmock
#
+# LIBGMOCK_DEFINES - List of defines when using libgmock.
# LIBGMOCK_INCLUDE_DIR - where to find gmock/gmock.h, etc.
# LIBGMOCK_LIBRARY - List of libraries when using libgmock.
# LIBGMOCK_FOUND - True if libgmock found.
FIND_LIBRARY(LIBGMOCK_LIBRARY gmock_main)
+# There isn't currently an easy way to determine if a library was compiled as
+# a shared library on Windows, so just assume we've been built against a shared
+# build of gmock for now.
+SET(LIBGMOCK_DEFINES "GTEST_LINKED_AS_SHARED_LIBRARY=1" CACHE STRING "")
+
# handle the QUIETLY and REQUIRED arguments and set LIBGMOCK_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(LIBGMOCK DEFAULT_MSG LIBGMOCK_LIBRARY LIBGMOCK_INCLUDE_DIR)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(LIBGMOCK DEFAULT_MSG LIBGMOCK_DEFINES LIBGMOCK_LIBRARY LIBGMOCK_INCLUDE_DIR)
-MARK_AS_ADVANCED(LIBGMOCK_LIBRARY LIBGMOCK_INCLUDE_DIR)
+MARK_AS_ADVANCED(LIBGMOCK_DEFINES LIBGMOCK_LIBRARY LIBGMOCK_INCLUDE_DIR)
${FOLLY_DIR}/io/async/test/UndelayedDestruction.h
${FOLLY_DIR}/io/async/test/Util.h
)
+ target_compile_definitions(folly_test_support
+ PUBLIC
+ ${LIBGMOCK_DEFINES}
+ )
target_include_directories(folly_test_support
PUBLIC
${LIBGMOCK_INCLUDE_DIR}