#=========================================================
#Support for the CTest dashboard testing system
-INCLUDE(CTest)
+OPTION(CLITK_BUILD_TESTING "Build the testing tree" OFF)
#=========================================================
-IF (BUILD_TESTING)
+IF (CLITK_BUILD_TESTING)
+ ENABLE_TESTING()
ADD_SUBDIRECTORY(tests)
-ENDIF(BUILD_TESTING)
+ENDIF(CLITK_BUILD_TESTING)
#=========================================================
# Tests are organized to mirror the clitk directory tree.
# Eacho subdirectory has its own CMakeLists.txt with the compiling directives
-IF (BUILD_TESTING)
+IF (CLITK_BUILD_TESTING)
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/tests/bin)
# default data path is searched in the project source tree
FIND_PATH(CLITK_DATA_PATH data PATHS ${PROJECT_SOURCE_DIR})
- IF (CLITK_DATA_PATH STREQUAL "CLITK_DATA_PATH-NOTFOUND")
- MESSAGE(FATAL_ERROR "Data path must be given when tests are enabled.")
- ENDIF (CLITK_DATA_PATH STREQUAL "CLITK_DATA_PATH-NOTFOUND")
+ IF (CLITK_DATA_PATH STREQUAL "CLITK_DATA_PATH-NOTFOUND" OR CLITK_DATA_PATH STREQUAL "")
+ MESSAGE("Data path must be given when tests are enabled.")
+ ENDIF (CLITK_DATA_PATH STREQUAL "CLITK_DATA_PATH-NOTFOUND" OR CLITK_DATA_PATH STREQUAL "")
set(CLITK_DATA_PATH ${CLITK_DATA_PATH}/data)
ADD_DEFINITIONS(-DCLITK_DATA_PATH='"${CLITK_DATA_PATH}"')
#ADD_SUBDIRECTORY(registration)
#ADD_SUBDIRECTORY(common)
-ENDIF(BUILD_TESTING)
+ENDIF(CLITK_BUILD_TESTING)
# Test apps are compiled as any other app in the
# project. Test executions are run using "make test"
#
-IF(BUILD_TESTING)
+IF(CLITK_BUILD_TESTING)
# clitkImageInfo
ADD_EXECUTABLE(clitkImageInfoTest clitkImageInfoTest.cxx)
TARGET_LINK_LIBRARIES(clitkWriteDicomSeriesTest ITKIO)
ADD_TEST(NAME clitkWriteDicomSeriesTest COMMAND clitkWriteDicomSeriesTest)
-ENDIF(BUILD_TESTING)
+ENDIF(CLITK_BUILD_TESTING)