Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mobile_robotics
wolf_projects
wolf_lib
plugins
apriltag
Commits
a3921d5e
Commit
a3921d5e
authored
May 17, 2022
by
Joan Vallvé Navarro
Browse files
disabling gtest pthreads in cmake<3.11
parent
39912e80
Changes
2
Hide whitespace changes
Inline
Side-by-side
test/CMakeLists.txt
View file @
a3921d5e
# Retrieve googletest from github & compile
add_subdirectory
(
gtest
)
############# USE THIS TEST AS AN EXAMPLE #################
# #
# Create a specific test executable for gtest_example #
# wolf_add_gtest(gtest_example gtest_example.cpp) #
# #
###########################################################
wolf_add_gtest
(
gtest_feature_apriltag gtest_feature_apriltag.cpp
)
wolf_add_gtest
(
gtest_landmark_apriltag gtest_landmark_apriltag.cpp
)
...
...
test/gtest/CMakeLists.txt
View file @
a3921d5e
...
...
@@ -5,15 +5,7 @@ if(${CMAKE_VERSION} VERSION_LESS "3.11.0")
include
(
ExternalProject
)
set
(
GTEST_FORCE_SHARED_CRT ON
)
set
(
GTEST_DISABLE_PTHREADS OFF
)
# For some reason I need to disable PTHREADS
# with g++ (Ubuntu 4.9.3-8ubuntu2~14.04) 4.9.3
# This is a known issue for MinGW :
# https://github.com/google/shaderc/pull/174
#if(MINGW)
# set(GTEST_DISABLE_PTHREADS ON)
#endif()
set
(
GTEST_DISABLE_PTHREADS ON
)
# without this in ubuntu 18.04 we get linking errors
# Download GoogleTest
ExternalProject_Add
(
googletest
...
...
@@ -63,7 +55,13 @@ else()
GIT_REPOSITORY https://github.com/google/googletest.git
GIT_TAG main
)
FetchContent_MakeAvailable
(
googletest
)
#FetchContent_MakeAvailable(googletest)
# Disable installation of googletest: https://stackoverflow.com/questions/65527126/disable-install-for-fetchcontent
FetchContent_GetProperties
(
googletest
)
if
(
NOT googletest_POPULATED
)
FetchContent_Populate
(
googletest
)
add_subdirectory
(
${
googletest_SOURCE_DIR
}
${
googletest_BINARY_DIR
}
EXCLUDE_FROM_ALL
)
endif
()
endif
()
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment