From 7f0b2f2f7c5eece21e0aec68555e87e034a7c47b Mon Sep 17 00:00:00 2001
From: Pere Mato <pere.mato@cern.ch>
Date: Wed, 12 Nov 2014 08:50:21 +0100
Subject: [PATCH] Create simple.root in the tutorials subdirectory also for the
 build area.

---
 CMakeLists.txt | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 43cd338c273..20e72a1d864 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -138,11 +138,11 @@ install(DIRECTORY ${CMAKE_BINARY_DIR}/etc/dictpch DESTINATION ${CMAKE_INSTALL_SY
 
 #---hsimple.root---------(use the executable for clearer dependencies and proper return code)---
 if(NOT gnuinstall)   # TODO hsimple.root for gnuinstall
-  add_custom_target(hsimple ALL DEPENDS hsimple.root)
+  add_custom_target(hsimple ALL DEPENDS tutorials/hsimple.root)
   add_dependencies(hsimple onepcm)
   ROOT_EXECUTABLE(hsimple.exe test/hsimple.cxx NOINSTALL LIBRARIES RIO Tree Hist)
-  add_custom_command(OUTPUT hsimple.root COMMAND hsimple.exe DEPENDS Cling)
-  install(FILES ${CMAKE_BINARY_DIR}/hsimple.root DESTINATION ${CMAKE_INSTALL_TUTDIR} COMPONENT tests)
+  add_custom_command(OUTPUT tutorials/hsimple.root COMMAND hsimple.exe WORKING_DIRECTORY tutorials DEPENDS Cling)
+  install(FILES ${CMAKE_BINARY_DIR}/tutorials/hsimple.root DESTINATION ${CMAKE_INSTALL_TUTDIR} COMPONENT tests)
 endif()
 
 #---version--------------------------------------------------------------------------------------
-- 
GitLab