2012-03-02 16:09:51 +01:00
# Tests
2012-08-30 19:14:39 +02:00
include_directories (
2012-10-01 12:20:31 +02:00
$ { O P E N J P E G _ B I N A R Y _ D I R } / s r c / l i b / o p e n j p 2 # opj_config.h
2013-03-03 18:55:35 +01:00
$ { O P E N J P E G _ B I N A R Y _ D I R } / s r c / b i n / c o m m o n # opj_apps_config.h
2012-09-28 10:11:41 +02:00
$ { O P E N J P E G _ S O U R C E _ D I R } / s r c / l i b / o p e n j p 2
$ { O P E N J P E G _ S O U R C E _ D I R } / s r c / b i n / j p 2
$ { O P E N J P E G _ S O U R C E _ D I R } / s r c / b i n / c o m m o n
2012-03-02 16:09:51 +01:00
$ { 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:
2014-03-07 17:24:24 +01:00
set ( compare_images_SRCS compare_images.c
2012-09-28 10:11:41 +02:00
$ { O P E N J P E G _ S O U R C E _ D I R } / s r c / b i n / j p 2 / c o n v e r t . c
2015-07-14 23:51:02 +02:00
$ { O P E N J P E G _ S O U R C E _ D I R } / s r c / b i n / j p 2 / c o n v e r t t i f . c
2012-09-28 10:11:41 +02:00
$ { O P E N J P E G _ S O U R C E _ D I R } / s r c / b i n / c o m m o n / o p j _ g e t o p t . c
2012-03-02 16:09:51 +01:00
)
2011-09-01 13:24:08 +02:00
2012-08-30 19:14:39 +02:00
set ( compare_dump_files_SRCS compare_dump_files.c
2012-09-28 10:11:41 +02:00
$ { O P E N J P E G _ S O U R C E _ D I R } / s r c / b i n / c o m m o n / o p j _ g e t o p t . c )
2011-09-01 13:24:08 +02:00
2014-03-07 17:24:24 +01:00
set ( compare_raw_files_SRCS compare_raw_files.c
2012-09-28 10:11:41 +02:00
$ { O P E N J P E G _ S O U R C E _ D I R } / s r c / b i n / c o m m o n / o p j _ g e t o p t . c )
2011-07-21 17:23:31 +02:00
2014-03-07 17:24:24 +01:00
add_executable ( compare_images ${ compare_images_SRCS } )
target_link_libraries ( compare_images
2012-03-02 16:09:51 +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:
2012-08-30 19:14:39 +02:00
if ( ZLIB_FOUND AND APPLE )
2014-03-07 17:24:24 +01:00
target_link_libraries ( compare_images z )
2012-10-01 14:29:09 +02:00
else ( ZLIB_FOUND AND APPLE )
2014-03-07 17:24:24 +01:00
target_link_libraries ( compare_images ${ Z_LIBNAME } )
2012-08-30 19:20:03 +02:00
endif ( )
2012-03-02 16:09:51 +01:00
2012-08-30 19:14:39 +02:00
add_executable ( compare_dump_files ${ compare_dump_files_SRCS } )
2011-07-21 17:23:31 +02:00
2012-08-30 19:14:39 +02:00
add_executable ( j2k_random_tile_access j2k_random_tile_access.c )
target_link_libraries ( j2k_random_tile_access ${ OPENJPEG_LIBRARY_NAME } )
2011-11-30 17:55:25 +01:00
2014-03-07 17:24:24 +01:00
add_executable ( compare_raw_files ${ compare_raw_files_SRCS } )
2011-08-31 15:33:40 +02:00
2012-08-30 19:14:39 +02:00
add_executable ( test_tile_encoder test_tile_encoder.c )
target_link_libraries ( test_tile_encoder ${ OPENJPEG_LIBRARY_NAME } )
2012-03-23 18:47:53 +01:00
2017-08-14 13:23:57 +02:00
add_executable ( test_decode_area test_decode_area.c )
target_link_libraries ( test_decode_area ${ OPENJPEG_LIBRARY_NAME } )
2012-05-14 18:05:55 +02:00
# Let's try a couple of possibilities:
2014-02-24 13:48:23 +01:00
add_test ( NAME tte0 COMMAND test_tile_encoder )
add_test ( NAME tte1 COMMAND test_tile_encoder 3 2048 2048 1024 1024 8 1 tte1.j2k )
add_test ( NAME tte2 COMMAND test_tile_encoder 3 2048 2048 1024 1024 8 1 tte2.jp2 )
add_test ( NAME tte3 COMMAND test_tile_encoder 1 2048 2048 1024 1024 8 1 tte3.j2k )
add_test ( NAME tte4 COMMAND test_tile_encoder 1 256 256 128 128 8 0 tte4.j2k )
add_test ( NAME tte5 COMMAND test_tile_encoder 1 512 512 256 256 8 0 tte5.j2k )
#add_test(NAME tte6 COMMAND test_tile_encoder 1 8192 8192 512 512 8 0 tte6.j2k)
#add_test(NAME tte7 COMMAND test_tile_encoder 1 32768 32768 512 512 8 0 tte7.jp2)
2012-05-14 18:05:55 +02:00
2012-08-30 19:14:39 +02:00
add_executable ( test_tile_decoder test_tile_decoder.c )
target_link_libraries ( test_tile_decoder ${ OPENJPEG_LIBRARY_NAME } )
2012-05-14 09:03:33 +02:00
2014-02-24 13:48:23 +01:00
add_test ( NAME ttd0 COMMAND test_tile_decoder )
2012-05-21 10:03:58 +02:00
set_property ( TEST ttd0 APPEND PROPERTY DEPENDS tte0 )
2014-02-24 13:48:23 +01:00
add_test ( NAME ttd1 COMMAND test_tile_decoder 0 0 1024 1024 tte1.j2k )
2012-05-21 10:03:58 +02:00
set_property ( TEST ttd1 APPEND PROPERTY DEPENDS tte1 )
2014-02-24 13:48:23 +01:00
add_test ( NAME ttd2 COMMAND test_tile_decoder 0 0 1024 1024 tte2.jp2 )
2012-05-21 10:03:58 +02:00
set_property ( TEST ttd2 APPEND PROPERTY DEPENDS tte2 )
2014-02-24 13:48:23 +01:00
#add_test(NAME ttd6 COMMAND test_tile_decoder 0 0 512 512 tte6.j2k)
2012-10-15 17:47:56 +02:00
#set_property(TEST ttd6 APPEND PROPERTY DEPENDS tte6)
2014-02-24 13:48:23 +01:00
#add_test(NAME ttd7 COMMAND test_tile_decoder 0 0 512 512 tte7.jp2)
2012-10-15 17:47:56 +02:00
#set_property(TEST ttd7 APPEND PROPERTY DEPENDS tte7)
2012-05-21 10:03:58 +02:00
2014-02-24 13:48:23 +01:00
add_test ( NAME rta1 COMMAND j2k_random_tile_access tte1.j2k )
2012-11-08 17:30:46 +01:00
set_property ( TEST rta1 APPEND PROPERTY DEPENDS tte1 )
2014-02-24 13:48:23 +01:00
add_test ( NAME rta2 COMMAND j2k_random_tile_access tte2.jp2 )
2012-11-08 17:47:35 +01:00
set_property ( TEST rta2 APPEND PROPERTY DEPENDS tte2 )
2014-02-24 13:48:23 +01:00
add_test ( NAME rta3 COMMAND j2k_random_tile_access tte3.j2k )
2012-11-08 17:47:35 +01:00
set_property ( TEST rta3 APPEND PROPERTY DEPENDS tte3 )
2014-02-24 13:48:23 +01:00
add_test ( NAME rta4 COMMAND j2k_random_tile_access tte4.j2k )
2012-11-08 17:47:35 +01:00
set_property ( TEST rta4 APPEND PROPERTY DEPENDS tte4 )
2014-02-24 13:48:23 +01:00
add_test ( NAME rta5 COMMAND j2k_random_tile_access tte5.j2k )
2012-11-08 17:47:35 +01:00
set_property ( TEST rta5 APPEND PROPERTY DEPENDS tte5 )
2012-11-08 17:30:46 +01:00
2017-08-14 13:23:57 +02:00
add_test ( NAME tda_prep_reversible_no_precinct COMMAND test_tile_encoder 1 256 256 32 32 8 0 reversible_no_precinct.j2k 4 4 3 0 0 1 )
add_test ( NAME tda_reversible_no_precinct COMMAND test_decode_area -q reversible_no_precinct.j2k )
set_property ( TEST tda_reversible_no_precinct APPEND PROPERTY DEPENDS tda_prep_reversible_no_precinct )
add_test ( NAME tda_prep_reversible_with_precinct COMMAND test_tile_encoder 1 256 256 32 32 8 0 reversible_with_precinct.j2k 4 4 3 0 0 1 16 16 )
add_test ( NAME tda_reversible_with_precinct COMMAND test_decode_area -q reversible_with_precinct.j2k )
set_property ( TEST tda_reversible_with_precinct APPEND PROPERTY DEPENDS tda_prep_reversible_with_precinct )
add_test ( NAME tda_prep_irreversible_no_precinct COMMAND test_tile_encoder 1 256 256 32 32 8 1 irreversible_no_precinct.j2k 4 4 3 0 0 1 )
add_test ( NAME tda_irreversible_no_precinct COMMAND test_decode_area -q irreversible_no_precinct.j2k )
set_property ( TEST tda_irreversible_no_precinct APPEND PROPERTY DEPENDS tda_prep_irreversible_no_precinct )
2016-07-14 11:06:26 +02:00
add_executable ( include_openjpeg include_openjpeg.c )
2011-07-21 17:23:31 +02:00
# No image send to the dashboard if lib PNG is not available.
2013-03-17 18:08:12 +01:00
if ( NOT OPJ_HAVE_LIBPNG )
2012-08-30 19:20:03 +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 ( )
2011-07-21 17:23:31 +02:00
2012-08-30 19:14:39 +02:00
add_subdirectory ( conformance )
add_subdirectory ( nonregression )
2012-10-01 14:26:27 +02:00
add_subdirectory ( unit )
2012-03-02 16:09:51 +01:00
2012-08-30 19:14:39 +02:00
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" )
2014-02-28 15:54:37 +01:00
set ( md5 "d41d8cd98f00b204e9800998ecf8427e" )
2014-02-24 13:48:23 +01:00
add_test ( NAME TestJPIP1 COMMAND ${ CMAKE_COMMAND } -DD_URL:STRING= ${ s } -DD_FILE:PATH= ${ p }
2014-02-26 10:51:37 +01:00
- 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 )
2012-08-30 19:20:03 +02:00
endif ( )
endif ( )
2014-03-13 10:57:20 +01:00
add_executable ( ppm2rgb3 ppm2rgb3.c )
2014-03-26 12:52:01 +01:00
#add_executable(pdf2jp2 pdf2jp2.c)