From e9b399fc91e72b3cf81337e6b4dca8bc60fafaf8 Mon Sep 17 00:00:00 2001 From: Mateusz Loskot Date: Thu, 7 Jun 2018 17:45:42 +0200 Subject: Add CMake configuration for test/googletest and test/unit For CMake builds, latest googletest 1.8.0 is downloaded. Following officially recommended integration for CMake-enabled projects https://github.com/google/googletest/blob/master/googletest/README.md "Use CMake to download GoogleTest as part of the build's configure step. This is just a little more complex, but doesn't have the limitations of the other methods." Since, our copy of test/googletest - is a very minimalist copy of googletest - does not include any official CMake scripts - would require copying parts of googletest CMakeLists.txt, compilater/linker flags (e.g. -lpthreads) for reliable multi-platform builds, it is reasoanable to rely on download All pros and cons advantages are discussed in teh README.md linked above. Closes #1033 --- test/googletest/CMakeLists.txt.in | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 test/googletest/CMakeLists.txt.in (limited to 'test/googletest') diff --git a/test/googletest/CMakeLists.txt.in b/test/googletest/CMakeLists.txt.in new file mode 100644 index 00000000..38f90ca5 --- /dev/null +++ b/test/googletest/CMakeLists.txt.in @@ -0,0 +1,18 @@ +# Source https://github.com/google/googletest/blob/master/googletest/README.md +cmake_minimum_required(VERSION 2.8.2) # minimum version for ExternalProject_Add + +project(googletest-download NONE) + +include(ExternalProject) +ExternalProject_Add(googletest + URL https://github.com/google/googletest/archive/release-1.8.0.zip + URL_HASH SHA1=667f873ab7a4d246062565fad32fb6d8e203ee73 + DOWNLOAD_NO_PROGRESS ON + SOURCE_DIR "${CMAKE_BINARY_DIR}/googletest-src" + BINARY_DIR "${CMAKE_BINARY_DIR}/googletest-build" + CONFIGURE_COMMAND "" + BUILD_COMMAND "" + TEST_COMMAND "" + # Disable install step + INSTALL_COMMAND "" +) \ No newline at end of file -- cgit v1.2.3