find package for GTest

This commit is contained in:
Christopher McArthur
2020-05-27 21:58:39 -04:00
parent 041fd12b0f
commit b6e1d4dece

View File

@@ -1,6 +1,8 @@
enable_testing()
include(GoogleTest)
find_package(GTest REQUIRED)
set(TEST_SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/BaseTest.cpp
${CMAKE_CURRENT_SOURCE_DIR}/ClaimTest.cpp
@@ -15,6 +17,6 @@ target_compile_options(jwt-cpp-test PRIVATE
$<$<CXX_COMPILER_ID:MSVC>:/W4>
$<$<CXX_COMPILER_ID:GNU>:-Wall -Wextra -Wpedantic>
$<$<CXX_COMPILER_ID:Clang>:-Weverything>)
target_link_libraries(jwt-cpp-test PRIVATE jwt-cpp::jwt-cpp gtest gtest_main pthread)
target_link_libraries(jwt-cpp-test PRIVATE jwt-cpp::jwt-cpp GTest::GTest GTest::Main pthread)
gtest_add_tests(TARGET jwt-cpp-test)