From a577fbc63e109b050c0154926ffc9741b68a31e7 Mon Sep 17 00:00:00 2001
From: Andre Sailer <andre.philippe.sailer@cern.ch>
Date: Tue, 19 Jun 2018 16:09:14 +0200
Subject: [PATCH] UtilityApps: protect for dependency on DDTest/BUILD_TESTING

---
 UtilityApps/CMakeLists.txt | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/UtilityApps/CMakeLists.txt b/UtilityApps/CMakeLists.txt
index e200df678..1b74d2037 100644
--- a/UtilityApps/CMakeLists.txt
+++ b/UtilityApps/CMakeLists.txt
@@ -35,14 +35,16 @@ dd4hep_add_executable( dumpdetector
   USES DDRec
   OPTIONAL       [GEANT4 REQUIRED SOURCES src/dumpdetector.cpp])
 #-----------------------------------------------------------------------------------
-dd4hep_add_executable(test_surfaces
-  USES     DDRec DDTest
-  OPTIONAL [LCIO REQUIRED SOURCES src/test_surfaces.cpp])
-#-----------------------------------------------------------------------------------
-dd4hep_add_executable(test_cellid_position_converter
-  USES     DDRec DDTest
-  OPTIONAL [LCIO REQUIRED SOURCES src/test_cellid_position_converter.cpp])
-#-----------------------------------------------------------------------------------
+if(BUILD_TESTING)
+  dd4hep_add_executable(test_surfaces
+    USES     DDRec DDTest
+    OPTIONAL [LCIO REQUIRED SOURCES src/test_surfaces.cpp])
+  #-----------------------------------------------------------------------------------
+  dd4hep_add_executable(test_cellid_position_converter
+    USES     DDRec DDTest
+    OPTIONAL [LCIO REQUIRED SOURCES src/test_cellid_position_converter.cpp])
+  #-----------------------------------------------------------------------------------
+endif()
 dd4hep_add_dictionary( G__eve
   SOURCES src/EvNavHandler.h
   LINKDEF src/LinkDef.h )
-- 
GitLab