From 6d00c22813a7ed1bf6e008b41890dcd30e0d6a0f Mon Sep 17 00:00:00 2001
From: Julien Malik <julien.malik@c-s.fr>
Date: Sun, 11 Mar 2012 16:18:39 +0100
Subject: [PATCH] COMP: support using TestingHelper for OTB_TESTING_STANDALONE
 mode

---
 Testing/CMakeLists.txt                           | 3 +++
 Testing/Code/ApplicationEngine/CMakeLists.txt    | 1 -
 Testing/Code/BasicFilters/CMakeLists.txt         | 1 -
 Testing/Code/ChangeDetection/CMakeLists.txt      | 1 -
 Testing/Code/Common/CMakeLists.txt               | 1 -
 Testing/Code/DisparityMap/CMakeLists.txt         | 1 -
 Testing/Code/FeatureExtraction/CMakeLists.txt    | 1 -
 Testing/Code/Fusion/CMakeLists.txt               | 1 -
 Testing/Code/Fuzzy/CMakeLists.txt                | 1 -
 Testing/Code/GeospatialAnalysis/CMakeLists.txt   | 1 -
 Testing/Code/Gui/CMakeLists.txt                  | 1 -
 Testing/Code/Hyperspectral/CMakeLists.txt        | 1 -
 Testing/Code/IO/CMakeLists.txt                   | 1 -
 Testing/Code/Learning/CMakeLists.txt             | 1 -
 Testing/Code/Markov/CMakeLists.txt               | 1 -
 Testing/Code/MultiScale/CMakeLists.txt           | 1 -
 Testing/Code/MultiTemporal/CMakeLists.txt        | 1 -
 Testing/Code/OBIA/CMakeLists.txt                 | 1 -
 Testing/Code/ObjectDetection/CMakeLists.txt      | 1 -
 Testing/Code/Projections/CMakeLists.txt          | 1 -
 Testing/Code/Radiometry/CMakeLists.txt           | 1 -
 Testing/Code/SARPolarimetry/CMakeLists.txt       | 1 -
 Testing/Code/Simulation/CMakeLists.txt           | 1 -
 Testing/Code/SpatialReasoning/CMakeLists.txt     | 1 -
 Testing/Code/TestSystem/CMakeLists.txt           | 1 -
 Testing/Code/UtilitiesAdapters/CMakeLists.txt    | 1 -
 Testing/Code/Visu/CMakeLists.txt                 | 1 -
 Testing/Code/Visualization/CMakeLists.txt        | 1 -
 Testing/Code/Wrappers/CommandLine/CMakeLists.txt | 1 -
 Testing/Code/Wrappers/Java/CMakeLists.txt        | 1 -
 Testing/Code/Wrappers/Python/CMakeLists.txt      | 1 -
 {CMake => Testing}/TestingHelper.cmake           | 0
 32 files changed, 3 insertions(+), 30 deletions(-)
 rename {CMake => Testing}/TestingHelper.cmake (100%)

diff --git a/Testing/CMakeLists.txt b/Testing/CMakeLists.txt
index c7989778f1..62df7c3514 100644
--- a/Testing/CMakeLists.txt
+++ b/Testing/CMakeLists.txt
@@ -10,6 +10,7 @@ FILE(MAKE_DIRECTORY ${OTBTesting_BINARY_DIR}/Temporary)
 
 IF(OTB_BINARY_DIR)
   # We are building inside the tree.
+  INCLUDE(${CMAKE_CURRENT_SOURCE_DIR}/TestingHelper.cmake)
   ADD_SUBDIRECTORY(Code)
   ADD_SUBDIRECTORY(Fa)
   ADD_SUBDIRECTORY(Utilities)
@@ -49,6 +50,8 @@ ELSE(OTB_BINARY_DIR)
     MARK_AS_ADVANCED(OTB_DATA_LARGEINPUT_ROOT)
   ENDIF(OTB_DATA_USE_LARGEINPUT)
 
+  INCLUDE(${CMAKE_CURRENT_SOURCE_DIR}/TestingHelper.cmake)
+
   MACRO(OTB_ADD_EXECUTABLE name sources libraries)
     ADD_EXECUTABLE(${name} ${sources})
     TARGET_LINK_LIBRARIES(${name}  ${libraries})
