missing ws2_32 linking
[openjpeg.git] / tests / CMakeLists.txt
1 # Tests
2 INCLUDE_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:
12 SET(comparePGXimages_SRCS comparePGXimages.c
13   ${OPENJPEG_SOURCE_DIR}/applications/codec/convert.c
14   ${OPENJPEG_SOURCE_DIR}/applications/common/opj_getopt.c
15   )
16
17 SET(compare_dump_files_SRCS compare_dump_files.c
18   ${OPENJPEG_SOURCE_DIR}/applications/common/opj_getopt.c)
19
20 SET(compareRAWimages_SRCS compareRAWimages.c
21   ${OPENJPEG_SOURCE_DIR}/applications/common/opj_getopt.c)
22
23 ADD_EXECUTABLE(comparePGXimages ${comparePGXimages_SRCS})
24 TARGET_LINK_LIBRARIES(comparePGXimages
25   ${OPENJPEG_LIBRARY_NAME}
26   ${PNG_LIBNAME} ${TIFF_LIBNAME}
27   )
28 # To support universal exe:
29 IF(ZLIB_FOUND AND APPLE)
30   TARGET_LINK_LIBRARIES(comparePGXimages z)
31 ELSe(ZLIB_FOUND AND APPLE)
32   TARGET_LINK_LIBRARIES(comparePGXimages ${Z_LIBNAME})
33 ENDIF(ZLIB_FOUND AND APPLE)
34
35 ADD_EXECUTABLE(compare_dump_files ${compare_dump_files_SRCS})
36
37 ADD_EXECUTABLE(compareRAWimages ${compareRAWimages_SRCS})
38
39 # No image send to the dashboard if lib PNG is not available.
40 IF(NOT HAVE_LIBPNG)
41   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)") 
42 ENDIF(NOT HAVE_LIBPNG)
43
44 ADD_SUBDIRECTORY(conformance)
45 ADD_SUBDIRECTORY(nonregression)
46
47 IF(BUILD_JPIP)
48   IF(JPIP_SERVER)
49     #SET(s "http://jpip.example.com/myFCGI?target=16.jp2&fsiz=170,170&cnew=http&type=jpp-stream")
50     SET(s "${JPIP_SERVER}?target=16.jp2&fsiz=170,170&cnew=http&type=jpp-stream")
51     SET(p "${CMAKE_CURRENT_BINARY_DIR}/jpip.dat")
52     SET(md5 "62b00c620fb0a600c5ffd413cada4674")
53     ADD_TEST(TestJPIP1 ${CMAKE_COMMAND} -DD_URL:STRING=${s} -DD_FILE:PATH=${p}
54       -DEXPECTED_MD5=${md5} -P ${PROJECT_SOURCE_DIR}/CMake/JPIPTestDriver.cmake)
55   ENDIF(JPIP_SERVER)
56 ENDIF(BUILD_JPIP)