Skip to content

Commit

Permalink
Merge pull request #13 from jgaa/gtest-again
Browse files Browse the repository at this point in the history
Trying another approach with gtest and it's link target.
  • Loading branch information
jgaa committed Mar 20, 2024
2 parents 171cc59 + dfa3098 commit d98a0d2
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@

if(TARGET GTest::gtest)
set(GTEST_LIBRARIES GTest::gtest)
elseif(TARGET gtest::gtest)
set(GTEST_LIBRARIES gtest::gtest)
else()
message(FATAL_ERROR "Neither GTest::gtest nor gtest::gtest targets were found")
endif()

####### default_to_clog

add_executable(default_to_clog
Expand All @@ -15,7 +24,7 @@ target_include_directories(default_to_clog
)

target_link_libraries(default_to_clog
GTest::gtest
${GTEST_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT}
)

Expand All @@ -40,7 +49,7 @@ target_include_directories(default_to_clog_with_tid
)

target_link_libraries(default_to_clog_with_tid
GTest::gtest
${GTEST_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT}
)

Expand Down

0 comments on commit d98a0d2

Please sign in to comment.