diff --git a/Testing/Code/ApplicationEngine/CMakeLists.txt b/Testing/Code/ApplicationEngine/CMakeLists.txt
index e3d711ad68..1f7808c586 100644
--- a/Testing/Code/ApplicationEngine/CMakeLists.txt
+++ b/Testing/Code/ApplicationEngine/CMakeLists.txt
@@ -1,6 +1,5 @@
 if( NOT OTB_DISABLE_CXX_TESTING AND BUILD_TESTING )
 
-INCLUDE(TestingHelper)
 
 set(CXX_TEST_PATH ${EXECUTABLE_OUTPUT_PATH})
 
diff --git a/Testing/Code/BasicFilters/CMakeLists.txt b/Testing/Code/BasicFilters/CMakeLists.txt
index 3ad40a027b..456e9447a4 100644
--- a/Testing/Code/BasicFilters/CMakeLists.txt
+++ b/Testing/Code/BasicFilters/CMakeLists.txt
@@ -1,7 +1,6 @@
 
 IF( NOT OTB_DISABLE_CXX_TESTING AND BUILD_TESTING )
 
-INCLUDE(TestingHelper)
 
 SET(BASICFILTERS_TESTS1 ${CXX_TEST_PATH}/otbBasicFiltersTests1)
 SET(BASICFILTERS_TESTS2 ${CXX_TEST_PATH}/otbBasicFiltersTests2)
diff --git a/Testing/Code/ChangeDetection/CMakeLists.txt b/Testing/Code/ChangeDetection/CMakeLists.txt
index 6cb707e41f..cb80c98765 100644
--- a/Testing/Code/ChangeDetection/CMakeLists.txt
+++ b/Testing/Code/ChangeDetection/CMakeLists.txt
@@ -1,7 +1,6 @@
 
 IF( NOT OTB_DISABLE_CXX_TESTING AND BUILD_TESTING )
 
-INCLUDE(TestingHelper)
 
 SET(CHANGEDETECTION_TESTS1 ${CXX_TEST_PATH}/otbChangeDetectionTests1)
 SET(CHANGEDETECTION_TESTS2 ${CXX_TEST_PATH}/otbChangeDetectionTests2)
diff --git a/Testing/Code/Common/CMakeLists.txt b/Testing/Code/Common/CMakeLists.txt
index c253fe5973..b5ee7c1ba2 100644
--- a/Testing/Code/Common/CMakeLists.txt
+++ b/Testing/Code/Common/CMakeLists.txt
@@ -1,6 +1,5 @@
 IF( NOT OTB_DISABLE_CXX_TESTING AND BUILD_TESTING )
 
-INCLUDE(TestingHelper)
 
 SET(COMMON_TESTS1 ${CXX_TEST_PATH}/otbCommonTests1)
 SET(COMMON_TESTS2 ${CXX_TEST_PATH}/otbCommonTests2)
diff --git a/Testing/Code/DisparityMap/CMakeLists.txt b/Testing/Code/DisparityMap/CMakeLists.txt
index df1e336c94..dab7c7eb1d 100644
--- a/Testing/Code/DisparityMap/CMakeLists.txt
+++ b/Testing/Code/DisparityMap/CMakeLists.txt
@@ -1,7 +1,6 @@
 
 IF( NOT OTB_DISABLE_CXX_TESTING AND BUILD_TESTING )
 
-INCLUDE(TestingHelper)
 
 SET(DISPARITYMAP_TESTS1 ${CXX_TEST_PATH}/otbDisparityMapTests1)
 SET(DISPARITYMAP_TESTS2 ${CXX_TEST_PATH}/otbDisparityMapTests2)
diff --git a/Testing/Code/FeatureExtraction/CMakeLists.txt b/Testing/Code/FeatureExtraction/CMakeLists.txt
index 72fa86d103..a1c905c7f8 100644
--- a/Testing/Code/FeatureExtraction/CMakeLists.txt
+++ b/Testing/Code/FeatureExtraction/CMakeLists.txt
@@ -1,7 +1,6 @@
 
 IF( NOT OTB_DISABLE_CXX_TESTING AND BUILD_TESTING )
 
