From: Jannik ZANDER Date: Fri, 10 Feb 2017 18:24:17 +0000 (+0100) Subject: Fix gtest_main target X-Git-Url: https://git.zndr.dk/?a=commitdiff_plain;h=e22eafd00df1abe177dfe508322f3310f4a2a00f;p=unittest.git Fix gtest_main target --- diff --git a/AddUnitTest.cmake b/AddUnitTest.cmake index da74bf9..05f52ff 100644 --- a/AddUnitTest.cmake +++ b/AddUnitTest.cmake @@ -40,8 +40,7 @@ function(add_unittest) foreach(inc ${my_INCS}) target_include_directories(${my_TARGET} PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/${inc}") endforeach() - target_include_directories(${my_TARGET} PUBLIC "${GTEST_INCLUDE_DIRS}") - target_link_libraries(${my_TARGET} PUBLIC "${my_DEPS}" ${GTEST_BOTH_LIBRARIES}) + target_link_libraries(${my_TARGET} PUBLIC "${my_DEPS}" gtest gtest_main) # Add test to test suite add_test(${my_TARGET} ${my_TARGET})