aboutsummaryrefslogtreecommitdiff
path: root/test/googletest
diff options
context:
space:
mode:
authorMateusz Loskot <mateusz@loskot.net>2018-06-07 17:45:42 +0200
committerMateusz Loskot <mateusz@loskot.net>2018-06-07 21:21:49 +0200
commite9b399fc91e72b3cf81337e6b4dca8bc60fafaf8 (patch)
treee7f0d74243cb6bd0ef5510c6ecb4527535490a97 /test/googletest
parentc1a70986674e8129a2a0d1779896386c1fea6a80 (diff)
downloadPROJ-e9b399fc91e72b3cf81337e6b4dca8bc60fafaf8.tar.gz
PROJ-e9b399fc91e72b3cf81337e6b4dca8bc60fafaf8.zip
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
Diffstat (limited to 'test/googletest')
-rw-r--r--test/googletest/CMakeLists.txt.in18
1 files changed, 18 insertions, 0 deletions
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