aboutsummaryrefslogtreecommitdiff
path: root/cmake/FindGMock.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'cmake/FindGMock.cmake')
-rw-r--r--cmake/FindGMock.cmake10
1 files changed, 10 insertions, 0 deletions
diff --git a/cmake/FindGMock.cmake b/cmake/FindGMock.cmake
new file mode 100644
index 0000000..74a1c15
--- /dev/null
+++ b/cmake/FindGMock.cmake
@@ -0,0 +1,10 @@
+# Build with system gmock and embedded gtest
+set (GMOCK_INCLUDE_DIRS "/usr/include/gmock/include" CACHE PATH "gmock source include directory")
+set (GMOCK_SOURCE_DIR "/usr/src/gmock" CACHE PATH "gmock source directory")
+set (GTEST_INCLUDE_DIRS "${GMOCK_SOURCE_DIR}/gtest/include" CACHE PATH "gtest source include directory")
+
+add_subdirectory(${GMOCK_SOURCE_DIR} "${CMAKE_CURRENT_BINARY_DIR}/gmock")
+
+set(GTEST_LIBRARIES gtest)
+set(GTEST_MAIN_LIBRARIES gtest_main)
+set(GMOCK_LIBRARIES gmock gmock_main)