pmaports/unity8/unity-system-compositor/0001-Use-GMock-config-from-cmake-extras.patch
Luca Weiss 8c2a95dbe2
unity8: initial packaging (!27)
* Mir starts up and is able to display system settings
* x86_64 only for now, because at least ubuntu-app-test did not build
  on aarch64

Based on PureTryOut's work. Getting it to this stage was a huge effort
(as it shows in the package count: 111(!)). See the merge request for
details.

[skip ci]: this won't finish in CI; ollieparanoid made sure that
           everything builds for x86_64.
2019-02-13 21:47:29 +01:00

97 lines
3.1 KiB
Diff

From 8a7bf1e2b6499cccaf92bd36ce30f10643b7719a Mon Sep 17 00:00:00 2001
From: Luca Weiss <luca@z3ntu.xyz>
Date: Tue, 29 Jan 2019 19:15:51 +0100
Subject: [PATCH] Use GMock config from cmake-extras
---
CMakeLists.txt | 2 +-
cmake/FindGtest.cmake | 64 -------------------------------------------
2 files changed, 1 insertion(+), 65 deletions(-)
delete mode 100644 cmake/FindGtest.cmake
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 87e95fa..5b7e4d3 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -57,7 +57,7 @@ enable_testing()
option(MIR_ENABLE_TESTS "Build tests" ON)
if (MIR_ENABLE_TESTS)
- find_package(Gtest REQUIRED)
+ find_package(GMock REQUIRED)
include_directories(${MIRCLIENT_INCLUDE_DIRS} )
include_directories(${GMOCK_INCLUDE_DIR} ${GTEST_INCLUDE_DIR})
add_subdirectory(tests/)
diff --git a/cmake/FindGtest.cmake b/cmake/FindGtest.cmake
deleted file mode 100644
index 15a34a1..0000000
--- a/cmake/FindGtest.cmake
+++ /dev/null
@@ -1,64 +0,0 @@
-include(ExternalProject)
-include(FindPackageHandleStandardArgs)
-
-#gtest
-if(EXISTS /usr/src/googletest)
- set(USING_GOOGLETEST_1_8 TRUE)
- set(GTEST_INSTALL_DIR /usr/src/googletest/googletest/include)
-else()
- set(GTEST_INSTALL_DIR /usr/src/gmock/gtest/include)
-endif()
-
-find_path(GTEST_INCLUDE_DIR gtest/gtest.h
- HINTS ${GTEST_INSTALL_DIR})
-
-#gmock
-find_path(GMOCK_INSTALL_DIR CMakeLists.txt
- HINTS /usr/src/googletest /usr/src/gmock)
-if(${GMOCK_INSTALL_DIR} STREQUAL "GMOCK_INSTALL_DIR-NOTFOUND")
- message(FATAL_ERROR "google-mock package not found")
-endif()
-
-find_path(GMOCK_INCLUDE_DIR gmock/gmock.h)
-
-if (USING_GOOGLETEST_1_8)
- set(GMOCK_BASE_BINARY_DIR ${CMAKE_BINARY_DIR}/gmock/libs)
- set(GMOCK_BINARY_DIR ${GMOCK_BASE_BINARY_DIR}/googlemock)
- set(GTEST_BINARY_DIR ${GMOCK_BINARY_DIR}/gtest)
-else()
- set(GMOCK_BASE_BINARY_DIR ${CMAKE_BINARY_DIR}/gmock/libs)
- set(GMOCK_BINARY_DIR ${GMOCK_BASE_BINARY_DIR})
- set(GTEST_BINARY_DIR ${GMOCK_BINARY_DIR}/gtest)
-endif()
-
-set(GTEST_CMAKE_ARGS "")
-
-if (USING_GOOGLETEST_1_8)
- list(APPEND GTEST_CMAKE_ARGS -DBUILD_GTEST=ON)
-endif()
-
-ExternalProject_Add(
- GMock
- #where to build in source tree
- PREFIX ${GMOCK_PREFIX}
- #where the source is external to the project
- SOURCE_DIR ${GMOCK_INSTALL_DIR}
- #forward the compilers to the subproject so cross-arch builds work
- CMAKE_ARGS ${GTEST_CMAKE_ARGS}
- BINARY_DIR ${GMOCK_BASE_BINARY_DIR}
-
- #we don't need to install, so skip
- INSTALL_COMMAND ""
-)
-
-set(GMOCK_LIBRARY ${GMOCK_BINARY_DIR}/libgmock.a)
-set(GMOCK_MAIN_LIBRARY ${GMOCK_BINARY_DIR}/libgmock_main.a)
-set(GMOCK_BOTH_LIBRARIES ${GMOCK_LIBRARY} ${GMOCK_MAIN_LIBRARY})
-set(GTEST_LIBRARY ${GTEST_BINARY_DIR}/libgtest.a)
-set(GTEST_MAIN_LIBRARY ${GTEST_BINARY_DIR}/libgtest_main.a)
-set(GTEST_BOTH_LIBRARIES ${GTEST_LIBRARY} ${GTEST_MAIN_LIBRARY})
-set(GTEST_ALL_LIBRARIES ${GTEST_BOTH_LIBRARIES} ${GMOCK_BOTH_LIBRARIES})
-
-find_package_handle_standard_args(GTest DEFAULT_MSG
- GMOCK_INCLUDE_DIR
- GTEST_INCLUDE_DIR)
--
2.20.1