diff options
Diffstat (limited to 'CMakeLists.txt')
| -rw-r--r-- | CMakeLists.txt | 29 |
1 files changed, 21 insertions, 8 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 032b8ab4..4fcbca9c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -204,14 +204,6 @@ IF(NOT HAVE_UNISTD_H_FOUND STREQUAL "HAVE_UNISTD_H_FOUND-NOTFOUND") ENDIF() #----------------------------------------------------------------------------- -# CDash+CMake : to be updated -OPTION(BUILD_TESTING "Build the tests." OFF) -IF(BUILD_TESTING) - ENABLE_TESTING() - INCLUDE(CTest) -ENDIF(BUILD_TESTING) - -#----------------------------------------------------------------------------- # Build Library INCLUDE_DIRECTORIES(BEFORE ${OPENJPEG_BINARY_DIR}) ADD_SUBDIRECTORY(libopenjpeg) @@ -243,6 +235,27 @@ OPTION(BUILD_JPWL "Build the JPWL library and executables" OFF) ADD_SUBDIRECTORY(doc) #----------------------------------------------------------------------------- +# Buld Testing +OPTION(BUILD_TESTING "Build the tests." OFF) +IF(BUILD_TESTING) + IF(BUILD_CODEC) + ENABLE_TESTING() + INCLUDE(CTest) + + # Add repository where to find tests + ADD_SUBDIRECTORY(tests) + + # Search openjpeg data needed for the tests + # They could be found via svn on the OpenJPEG google code project + # svn checkout http://openjpeg.googlecode.com/svn/data (about 70 Mo) + FIND_PATH(OPJ_DATA_ROOT README-OPJ-Data + PATHS $ENV{OPJ_DATA_ROOT} ${CMAKE_SOURCE_DIR}/../opj-data) + ELSE(BUILD_CODEC) + message(FATAL_ERROR "You need build codec to run the tests") + ENDIF(BUILD_CODEC) +ENDIF(BUILD_TESTING) + +#----------------------------------------------------------------------------- # Tests data IF(BUILD_TESTING) # Adding test with dataset from: |
