From 23f839ba5d877c4c32ad635bc8a5b343b6778e3a Mon Sep 17 00:00:00 2001
From: Sreekanth Arikatla <sreekanth.arikatla@kitware.com>
Date: Sat, 14 Jul 2018 16:29:54 -0400
Subject: [PATCH] ENH: Move the test data download to individual tests

---
 CMakeLists.txt                  | 14 ++++----------
 Source/Collision/CMakeLists.txt | 12 ++++++++++--
 2 files changed, 14 insertions(+), 12 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3fecf1af9..5b37a885c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -381,15 +381,7 @@ install(
 # Test data download
 #--------------------------------------------------------------------------
 include(imstkExternalDataDownloadTest)
-
-#--------------------------------------------------------------------------
-# Append external data needed for testing to be downloaded later
-#--------------------------------------------------------------------------
-list(APPEND FILE_LIST
-    asianDragon/,REGEX:.*
-    human/,REGEX:.*
-    oneTet/,REGEX:.*)
-    
+ 
 #--------------------------------------------------------------------------
 # Add Examples subdirectories
 #--------------------------------------------------------------------------
@@ -400,7 +392,9 @@ endif()
 #-----------------------------------------------------------------------------
 # Download the external data needed for both testing and examples
 #-----------------------------------------------------------------------------
-imstk_add_data(${PROJECT_NAME} ${FILE_LIST})
+if(BUILD_TESTING OR BUILD_EXAMPLES)
+    imstk_add_data(${PROJECT_NAME} ${FILE_LIST})
+endif()
 
 #--------------------------------------------------------------------------
 # Innerbuild dummy test
diff --git a/Source/Collision/CMakeLists.txt b/Source/Collision/CMakeLists.txt
index fc1b62b91..552254c99 100644
--- a/Source/Collision/CMakeLists.txt
+++ b/Source/Collision/CMakeLists.txt
@@ -15,6 +15,14 @@ imstk_add_library( Collision
 # Testing
 #-----------------------------------------------------------------------------
 if( BUILD_TESTING )
-  include(imstkAddTest)
-  imstk_add_test( Collision )
+        
+    include(imstkAddTest)
+
+    list(APPEND FILE_LIST_COL_TEST
+        asianDragon/,REGEX:.*
+        human/,REGEX:.*
+        oneTet/,REGEX:.*)
+    
+    imstk_add_test(Collision)
+    imstk_add_data(Collision ${FILE_LIST_COL_TEST})
 endif()
-- 
GitLab