1# Tests
2INCLUDE_DIRECTORIES(
3  ${OPENJPEG_SOURCE_DIR}/libopenjpeg
4  ${OPENJPEG_SOURCE_DIR}/applications/codec
5  ${OPENJPEG_SOURCE_DIR}/applications/common
6  ${Z_INCLUDE_DIRNAME}
7  ${PNG_INCLUDE_DIRNAME}
8  ${TIFF_INCLUDE_DIRNAME}
9  )
10
11# First thing define the common source:
12SET(comparePGXimages_SRCS comparePGXimages.c
13  ${OPENJPEG_SOURCE_DIR}/applications/codec/convert.c
14  )
15SET(compare_dump_files_SRCS compare_dump_files.c)
16SET(compareRAWimages_SRCS compareRAWimages.c)
17
18if(NOT USE_SYSTEM_GETOPT)
19  list(APPEND comparePGXimages_SRCS ${OPENJPEG_SOURCE_DIR}/applications/common/opj_getopt.c)
20  list(APPEND compare_dump_files_SRCS ${OPENJPEG_SOURCE_DIR}/applications/common/opj_getopt.c)
21  list(APPEND compareRAWimages_SRCS ${OPENJPEG_SOURCE_DIR}/applications/common/opj_getopt.c)
22endif()
23
24ADD_EXECUTABLE(comparePGXimages ${comparePGXimages_SRCS})
25TARGET_LINK_LIBRARIES(comparePGXimages
26  ${OPENJPEG_LIBRARY_NAME}
27  ${PNG_LIBNAME} ${TIFF_LIBNAME}
28  )
29# To support universal exe:
30IF(ZLIB_FOUND AND APPLE)
31  TARGET_LINK_LIBRARIES(comparePGXimages z)
32ELSe(ZLIB_FOUND AND APPLE)
33  TARGET_LINK_LIBRARIES(comparePGXimages ${Z_LIBNAME})
34ENDIF(ZLIB_FOUND AND APPLE)
35
36ADD_EXECUTABLE(compare_dump_files ${compare_dump_files_SRCS})
37
38ADD_EXECUTABLE(compareRAWimages ${compareRAWimages_SRCS})
39
40# No image send to the dashboard if lib PNG is not available.
41IF(NOT HAVE_LIBPNG)
42  MESSAGE(WARNING "Lib PNG seems to be not available: if you want run the non-regression tests with images reported to the dashboard, you need it (try BUILD_THIRDPARTY)")
43ENDIF(NOT HAVE_LIBPNG)
44
45ADD_SUBDIRECTORY(conformance)
46ADD_SUBDIRECTORY(nonregression)
47ADD_SUBDIRECTORY(unit)
48
49IF(BUILD_JPIP)
50  IF(JPIP_SERVER)
51    #SET(s "http://jpip.example.com/myFCGI?target=16.jp2&fsiz=170,170&cnew=http&type=jpp-stream")
52    SET(s "${JPIP_SERVER}?target=16.jp2&fsiz=170,170&cnew=http&type=jpp-stream")
53    SET(p "${CMAKE_CURRENT_BINARY_DIR}/jpip.dat")
54    SET(md5 "62b00c620fb0a600c5ffd413cada4674")
55    ADD_TEST(NAME TestJPIP1 COMMAND ${CMAKE_COMMAND} -DD_URL:STRING=${s} -DD_FILE:PATH=${p}
56      -DEXPECTED_MD5=${md5} -P ${PROJECT_SOURCE_DIR}/CMake/JPIPTestDriver.cmake)
57  ENDIF(JPIP_SERVER)
58ENDIF(BUILD_JPIP)
59