Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ ExternalProject_Add(gtest
URL https://github.com/google/googletest/archive/release-1.10.0.zip
PREFIX ${CMAKE_CURRENT_BINARY_DIR}/gtest
INSTALL_COMMAND ""

# pass the super-project compiler and flags to the external project to avoid
# issues with name-mangling - thanks to https://stackoverflow.com/a/41916106/232452
CMAKE_ARGS -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} -DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}
-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS}
)
ExternalProject_Get_Property(gtest source_dir binary_dir)

Expand All @@ -31,4 +36,4 @@ add_dependencies(libgmock gtest)
include_directories(${source_dir}/googlemock/include)

# Then include test directories
add_subdirectory(TestExample)
add_subdirectory(TestExample)