From f6602887152621e72a22e31733f6102fe6877d98 Mon Sep 17 00:00:00 2001 From: Ilya Shmygol Date: Mon, 13 Mar 2017 08:28:25 +0100 Subject: [PATCH] Google Test 1.8 compatibility --- CMakeLists.txt | 3 +-- lib/gmock/CMakeLists.txt | 17 ----------------- lib/gtest/CMakeLists.txt | 8 +++++--- 3 files changed, 6 insertions(+), 22 deletions(-) delete mode 100644 lib/gmock/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index f44785f..6954e0c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,7 +3,6 @@ project (arduino_mock) find_package(Threads REQUIRED) add_subdirectory(lib/gtest) -add_subdirectory(lib/gmock) message ("building arduino_mock") message("Gtest include: ${GTEST_INCLUDE_DIRS}") @@ -32,7 +31,7 @@ set_target_properties( arduino_mock RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/dist/bin" ) -add_dependencies(arduino_mock gtest gmock) +add_dependencies(arduino_mock gtest) option(test "Build all tests." OFF) diff --git a/lib/gmock/CMakeLists.txt b/lib/gmock/CMakeLists.txt deleted file mode 100644 index 4ca057e..0000000 --- a/lib/gmock/CMakeLists.txt +++ /dev/null @@ -1,17 +0,0 @@ -cmake_minimum_required(VERSION 2.8.8) -project(gmock_builder C CXX) -include(ExternalProject) - -ExternalProject_Add(gmock - URL https://github.com/paulsapps/gmock-1.7.0/archive/master.zip - PREFIX ${CMAKE_CURRENT_BINARY_DIR}/gmock - INSTALL_COMMAND "" -) - -# Specify include dir -ExternalProject_Get_Property(gmock source_dir) -set(GMOCK_INCLUDE_DIRS ${source_dir}/include PARENT_SCOPE) - -# Specify MainTest's link libraries -ExternalProject_Get_Property(gmock binary_dir) -set(GMOCK_LIBS_DIR ${binary_dir} PARENT_SCOPE) diff --git a/lib/gtest/CMakeLists.txt b/lib/gtest/CMakeLists.txt index 59f285f..b75f5d8 100644 --- a/lib/gtest/CMakeLists.txt +++ b/lib/gtest/CMakeLists.txt @@ -3,15 +3,17 @@ project(gtest_builder C CXX) include(ExternalProject) ExternalProject_Add(gtest - URL https://github.com/google/googletest/archive/release-1.7.0.zip + URL https://github.com/google/googletest/archive/release-1.8.0.zip PREFIX ${CMAKE_CURRENT_BINARY_DIR}/gtest INSTALL_COMMAND "" ) # Specify include dir ExternalProject_Get_Property(gtest source_dir) -set(GTEST_INCLUDE_DIRS ${source_dir}/include PARENT_SCOPE) +set(GTEST_INCLUDE_DIRS ${source_dir}/googletest/include PARENT_SCOPE) +set(GMOCK_INCLUDE_DIRS ${source_dir}/googlemock/include PARENT_SCOPE) # Specify MainTest's link libraries ExternalProject_Get_Property(gtest binary_dir) -set(GTEST_LIBS_DIR ${binary_dir} PARENT_SCOPE) +set(GTEST_LIBS_DIR ${binary_dir}/googlemock/gtest PARENT_SCOPE) +set(GMOCK_LIBS_DIR ${binary_dir}/googlemock PARENT_SCOPE)