diff --git a/CMakeLists.txt b/CMakeLists.txt index bb4037744..02e74ae83 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -196,9 +196,10 @@ endif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") # Googletest - http://code.google.com/p/googletest/ ################################################################################ enable_testing() -if($ENV{GTEST_DIR}) +if(EXISTS $ENV{GTEST_DIR}) set(GTEST_DIR $ENV{GTEST_DIR}) -endif($ENV{GTEST_DIR}) + message("++++++++++++++++++HEllo") +endif(EXISTS $ENV{GTEST_DIR}) if(GTEST_DIR) message(STATUS "GTEST root folder at ${GTEST_DIR}") else() diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt index 3208ff8c1..744ac0a24 100644 --- a/src/tests/CMakeLists.txt +++ b/src/tests/CMakeLists.txt @@ -18,9 +18,9 @@ set(GTEST_DIR_LOCAL "$ENV{GTEST_DIR}") if(NOT GTEST_DIR_LOCAL) - set(GTEST_DIR_LOCAL false) + set(GTEST_DIR_LOCAL false CACHE STRING "Gtest downloaded and built automatically" FORCE) else() - set(GTEST_DIR_LOCAL true) + set(GTEST_DIR_LOCAL true CACHE STRING "Gtest already downloaded" FORCE) endif(NOT GTEST_DIR_LOCAL)