-INCLUDE(TestingHelper)
 
 SET(FEATUREEXTRACTION_TESTS1 ${CXX_TEST_PATH}/otbFeatureExtractionTests1)
 SET(FEATUREEXTRACTION_TESTS2 ${CXX_TEST_PATH}/otbFeatureExtractionTests2)
diff --git a/Testing/Code/Fusion/CMakeLists.txt b/Testing/Code/Fusion/CMakeLists.txt
index 889d2d3e62..08bc51f6bc 100644
--- a/Testing/Code/Fusion/CMakeLists.txt
+++ b/Testing/Code/Fusion/CMakeLists.txt
@@ -1,7 +1,6 @@
 
 IF( NOT OTB_DISABLE_CXX_TESTING AND BUILD_TESTING )
 
-INCLUDE(TestingHelper)
 
 SET(FUSION_TESTS1 ${CXX_TEST_PATH}/otbFusionTests1)
 
diff --git a/Testing/Code/Fuzzy/CMakeLists.txt b/Testing/Code/Fuzzy/CMakeLists.txt
index b1c75b4448..3c967cdbfe 100644
--- a/Testing/Code/Fuzzy/CMakeLists.txt
+++ b/Testing/Code/Fuzzy/CMakeLists.txt
@@ -1,6 +1,5 @@
 IF( NOT OTB_DISABLE_CXX_TESTING AND BUILD_TESTING )
 
-INCLUDE(TestingHelper)
 
 # Common generic tests
 SET(Fuzzy_TESTS1 ${CXX_TEST_PATH}/otbFuzzyTests1)
diff --git a/Testing/Code/GeospatialAnalysis/CMakeLists.txt b/Testing/Code/GeospatialAnalysis/CMakeLists.txt
index f5d5338e0e..378f0a68e7 100644
--- a/Testing/Code/GeospatialAnalysis/CMakeLists.txt
+++ b/Testing/Code/GeospatialAnalysis/CMakeLists.txt
@@ -1,7 +1,6 @@
 
 IF( NOT OTB_DISABLE_CXX_TESTING AND BUILD_TESTING )
 
-INCLUDE(TestingHelper)
 
 SET(GEOSPATIALANALYSIS_TESTS ${CXX_TEST_PATH}/otbGeospatialAnalysisTests)
 
diff --git a/Testing/Code/Gui/CMakeLists.txt b/Testing/Code/Gui/CMakeLists.txt
index eb05e8c1d6..c8e8efe87e 100644
--- a/Testing/Code/Gui/CMakeLists.txt
+++ b/Testing/Code/Gui/CMakeLists.txt
@@ -1,7 +1,6 @@
 
 IF( NOT OTB_DISABLE_CXX_TESTING AND BUILD_TESTING )
 
-INCLUDE(TestingHelper)
 
 SET(GUI_TESTS ${CXX_TEST_PATH}/otbGuiTests)
 
diff --git a/Testing/Code/Hyperspectral/CMakeLists.txt b/Testing/Code/Hyperspectral/CMakeLists.txt
index d843b2fe09..d44806e30e 100644
--- a/Testing/Code/Hyperspectral/CMakeLists.txt
+++ b/Testing/Code/Hyperspectral/CMakeLists.txt
@@ -1,6 +1,5 @@
 IF( NOT OTB_DISABLE_CXX_TESTING AND BUILD_TESTING )
 
-INCLUDE(TestingHelper)
 
 SET(Hyperspectral_TESTS1 ${CXX_TEST_PATH}/otbHyperspectralTests1)
 SET(Hyperspectral_TESTS2 ${CXX_TEST_PATH}/otbHyperspectralTests2)
diff --git a/Testing/Code/IO/CMakeLists.txt b/Testing/Code/IO/CMakeLists.txt
index f432ede22e..76eac9d705 100644
--- a/Testing/Code/IO/CMakeLists.txt
+++ b/Testing/Code/IO/CMakeLists.txt
@@ -1,7 +1,6 @@
 
 IF( NOT OTB_DISABLE_CXX_TESTING AND BUILD_TESTING )
 
-INCLUDE(TestingHelper)
 
 SET(COMMON_TESTS2 ${CXX_TEST_PATH}/otbCommonTests2)
 SET(COMMON_TESTS3 ${CXX_TEST_PATH}/otbCommonTests3)
