2011-12-21 11:19:36 +01:00
# Tests
2015-09-15 15:11:12 +02:00
include_directories (
2011-12-21 11:19:36 +01:00
$ { O P E N J P E G _ S O U R C E _ D I R } / l i b o p e n j p e g
$ { O P E N J P E G _ S O U R C E _ D I R } / a p p l i c a t i o n s / c o d e c
$ { O P E N J P E G _ S O U R C E _ D I R } / a p p l i c a t i o n s / c o m m o n
$ { Z _ I N C L U D E _ D I R N A M E }
$ { P N G _ I N C L U D E _ D I R N A M E }
$ { T I F F _ I N C L U D E _ D I R N A M E }
)
2011-07-21 17:23:31 +02:00
# First thing define the common source:
2015-09-15 15:11:12 +02:00
set ( compare_images_SRCS compare_images.c
2011-12-21 11:19:36 +01:00
$ { O P E N J P E G _ S O U R C E _ D I R } / a p p l i c a t i o n s / c o d e c / c o n v e r t . c
2015-09-15 15:11:12 +02:00
# ${OPENJPEG_SOURCE_DIR}/applications/codec/converttif.c
2015-09-15 18:00:52 +02:00
# ${OPENJPEG_SOURCE_DIR}/applications/common/opj_getopt.c
2011-12-21 11:19:36 +01:00
)
2011-09-01 14:08:10 +02:00
2015-09-15 18:00:52 +02:00
if ( NOT USE_SYSTEM_GETOPT )
list ( APPEND compare_images_SRCS
$ { O P E N J P E G _ S O U R C E _ D I R } / a p p l i c a t i o n s / c o m m o n / o p j _ g e t o p t . c
)
endif ( )
2015-09-15 15:11:12 +02:00
set ( compare_dump_files_SRCS compare_dump_files.c
2015-09-15 18:00:52 +02:00
#${OPENJPEG_SOURCE_DIR}/applications/common/opj_getopt.c
)
if ( NOT USE_SYSTEM_GETOPT )
list ( APPEND compare_dump_files_SRCS
$ { O P E N J P E G _ S O U R C E _ D I R } / a p p l i c a t i o n s / c o m m o n / o p j _ g e t o p t . c
)
endif ( )
2015-09-15 15:11:12 +02:00
set ( compare_raw_files_SRCS compare_raw_files.c
2015-09-15 18:00:52 +02:00
#${OPENJPEG_SOURCE_DIR}/applications/common/opj_getopt.c
)
if ( NOT USE_SYSTEM_GETOPT )
list ( APPEND compare_raw_files_SRCS
$ { O P E N J P E G _ S O U R C E _ D I R } / a p p l i c a t i o n s / c o m m o n / o p j _ g e t o p t . c
)
endif ( )
2011-07-21 17:23:31 +02:00
2015-09-15 15:11:12 +02:00
add_executable ( compare_images ${ compare_images_SRCS } )
target_link_libraries ( compare_images
2011-12-21 16:21:53 +01:00
$ { O P E N J P E G _ L I B R A R Y _ N A M E }
$ { P N G _ L I B N A M E } $ { T I F F _ L I B N A M E }
)
# To support universal exe:
2015-09-15 15:11:12 +02:00
if ( ZLIB_FOUND AND APPLE )
target_link_libraries ( compare_images z )
else ( ZLIB_FOUND AND APPLE )
target_link_libraries ( compare_images ${ Z_LIBNAME } )
endif ( )
2011-07-21 17:23:31 +02:00
2015-09-15 15:11:12 +02:00
add_executable ( compare_dump_files ${ compare_dump_files_SRCS } )
2011-09-01 14:08:10 +02:00
2015-09-16 15:48:24 +02:00
add_executable ( compare_raw_files ${ compare_raw_files_SRCS } )
2011-07-21 17:23:31 +02:00
# No image send to the dashboard if lib PNG is not available.
2015-09-15 18:21:07 +02:00
if ( NOT HAVE_LIBPNG )
2015-09-15 15:11:12 +02:00
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 )
2015-09-16 15:48:24 +02:00
add_subdirectory ( nonregression )
2015-09-15 15:11:12 +02:00
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 }
- D E X P E C T E D _ M D 5 = $ { m d 5 } - P $ { P R O J E C T _ S O U R C E _ D I R } / c m a k e / J P I P T e s t D r i v e r . c m a k e )
endif ( )
endif ( )
add_executable ( ppm2rgb3 ppm2rgb3.c )
#add_executable(pdf2jp2 pdf2jp2.c)