diff --git a/CMakeLists.txt b/CMakeLists.txt
index 20b4738741680a961875cc3e868ff79e201deeb7..0453d79208e1ad7f6db0b9a5bdc784460da19b61 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -46,8 +46,13 @@ if(DD4HEP_USE_XERCESC)
 endif()
 
 #---Testing-------------------------------------------------------------------------
-include(CTest)
-enable_testing()
+if(BUILD_TESTING)
+
+  include(CTest)
+  enable_testing()
+  add_subdirectory(DDTest)
+
+endif(BUILD_TESTING)
 
 #---Documentation-------------------------------------------------------------------