diff --git a/Testing/Code/Learning/CMakeLists.txt b/Testing/Code/Learning/CMakeLists.txt
index bd0d803145..a154528a21 100644
--- a/Testing/Code/Learning/CMakeLists.txt
+++ b/Testing/Code/Learning/CMakeLists.txt
@@ -1,7 +1,6 @@
 
 IF( NOT OTB_DISABLE_CXX_TESTING AND BUILD_TESTING )
 
-INCLUDE(TestingHelper)
 
 SET(LEARNING_TESTS1 ${CXX_TEST_PATH}/otbLearningTests1)
 SET(LEARNING_TESTS2 ${CXX_TEST_PATH}/otbLearningTests2)
diff --git a/Testing/Code/Markov/CMakeLists.txt b/Testing/Code/Markov/CMakeLists.txt
index aa193aeded..01f0047aa0 100644
--- a/Testing/Code/Markov/CMakeLists.txt
+++ b/Testing/Code/Markov/CMakeLists.txt
@@ -1,7 +1,6 @@
 
 IF( NOT OTB_DISABLE_CXX_TESTING AND BUILD_TESTING )
 
-INCLUDE(TestingHelper)
 
 SET(MARKOV_TESTS1 ${CXX_TEST_PATH}/otbMarkovTests1)
 SET(MARKOV_TESTS2 ${CXX_TEST_PATH}/otbMarkovTests2)
diff --git a/Testing/Code/MultiScale/CMakeLists.txt b/Testing/Code/MultiScale/CMakeLists.txt
index b7f88c3f52..c1e60b566f 100644
--- a/Testing/Code/MultiScale/CMakeLists.txt
+++ b/Testing/Code/MultiScale/CMakeLists.txt
@@ -1,7 +1,6 @@
 
 IF( NOT OTB_DISABLE_CXX_TESTING AND BUILD_TESTING )
 
-INCLUDE(TestingHelper)
 
 SET(MULTISCALE_TESTS1 ${CXX_TEST_PATH}/otbMultiScaleTests1)
 SET(MULTISCALE_TESTS2 ${CXX_TEST_PATH}/otbMultiScaleTests2)
diff --git a/Testing/Code/MultiTemporal/CMakeLists.txt b/Testing/Code/MultiTemporal/CMakeLists.txt
index 8aefd339ce..a207b8f4aa 100644
--- a/Testing/Code/MultiTemporal/CMakeLists.txt
+++ b/Testing/Code/MultiTemporal/CMakeLists.txt
@@ -1,7 +1,6 @@
 
 IF( NOT OTB_DISABLE_CXX_TESTING AND BUILD_TESTING )
 
-INCLUDE(TestingHelper)
 
 SET(MULTITEMPORAL_TESTS1 ${CXX_TEST_PATH}/otbMultiTemporalTests1)
 
diff --git a/Testing/Code/OBIA/CMakeLists.txt b/Testing/Code/OBIA/CMakeLists.txt
index fe95fb521f..b62edac236 100644
--- a/Testing/Code/OBIA/CMakeLists.txt
+++ b/Testing/Code/OBIA/CMakeLists.txt
@@ -1,6 +1,5 @@
 IF( NOT OTB_DISABLE_CXX_TESTING AND BUILD_TESTING )
 
-INCLUDE(TestingHelper)
 
 # Common generic tests
 SET(OBIA_TESTS1 ${CXX_TEST_PATH}/otbOBIATests1)
diff --git a/Testing/Code/ObjectDetection/CMakeLists.txt b/Testing/Code/ObjectDetection/CMakeLists.txt
index 00517bf0ff..6d2a967466 100644
--- a/Testing/Code/ObjectDetection/CMakeLists.txt
+++ b/Testing/Code/ObjectDetection/CMakeLists.txt
@@ -1,6 +1,5 @@
 IF( NOT OTB_DISABLE_CXX_TESTING AND BUILD_TESTING )
 
-INCLUDE(TestingHelper)
 
 # Common generic tests
 SET(OBJECTDETECTION_TESTS1 ${CXX_TEST_PATH}/otbObjectDetectionTests1)
