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-07-08 19:58:30 -07:00
# Fix how gtest links the C library on windows, see https://github.com/google/googletest/blob/4e4df226fc197c0dda6e37f5c8c3845ca1e73a49/googletest/README.md
set ( gtest_force_shared_crt ON CACHE BOOL "" FORCE )
set ( INSTALL_GTEST off CACHE BOOL "" FORCE )
set ( INSTALL_GMOCK off CACHE BOOL "" FORCE )
2018-05-28 20:39:39 -07:00
add_subdirectory ( gtest EXCLUDE_FROM_ALL )
2019-10-13 23:49:57 +08:00
2019-10-19 18:35:03 -07:00
add_library ( googletest INTERFACE )
target_link_libraries ( googletest INTERFACE gtest gmock )
target_include_directories ( googletest SYSTEM INTERFACE ${ gtest_INCLUDE_DIRS } /include SYSTEM INTERFACE ${ gmock_INCLUDE_DIRS } /include )
2018-07-08 19:58:30 -07:00
endif ( )