From 6087edda9dbf6fcd91e319d3167a0f7a3f96dcc8 Mon Sep 17 00:00:00 2001 From: Chris Kennelly Date: Wed, 23 Apr 2014 00:48:52 -0700 Subject: [PATCH] Add ExternalProject reference to Google Test 1.7.0. --- CMakeLists.txt | 14 ++++++++++++++ third_party/.gitignore | 3 +++ 2 files changed, 17 insertions(+) create mode 100644 third_party/.gitignore diff --git a/CMakeLists.txt b/CMakeLists.txt index e4c6aa2c..316bd3c6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,6 +3,20 @@ project (benchmark) find_package(Threads REQUIRED) +# Import and build Google Test +include(ExternalProject) +set_directory_properties(properties EP_PREFIX "${CMAKE_BINARY_DIR}/third_party") +ExternalProject_Add(googletest + URL "https://googletest.googlecode.com/files/gtest-1.7.0.zip" + URL_HASH SHA1=f85f6d2481e2c6c4a18539e391aa4ea8ab0394af + TLS_VERIFY on + SOURCE_DIR "${CMAKE_BINARY_DIR}/third_party/gtest" + INSTALL_COMMAND "") +ExternalProject_Get_Property(googletest source_dir) +include_directories(${source_dir}/include) +ExternalProject_Get_Property(googletest binary_dir) +link_directories(${binary_dir}) + set(CMAKE_CXX_FLAGS "-Wall -Werror -pedantic-errors --std=c++0x") set(CMAKE_CXX_FLAGS_DEBUG "-g -O0 -DDEBUG") set(CMAKE_CXX_FLAGS_RELEASE "-fno-strict-aliasing -O3 -DNDEBUG") diff --git a/third_party/.gitignore b/third_party/.gitignore new file mode 100644 index 00000000..2b5bda78 --- /dev/null +++ b/third_party/.gitignore @@ -0,0 +1,3 @@ +gtest +src +tmp