# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"). You # may not use this file except in compliance with the License. A copy of # the License is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" file accompanying this file. This file is # distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF # ANY KIND, either express or implied. See the License for the specific # language governing permissions and limitations under the License. # We need thread support find_package(Threads REQUIRED) # Enable ExternalProject CMake module include(ExternalProject) set(XX -D_GLIBCXX_USE_CXX11_ABI=1) # Download and install GoogleTest ExternalProject_Add( gtest URL https://github.com/google/googletest/archive/release-1.8.1.zip PREFIX ${CMAKE_CURRENT_BINARY_DIR}/gtest # Disable install step INSTALL_COMMAND "" CMAKE_ARGS "-DCMAKE_CXX_FLAGS:STRING=-D_GLIBCXX_USE_CXX11_ABI=1" ) # Get GTest source and binary directories from CMake project ExternalProject_Get_Property(gtest source_dir binary_dir) # Create a libgtest target to be used as a dependency by test programs add_library(libgtest IMPORTED STATIC GLOBAL) add_dependencies(libgtest gtest) # Set libgtest properties set_target_properties(libgtest PROPERTIES "IMPORTED_LOCATION" "${binary_dir}/googlemock/gtest/libgtest.a" "IMPORTED_LINK_INTERFACE_LIBRARIES" "${CMAKE_THREAD_LIBS_INIT}" ) target_compile_options(libgtest INTERFACE -D_GLIBCXX_USE_CXX11_ABI=1) # Create a libgmock target to be used as a dependency by test programs add_library(libgmock IMPORTED STATIC GLOBAL) add_dependencies(libgmock gtest) # Set libgmock properties set_target_properties(libgmock PROPERTIES "IMPORTED_LOCATION" "${binary_dir}/googlemock/libgmock.a" "IMPORTED_LINK_INTERFACE_LIBRARIES" "${CMAKE_THREAD_LIBS_INIT}" ) # I couldn't make it work with INTERFACE_INCLUDE_DIRECTORIES include_directories("${source_dir}/googletest/include" "${source_dir}/googlemock/include") add_subdirectory(testRecordReader) add_subdirectory(testPipeStateManager)