diff --git a/Testing/Code/Projections/CMakeLists.txt b/Testing/Code/Projections/CMakeLists.txt
index dcdea846c5..dc0af32a6f 100644
--- a/Testing/Code/Projections/CMakeLists.txt
+++ b/Testing/Code/Projections/CMakeLists.txt
@@ -1,6 +1,5 @@
 IF( NOT OTB_DISABLE_CXX_TESTING AND BUILD_TESTING )
 
-INCLUDE(TestingHelper)
 
 SET(PROJECTIONS_TESTS1 ${CXX_TEST_PATH}/otbProjectionsTests1)
 SET(PROJECTIONS_TESTS2 ${CXX_TEST_PATH}/otbProjectionsTests2)
diff --git a/Testing/Code/Radiometry/CMakeLists.txt b/Testing/Code/Radiometry/CMakeLists.txt
index 7f817ad227..b234313ecb 100644
--- a/Testing/Code/Radiometry/CMakeLists.txt
+++ b/Testing/Code/Radiometry/CMakeLists.txt
@@ -1,7 +1,6 @@
 
 IF( NOT OTB_DISABLE_CXX_TESTING AND BUILD_TESTING )
 
-INCLUDE(TestingHelper)
 
 SET(RADIOMETRY_TESTS1 ${CXX_TEST_PATH}/otbRadiometryTests1)
 SET(RADIOMETRY_TESTS2 ${CXX_TEST_PATH}/otbRadiometryTests2)
diff --git a/Testing/Code/SARPolarimetry/CMakeLists.txt b/Testing/Code/SARPolarimetry/CMakeLists.txt
index a53b98cad9..610e4ee6c5 100644
--- a/Testing/Code/SARPolarimetry/CMakeLists.txt
+++ b/Testing/Code/SARPolarimetry/CMakeLists.txt
@@ -1,7 +1,6 @@
 
 IF( NOT OTB_DISABLE_CXX_TESTING AND BUILD_TESTING )
 
-INCLUDE(TestingHelper)
 
 SET(SARPOLARIMETRY_TESTS1 ${CXX_TEST_PATH}/otbSARPolarimetryTests1)
 SET(SARPOLARIMETRY_TESTS2 ${CXX_TEST_PATH}/otbSARPolarimetryTests2)
diff --git a/Testing/Code/Simulation/CMakeLists.txt b/Testing/Code/Simulation/CMakeLists.txt
index 3cc4bb9a3a..ff404abfcd 100644
--- a/Testing/Code/Simulation/CMakeLists.txt
+++ b/Testing/Code/Simulation/CMakeLists.txt
@@ -1,7 +1,6 @@
 
 IF( NOT OTB_DISABLE_CXX_TESTING AND BUILD_TESTING )
 
-INCLUDE(TestingHelper)
 
 SET(SPECTRUM_DB ${OTB_DATA_ROOT}/Input/BD-CNES)
 SET(SRCLASS0 ${SPECTRUM_DB}/JHU/becknic/manmade/txt)
diff --git a/Testing/Code/SpatialReasoning/CMakeLists.txt b/Testing/Code/SpatialReasoning/CMakeLists.txt
index ca0d193a74..95d505b01c 100644
--- a/Testing/Code/SpatialReasoning/CMakeLists.txt
+++ b/Testing/Code/SpatialReasoning/CMakeLists.txt
@@ -1,7 +1,6 @@
 
 IF( NOT OTB_DISABLE_CXX_TESTING AND BUILD_TESTING )
 
-INCLUDE(TestingHelper)
 
 SET(SPATIALREASONING_TESTS1 ${CXX_TEST_PATH}/otbSpatialReasoningTests1)
 SET(SPATIALREASONING_TESTS2 ${CXX_TEST_PATH}/otbSpatialReasoningTests2)
diff --git a/Testing/Code/TestSystem/CMakeLists.txt b/Testing/Code/TestSystem/CMakeLists.txt
index 4d28b3a5d1..398db65434 100644
--- a/Testing/Code/TestSystem/CMakeLists.txt
+++ b/Testing/Code/TestSystem/CMakeLists.txt
@@ -1,7 +1,6 @@
 
 IF( NOT OTB_DISABLE_CXX_TESTING AND BUILD_TESTING )
 
