Skip to content
Snippets Groups Projects
Commit bce82689 authored by Joan Vallvé Navarro's avatar Joan Vallvé Navarro
Browse files

avoid gtest installation

parent 0363ee85
No related branches found
No related tags found
2 merge requests!23after cmake refactor,!22Resolve "Adapt to wolf core CMakeLists.txt refactor"
Pipeline #10919 failed
This commit is part of merge request !22. Comments created here will be created in the context of that merge request.
...@@ -63,7 +63,12 @@ else() ...@@ -63,7 +63,12 @@ else()
GIT_REPOSITORY https://github.com/google/googletest.git GIT_REPOSITORY https://github.com/google/googletest.git
GIT_TAG main) GIT_TAG main)
FetchContent_MakeAvailable(googletest) #FetchContent_MakeAvailable(googletest)
FetchContent_GetProperties(googletest)
if(NOT googletest_POPULATED)
FetchContent_Populate(googletest)
add_subdirectory(${googletest_SOURCE_DIR} ${googletest_BINARY_DIR} EXCLUDE_FROM_ALL)
endif()
endif() endif()
...@@ -71,7 +76,7 @@ function(gnss_utils_add_gtest target) ...@@ -71,7 +76,7 @@ function(gnss_utils_add_gtest target)
add_executable(${target} ${ARGN}) add_executable(${target} ${ARGN})
if(${CMAKE_VERSION} VERSION_LESS "3.11.0") if(${CMAKE_VERSION} VERSION_LESS "3.11.0")
add_dependencies(${target} libgtest) add_dependencies(${target} libgtest)
target_link_libraries(${target} libgtest ${PROJECT_NAME}) target_link_libraries(${target} PUBLIC libgtest ${PROJECT_NAME})
target_include_directories(${target} PUBLIC ${GTEST_INCLUDE_DIRS}) target_include_directories(${target} PUBLIC ${GTEST_INCLUDE_DIRS})
else() else()
target_link_libraries(${target} PUBLIC gtest_main ${PROJECT_NAME}) target_link_libraries(${target} PUBLIC gtest_main ${PROJECT_NAME})
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment