Skip to content

Commit

Permalink
changing cmake back?
Browse files Browse the repository at this point in the history
  • Loading branch information
akielaries committed Dec 23, 2024
1 parent 5efb03f commit 1677fba
Showing 1 changed file with 23 additions and 6 deletions.
29 changes: 23 additions & 6 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,24 @@
enable_testing()
find_package(GTest REQUIRED)
include(FetchContent)

find_package(GTest QUIET)

message(STATUS "Detecting GoogleTest")
if(NOT GTest_FOUND)
message(STATUS "GoogleTest not found")
message(STATUS "Fetching GoogleTest")
# If GoogleTest is not found, fetch and build it
include(FetchContent)
FetchContent_Declare(
googletest
#URL https://github.com/google/googletest/archive/03597a01ee50ed33e9dfd640b249b4be3799d395.zip
URL https://github.com/google/googletest/archive/b75ecf1bed2fcd416b66c86cb6fe79122abf132e.zip
)
FetchContent_MakeAvailable(googletest)
message(STATUS "Fetching GoogleTest - done")

else()
message(STATUS "GoogleTest found")
endif()

message(STATUS "Detecting GoogleTest - done")

Expand Down Expand Up @@ -110,9 +129,7 @@ target_compile_options(

target_link_libraries(
test_openGPMP_cpp
#GTest::gtest_main
GTest::GTest
GTest::Main
GTest::gtest_main
pthread
--coverage
-fprofile-arcs
Expand All @@ -122,7 +139,7 @@ target_link_libraries(

target_link_libraries(
test_openGPMP_fortran
#GTest::gtest_main
GTest::gtest_main
pthread
-lgfortran
--coverage
Expand Down

0 comments on commit 1677fba

Please sign in to comment.