-INCLUDE(TestingHelper)
 
 SET(TESTSYSTEM_TESTS ${CXX_TEST_PATH}/otbTestSystemTests)
 
diff --git a/Testing/Code/UtilitiesAdapters/CMakeLists.txt b/Testing/Code/UtilitiesAdapters/CMakeLists.txt
index c7f5b52f08..f9a4d4c329 100644
--- a/Testing/Code/UtilitiesAdapters/CMakeLists.txt
+++ b/Testing/Code/UtilitiesAdapters/CMakeLists.txt
@@ -1,6 +1,5 @@
 IF( NOT OTB_DISABLE_CXX_TESTING AND BUILD_TESTING )
 
-INCLUDE(TestingHelper)
 
 SET(UtilitiesAdapters_TESTS1 ${CXX_TEST_PATH}/otbUtilitiesAdaptersTests1)
 
diff --git a/Testing/Code/Visu/CMakeLists.txt b/Testing/Code/Visu/CMakeLists.txt
index adbb132b31..2566518b04 100644
--- a/Testing/Code/Visu/CMakeLists.txt
+++ b/Testing/Code/Visu/CMakeLists.txt
@@ -1,6 +1,5 @@
 IF( NOT OTB_DISABLE_CXX_TESTING AND BUILD_TESTING )
 
-INCLUDE(TestingHelper)
 
 SET(VISU_TESTS1 ${CXX_TEST_PATH}/otbVisuTests1)
 SET(VISU_TESTS2 ${CXX_TEST_PATH}/otbVisuTests2)
diff --git a/Testing/Code/Visualization/CMakeLists.txt b/Testing/Code/Visualization/CMakeLists.txt
index 229b6d013c..aec29366d0 100644
--- a/Testing/Code/Visualization/CMakeLists.txt
+++ b/Testing/Code/Visualization/CMakeLists.txt
@@ -1,6 +1,5 @@
 IF( NOT OTB_DISABLE_CXX_TESTING AND BUILD_TESTING )
 
-INCLUDE(TestingHelper)
 
 # Test programs
 SET(VISUALIZATION_TESTS1 ${CXX_TEST_PATH}/otbVisualizationTests1)
diff --git a/Testing/Code/Wrappers/CommandLine/CMakeLists.txt b/Testing/Code/Wrappers/CommandLine/CMakeLists.txt
index 9cd662b084..a236711546 100644
--- a/Testing/Code/Wrappers/CommandLine/CMakeLists.txt
+++ b/Testing/Code/Wrappers/CommandLine/CMakeLists.txt
@@ -1,4 +1,3 @@
-INCLUDE(TestingHelper)
 
 SET(APPLICATIONSPATH ${OTB_BINARY_DIR}/bin)
 
diff --git a/Testing/Code/Wrappers/Java/CMakeLists.txt b/Testing/Code/Wrappers/Java/CMakeLists.txt
index d1ce94d6d7..fd291daa18 100644
--- a/Testing/Code/Wrappers/Java/CMakeLists.txt
+++ b/Testing/Code/Wrappers/Java/CMakeLists.txt
@@ -1,6 +1,5 @@
 include( UseJava )
 
-INCLUDE(TestingHelper)
 
 set(TEST_DRIVER otbTestDriver
     --add-before-env ITK_AUTOLOAD_PATH $<TARGET_FILE_DIR:otbapp_Smoothing>
diff --git a/Testing/Code/Wrappers/Python/CMakeLists.txt b/Testing/Code/Wrappers/Python/CMakeLists.txt
index a584ca4169..feb5cbadd9 100644
--- a/Testing/Code/Wrappers/Python/CMakeLists.txt
+++ b/Testing/Code/Wrappers/Python/CMakeLists.txt
@@ -1,4 +1,3 @@
-INCLUDE(TestingHelper)
 
 set(TEST_DRIVER otbTestDriver
     --add-before-env PYTHONPATH        "${CMAKE_BINARY_DIR}/Code/Wrappers/SWIG"
diff --git a/CMake/TestingHelper.cmake b/Testing/TestingHelper.cmake
similarity index 100%
rename from CMake/TestingHelper.cmake
rename to Testing/TestingHelper.cmake
-- 
GitLab