build BUGFIX allow disabling tests for debug build

... by disabling just the single option.
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5a05691..ad9926a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -230,12 +230,15 @@
 endif()
 
 if(ENABLE_VALGRIND_TESTS)
-    find_program(VALGRIND_FOUND valgrind)
-    if(NOT VALGRIND_FOUND)
-        message(WARNING "valgrind executable not found! Disabling memory leaks tests.")
+    if(NOT ENABLE_TESTS)
+        message(WARNING "Tests are disabled! Disabling memory leak tests.")
         set(ENABLE_VALGRIND_TESTS OFF)
     else()
-        set(ENABLE_TESTS ON)
+        find_program(VALGRIND_FOUND valgrind)
+        if(NOT VALGRIND_FOUND)
+            message(WARNING "valgrind executable not found! Disabling memory leak tests.")
+            set(ENABLE_VALGRIND_TESTS OFF)
+        endif()
     endif()
 endif()
 
@@ -245,7 +248,7 @@
         message(STATUS "Disabling tests because of missing CMocka")
         set(ENABLE_TESTS OFF)
     endif()
-endif(ENABLE_TESTS)
+endif()
 
 if(ENABLE_COVERAGE)
     gen_coverage_enable(${ENABLE_TESTS})