Skip to content

Commit 42e2032

Browse files
committed
Use cmake-scripts to manage gtest dependency
1 parent 25c0b0a commit 42e2032

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

.gitmodules

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
[submodule "lib/googletest"]
2-
path = lib/googletest
3-
url = https://github.com/google/googletest.git
1+
[submodule "lib/cmake-scripts"]
2+
path = lib/cmake-scripts
3+
url = https://github.com/linuxdeploy/cmake-scripts.git

CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,10 @@ endif()
4646

4747
include(CTest)
4848

49-
add_subdirectory(lib)
49+
if(BUILD_TESTING)
50+
# including this before including lib/ makes sure that the top level project's gtest is used everywhere
51+
include(${PROJECT_SOURCE_DIR}/lib/cmake-scripts/include-or-build-gtest.cmake)
52+
endif()
5053

5154
add_subdirectory(src)
5255

lib/CMakeLists.txt

Lines changed: 0 additions & 3 deletions
This file was deleted.

lib/cmake-scripts

Submodule cmake-scripts added at 21bd317

lib/googletest

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)