2016-02-11 17:34:08 +01:00
|
|
|
include(CTest)
|
2016-02-11 14:01:59 +01:00
|
|
|
|
2016-02-11 17:34:08 +01:00
|
|
|
if (BUILD_TESTING)
|
2018-05-19 21:33:28 +02:00
|
|
|
add_subdirectory(gtest-1.8.0 EXCLUDE_FROM_ALL)
|
2016-02-11 17:34:08 +01:00
|
|
|
|
|
|
|
project (googletest)
|
|
|
|
add_library(${PROJECT_NAME} dummy.cpp)
|
2018-05-21 00:13:49 +02:00
|
|
|
target_link_libraries(${PROJECT_NAME} PUBLIC gtest gmock)
|
|
|
|
target_link_libraries(${PROJECT_NAME} PRIVATE gmock_main)
|
2016-02-11 17:34:08 +01:00
|
|
|
target_include_directories(${PROJECT_NAME} SYSTEM INTERFACE ${gtest_INCLUDE_DIRS}/include SYSTEM ${gmock_INCLUDE_DIRS}/include)
|
2017-10-27 05:00:39 +02:00
|
|
|
|
|
|
|
# Disable "missing override" warning because gmock MOCK_METHOD() don't use override :(
|
|
|
|
target_compile_options(${PROJECT_NAME} PUBLIC "-Wno-inconsistent-missing-override")
|
2016-02-11 17:34:08 +01:00
|
|
|
endif (BUILD_TESTING)
|