ENDIF(BUILD_TESTING)
ENDIF(OPENJPEG_STANDALONE)
-# TODO, technically we should add tests, e.g:
+# Adding test with dataset from:
# http://www.crc.ricoh.com/~gormish/jpeg2000conformance/
+# http://www.jpeg.org/jpeg2000guide/testimages/testimages.html
+
+FILE(GLOB_RECURSE OPENJPEG_DATA_IMAGES_GLOB
+# "${OPENJPEG_SOURCE_DIR}/testing1/*.j2k"
+# "${OPENJPEG_SOURCE_DIR}/testing1/*.jp2"
+ "${OPENJPEG_SOURCE_DIR}/testimages/*.j2k"
+ "${OPENJPEG_SOURCE_DIR}/testimages/*.j2c"
+ "${OPENJPEG_SOURCE_DIR}/testimages/*.jp2"
+ )
+
+FOREACH(filename ${OPENJPEG_DATA_IMAGES_GLOB})
+ GET_FILENAME_COMPONENT(filename_temp ${filename} NAME)
+ ADD_TEST(j2i-${filename_temp} ${EXECUTABLE_OUTPUT_PATH}/j2k_to_image -i ${filename} -o ${filename_temp}.tif)
+ENDFOREACH(filename)
September 7, 2007
* [Mathieu Malaterre] Upon failure, properly return error code (!=0).
+* [Mathieu Malaterre] CMake: Add cmake code to do testing if user has properly setup a testimages directory
September 6, 2007
+ [Mathieu Malaterre] CMake: start compiling mj2, jpwl and jp3d
ADD_EXECUTABLE(${exe} ${exe}.c ${common_SRCS})
TARGET_LINK_LIBRARIES(${exe} ${OPJ_PREFIX}openjpeg ${TIFF_LIBRARIES})
ADD_TEST(${exe} ${EXECUTABLE_OUTPUT_PATH}/${exe})
+ # calling those exe without option will make them fail always:
+ SET_TESTS_PROPERTIES(${exe} PROPERTIES WILL_FAIL TRUE)
# On unix you need to link to the math library:
IF(UNIX)
TARGET_LINK_LIBRARIES(${exe} m)