summaryrefslogtreecommitdiff
path: root/tests/CMakeLists.txt
blob: 2a13affaeeb12ecf3e1cd87dc00400d3b4cb80c2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# Tests
include_directories(
  ${OPENJPEG_SOURCE_DIR}/libopenjpeg
  ${OPENJPEG_SOURCE_DIR}/applications/codec
  ${OPENJPEG_SOURCE_DIR}/applications/common
  ${Z_INCLUDE_DIRNAME}
  ${PNG_INCLUDE_DIRNAME}
  ${TIFF_INCLUDE_DIRNAME}
  )

# First thing define the common source:
set(compare_images_SRCS compare_images.c
  ${OPENJPEG_SOURCE_DIR}/applications/codec/convert.c
  ${OPENJPEG_SOURCE_DIR}/applications/codec/converttif.c
#  ${OPENJPEG_SOURCE_DIR}/applications/common/opj_getopt.c
  )

if(NOT USE_SYSTEM_GETOPT)
  list(APPEND compare_images_SRCS
    ${OPENJPEG_SOURCE_DIR}/applications/common/opj_getopt.c
  )
endif()

set(compare_dump_files_SRCS compare_dump_files.c
  #${OPENJPEG_SOURCE_DIR}/applications/common/opj_getopt.c
  )

if(NOT USE_SYSTEM_GETOPT)
  list(APPEND compare_dump_files_SRCS
    ${OPENJPEG_SOURCE_DIR}/applications/common/opj_getopt.c
  )
endif()

set(compare_raw_files_SRCS compare_raw_files.c
  #${OPENJPEG_SOURCE_DIR}/applications/common/opj_getopt.c
  )

if(NOT USE_SYSTEM_GETOPT)
  list(APPEND compare_raw_files_SRCS
    ${OPENJPEG_SOURCE_DIR}/applications/common/opj_getopt.c
  )
endif()

add_executable(compare_images ${compare_images_SRCS})
target_link_libraries(compare_images
  ${OPENJPEG_LIBRARY_NAME}
  ${PNG_LIBNAME} ${TIFF_LIBNAME}
  )
# To support universal exe:
if(ZLIB_FOUND AND APPLE)
  target_link_libraries(compare_images z)
else(ZLIB_FOUND AND APPLE)
  target_link_libraries(compare_images ${Z_LIBNAME})
endif()

add_executable(compare_dump_files ${compare_dump_files_SRCS})

add_executable(compare_raw_files ${compare_raw_files_SRCS})

# No image send to the dashboard if lib PNG is not available.
if(NOT HAVE_LIBPNG)
  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)")
endif()

add_subdirectory(conformance)
add_subdirectory(nonregression)
add_subdirectory(unit)

if(BUILD_JPIP)
  if(JPIP_SERVER)
    #set(s "http://jpip.example.com/myFCGI?target=16.jp2&fsiz=170,170&cnew=http&type=jpp-stream")
    set(s "${JPIP_SERVER}?target=16.jp2&fsiz=170,170&cnew=http&type=jpp-stream")
    set(p "${CMAKE_CURRENT_BINARY_DIR}/jpip.dat")
    set(md5 "d41d8cd98f00b204e9800998ecf8427e")
    add_test(NAME TestJPIP1 COMMAND ${CMAKE_COMMAND} -DD_URL:STRING=${s} -DD_FILE:PATH=${p}
      -DEXPECTED_MD5=${md5} -P ${PROJECT_SOURCE_DIR}/cmake/JPIPTestDriver.cmake)
  endif()
endif()

add_executable(ppm2rgb3 ppm2rgb3.c)
#add_executable(pdf2jp2 pdf2jp2.c)