summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorDidier Raboud <odyx@debian.org>2012-12-14 16:10:03 +0100
committerDidier Raboud <odyx@debian.org>2012-12-14 16:36:07 +0100
commite504fe1bb52137bdf34cd5ec9146913fb3d0c135 (patch)
tree630b217fdd1a908991aa013a55a42aaf3ba84773 /CMakeLists.txt
parent2173e86025f03cc19af833f99c786391bd32718e (diff)
downloadcolobot-e504fe1bb52137bdf34cd5ec9146913fb3d0c135.tar.gz
colobot-e504fe1bb52137bdf34cd5ec9146913fb3d0c135.tar.bz2
colobot-e504fe1bb52137bdf34cd5ec9146913fb3d0c135.zip
Use system-provided Google test library.
This avoids library duplication, in favour of a shared (source) library: libgtest-dev is available at least on Debian, Ubuntu, Gentoo, Fedora, at the time of committing. If the library is not found in system paths, a copy of it in lib/gtest can work too.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt8
1 files changed, 6 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 660c79f..6e9e969 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -125,8 +125,12 @@ endif()
if(${TESTS})
# Google Test library
- set(GTEST_DIR "${colobot_SOURCE_DIR}/lib/gtest")
- add_subdirectory(lib/gtest bin/test)
+ find_path(GTEST_SRC_DIR src/gtest.cc PATHS /usr/src/ PATH_SUFFIXES gtest)
+ if(GTEST_SRC_DIR)
+ add_subdirectory(${GTEST_SRC_DIR} bin/test)
+ else(GTEST_SRC_DIR)
+ add_subdirectory(lib/gtest bin/test)
+ endif(GTEST_SRC_DIR)
endif()
# Subdirectory with sources