File tree Expand file tree Collapse file tree 1 file changed +13
-9
lines changed
Expand file tree Collapse file tree 1 file changed +13
-9
lines changed Original file line number Diff line number Diff line change 1- cmake_minimum_required (VERSION 3.5.1 ) # version on Ubuntu Xenial
1+ cmake_minimum_required (VERSION 3.10.2 ) # version on Ubuntu Bionic
22project (behaviortree_cpp_v3)
33
44#---- Add the subdirectory cmake ----
@@ -111,14 +111,18 @@ elseif( CATKIN_DEVEL_PREFIX OR CATKIN_BUILD_BINARY_PACKAGE)
111111 set (BUILD_TOOL_INCLUDE_DIRS ${catkin_INCLUDE_DIRS} )
112112
113113elseif (BUILD_UNIT_TESTS)
114- include (FetchContent)
115- FetchContent_Declare(
116- googletest
117- URL https://github.com/google/googletest/archive/609281088cfefc76f9d0ce82e1ff6c30cc3591e5.zip
118- )
119- # For Windows: Prevent overriding the parent project's compiler/linker settings
120- set (gtest_force_shared_crt ON CACHE BOOL "" FORCE)
121- FetchContent_MakeAvailable(googletest)
114+ if (${CMAKE_VERSION} VERSION_LESS "3.11.0" )
115+ find_package (GTest REQUIRED)
116+ else ()
117+ include (FetchContent)
118+ FetchContent_Declare(
119+ googletest
120+ URL https://github.com/google/googletest/archive/609281088cfefc76f9d0ce82e1ff6c30cc3591e5.zip
121+ )
122+ # For Windows: Prevent overriding the parent project's compiler/linker settings
123+ set (gtest_force_shared_crt ON CACHE BOOL "" FORCE)
124+ FetchContent_MakeAvailable(googletest)
125+ endif ()
122126endif ()
123127
124128
You can’t perform that action at this time.
0 commit comments