From 36a587762b0fca114d654e21c680a9f0ced860c6 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Wed, 28 May 2014 22:02:11 +0200 Subject: [PATCH] Fixing detection of GTEST_DIR variable when defined with -DGTEST_DIR=... --- CMakeLists.txt | 1 - src/tests/CMakeLists.txt | 7 +++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 02e74ae83..dd39c12d5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -198,7 +198,6 @@ endif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") enable_testing() if(EXISTS $ENV{GTEST_DIR}) set(GTEST_DIR $ENV{GTEST_DIR}) - message("++++++++++++++++++HEllo") endif(EXISTS $ENV{GTEST_DIR}) if(GTEST_DIR) message(STATUS "GTEST root folder at ${GTEST_DIR}") diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt index 744ac0a24..58f730476 100644 --- a/src/tests/CMakeLists.txt +++ b/src/tests/CMakeLists.txt @@ -16,7 +16,14 @@ # along with GNSS-SDR. If not, see . # + +if(EXISTS $ENV{GTEST_DIR}) + set(GTEST_DIR_LOCAL $ENV{GTEST_DIR}) +endif(EXISTS $ENV{GTEST_DIR}) set(GTEST_DIR_LOCAL "$ENV{GTEST_DIR}") +if(GTEST_DIR) + set(GTEST_DIR_LOCAL ${GTEST_DIR}) +endif(GTEST_DIR) if(NOT GTEST_DIR_LOCAL) set(GTEST_DIR_LOCAL false CACHE STRING "Gtest downloaded and built automatically" FORCE) else()