Skip to content
Snippets Groups Projects
rootDownloadData.cmake 812 B
Newer Older
Gerardo Ganis's avatar
Gerardo Ganis committed
#---------------------------------------------------------------------------------------------------
# ROOT download test data files
Philippe Canal's avatar
Philippe Canal committed
#   Script arguments:
Gerardo Ganis's avatar
Gerardo Ganis committed
#     DST destination directory

if(NOT DST)
Philippe Canal's avatar
Philippe Canal committed
  set(DST .)
Gerardo Ganis's avatar
Gerardo Ganis committed
endif()

set(rootsite http://root.cern.ch/files)
set(timeout 100)

if(NOT EXISTS ${DST}/h1)
  foreach(f dstarmb.root dstarp1a.root dstarp1b.root dstarp2.root)
    file(DOWNLOAD ${rootsite}/h1/${f} ${DST}/h1/${f} TIMEOUT ${timeout} SHOW_PROGRESS)
  endforeach()
else()
Philippe Canal's avatar
Philippe Canal committed
  message(STATUS "Already existing files in ${DST}/h1")
Gerardo Ganis's avatar
Gerardo Ganis committed
endif()

if(NOT EXISTS ${DST}/event)
  foreach(n 1 2 3 4 5 6 7 8 9 10)
    file(DOWNLOAD ${rootsite}/data/event_${n}.root ${DST}/event/event_${n}.root TIMEOUT ${timeout} SHOW_PROGRESS)
  endforeach()
else()
Philippe Canal's avatar
Philippe Canal committed
  message(STATUS "Already existing files in ${DST}/event")
Gerardo Ganis's avatar
Gerardo Ganis committed
endif()