diff options
Diffstat (limited to 'Tests/FindGTest/Test')
-rw-r--r-- | Tests/FindGTest/Test/CMakeLists.txt | 17 | ||||
-rw-r--r-- | Tests/FindGTest/Test/main.cxx | 6 |
2 files changed, 23 insertions, 0 deletions
diff --git a/Tests/FindGTest/Test/CMakeLists.txt b/Tests/FindGTest/Test/CMakeLists.txt new file mode 100644 index 0000000..99368ac --- /dev/null +++ b/Tests/FindGTest/Test/CMakeLists.txt @@ -0,0 +1,17 @@ +cmake_minimum_required(VERSION 3.1) +project(TestFindGTest CXX) +include(CTest) + +# CMake does not actually provide FindGTest publicly. +set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../../../Source/Modules) + +find_package(GTest REQUIRED) + +add_executable(test_gtest_tgt main.cxx) +target_link_libraries(test_gtest_tgt GTest::Main) +add_test(NAME test_gtest_tgt COMMAND test_gtest_tgt) + +add_executable(test_gtest_var main.cxx) +target_include_directories(test_gtest_var PRIVATE ${GTEST_INCLUDE_DIRS}) +target_link_libraries(test_gtest_var PRIVATE ${GTEST_BOTH_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT}) +add_test(NAME test_gtest_var COMMAND test_gtest_var) diff --git a/Tests/FindGTest/Test/main.cxx b/Tests/FindGTest/Test/main.cxx new file mode 100644 index 0000000..0572a5d --- /dev/null +++ b/Tests/FindGTest/Test/main.cxx @@ -0,0 +1,6 @@ +#include <gtest/gtest.h> + +TEST(FindCMake, LinksAndRuns) +{ + ASSERT_TRUE(true); +} |