From c6867f704fbb6f3316acdf56eb2d589b3d92384e Mon Sep 17 00:00:00 2001
From: joanvallve <jvallve@iri.upc.edu>
Date: Tue, 13 Feb 2024 15:34:32 +0100
Subject: [PATCH] add_gtest

---
 test/CMakeLists.txt       | 12 ++++++------
 test/gtest/CMakeLists.txt |  4 ++--
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 03f45ca..bffa801 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -4,21 +4,21 @@ add_subdirectory(gtest)
 ############# USE THIS TEST AS AN EXAMPLE ####################
 #                                                            #
 # Create a specific test executable for gtest_example        #
-# gnss_utils_add_gtest(gtest_example gtest_example.cpp)      #
+# add_gtest(gtest_example gtest_example.cpp)                 #
 #                                                            #
 ##############################################################
 
 # Navigation test
-gnss_utils_add_gtest(gtest_navigation gtest_navigation.cpp)
+add_gtest(gtest_navigation gtest_navigation.cpp)
 
 # Observations test
-gnss_utils_add_gtest(gtest_observations gtest_observations.cpp)
+add_gtest(gtest_observations gtest_observations.cpp)
 
 # TDCP test
-gnss_utils_add_gtest(gtest_tdcp gtest_tdcp.cpp)
+add_gtest(gtest_tdcp gtest_tdcp.cpp)
 
 # Transformations test
-gnss_utils_add_gtest(gtest_transformations gtest_transformations.cpp)
+add_gtest(gtest_transformations gtest_transformations.cpp)
 
 # ChiSquare test
-gnss_utils_add_gtest(gtest_chisquare gtest_chisquare.cpp)
\ No newline at end of file
+add_gtest(gtest_chisquare gtest_chisquare.cpp)
\ No newline at end of file
diff --git a/test/gtest/CMakeLists.txt b/test/gtest/CMakeLists.txt
index dd83fcf..4fed10a 100644
--- a/test/gtest/CMakeLists.txt
+++ b/test/gtest/CMakeLists.txt
@@ -8,8 +8,8 @@ FetchContent_Declare(
 SET(INSTALL_GTEST OFF) # Disable installation of googletest
 FetchContent_MakeAvailable(googletest)
 
-function(${PROJECT_NAME}_add_gtest target)
+function(add_gtest target)
   add_executable(${target} ${ARGN})
-  target_link_libraries(${target} gtest_main ${PLUGIN_NAME})
+  target_link_libraries(${target} PUBLIC gtest_main ${PLUGIN_NAME})
   add_test(NAME ${target} COMMAND ${target})
 endfunction()
-- 
GitLab