From acc54de922939b0f2a2659966f07b6385a9bf598 Mon Sep 17 00:00:00 2001 From: Povilas Kanapickas Date: Thu, 7 Jan 2021 23:43:51 +0200 Subject: [PATCH] src: Extract test CMake setup to separate file --- src/test/CMakeLists.txt => cmake/gtest.cmake | 15 ++++++--------- src/CMakeLists.txt | 5 ++++- 2 files changed, 10 insertions(+), 10 deletions(-) rename src/test/CMakeLists.txt => cmake/gtest.cmake (80%) diff --git a/src/test/CMakeLists.txt b/cmake/gtest.cmake similarity index 80% rename from src/test/CMakeLists.txt rename to cmake/gtest.cmake index e1b1ecc1..e83491c0 100644 --- a/src/test/CMakeLists.txt +++ b/cmake/gtest.cmake @@ -24,14 +24,14 @@ if (BARRIER_USE_EXTERNAL_GTEST) ) else() include_directories( - ../../ext/gtest - ../../ext/gtest/include - ../../ext/gmock - ../../ext/gmock/include + ../ext/gtest + ../ext/gtest/include + ../ext/gmock + ../ext/gmock/include ) - add_library(gtest STATIC ../../ext/gtest/src/gtest-all.cc) - add_library(gmock STATIC ../../ext/gmock/src/gmock-all.cc) + add_library(gtest STATIC ../ext/gtest/src/gtest-all.cc) + add_library(gmock STATIC ../ext/gmock/src/gmock-all.cc) set(GTEST_LIBRARIES gtest) set(GMOCK_LIBRARIES gmock) @@ -42,6 +42,3 @@ else() set_target_properties(gmock PROPERTIES COMPILE_FLAGS "-w") endif() endif() - -add_subdirectory(integtests) -add_subdirectory(unittests) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 37c698b2..cc44fb25 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -20,8 +20,11 @@ include_directories (${CMAKE_CURRENT_BINARY_DIR}/lib) add_subdirectory(lib) add_subdirectory(cmd) +include(../cmake/gtest.cmake) + if (BARRIER_BUILD_TESTS) - add_subdirectory(test) + add_subdirectory(test/integtests) + add_subdirectory(test/unittests) endif() if (BARRIER_BUILD_GUI)