correct some troubles about thirdparty when they are used
[openjpeg.git] / tests / CMakeLists.txt
1 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
2
3 INCLUDE_DIRECTORIES(${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 ${OPENJPEG_SOURCE_DIR}/applications/codec/convert.c)
13
14 # If not getopt was found then add it to the exe:
15 IF(DONT_HAVE_GETOPT)
16   message("dont have getopt, we will add it")
17   SET(comparePGXimages_SRCS
18     ${comparePGXimages_SRCS}
19     ${OPENJPEG_SOURCE_DIR}/applications/common/getopt.c
20   )
21 ENDIF(DONT_HAVE_GETOPT)
22
23 ADD_EXECUTABLE(comparePGXimages ${comparePGXimages_SRCS})
24 TARGET_LINK_LIBRARIES(comparePGXimages ${OPENJPEG_LIBRARY_NAME}
25                                        ${Z_LIBNAME}
26                                        ${PNG_LIBNAME}
27                                        ${TIFF_LIBNAME}
28                                        )
29
30 # No image send to the dashboard if lib PNG is not available.
31 IF(NOT HAVE_LIBPNG)
32   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)") 
33 ENDIF(NOT HAVE_LIBPNG)
34
35 ADD_SUBDIRECTORY(conformance)