Skip to content

Commit 53e2f48

Browse files
committed
Use cmake-scripts to manage gtest dependency
1 parent 4642351 commit 53e2f48

File tree

6 files changed

+13
-9
lines changed

6 files changed

+13
-9
lines changed

.gitmodules

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[submodule "lib/linuxdeploy"]
22
path = lib/linuxdeploy
33
url = https://github.com/TheAssassin/linuxdeploy
4-
[submodule "lib/googletest"]
5-
path = lib/googletest
6-
url = https://github.com/google/googletest.git
4+
[submodule "lib/cmake-scripts"]
5+
path = lib/cmake-scripts
6+
url = https://github.com/linuxdeploy/cmake-scripts.git

CMakeLists.txt

+8-1
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,17 @@ include(CTest)
66
set(CMAKE_CXX_STANDARD 11)
77
set(CMAKE_CXX_STANDARD_REQUIRED ON)
88

9+
include(CTest)
10+
11+
if(BUILD_TESTING)
12+
# including this before including lib/ makes sure that the top level project's gtest is used everywhere
13+
include(${PROJECT_SOURCE_DIR}/lib/cmake-scripts/include-or-build-gtest.cmake)
14+
endif()
15+
916
add_subdirectory(lib)
17+
1018
add_subdirectory(src)
1119

12-
include(CTest)
1320
if(BUILD_TESTING)
1421
enable_testing()
1522
add_subdirectory(tests)

lib/CMakeLists.txt

-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
add_subdirectory(linuxdeploy EXCLUDE_FROM_ALL)
2-
if(NOT TARGET gtest AND BUILD_TESTING)
3-
add_subdirectory(googletest EXCLUDE_FROM_ALL)
4-
endif()
52

63
# required to properly build nlohmann/json v. 2.0.0 on trusty
74
set(CMAKE_CXX_STANDARD 11)

lib/cmake-scripts

Submodule cmake-scripts added at 21bd317

lib/googletest

-1
This file was deleted.

lib/linuxdeploy

0 commit comments

Comments
 (0)