1 # Build the demo app, small examples
3 # First thing define the common source:
7 ${OPENJPEG_SOURCE_DIR}/src/bin/common/color.c
8 ${OPENJPEG_SOURCE_DIR}/src/bin/common/opj_getopt.c
11 # Headers file are located here:
13 ${OPENJPEG_SOURCE_DIR}/src/lib/openjp2
14 ${OPENJPEG_SOURCE_DIR}/src/bin/common
15 ${LCMS_INCLUDE_DIRNAME}
17 ${PNG_INCLUDE_DIRNAME}
18 ${TIFF_INCLUDE_DIRNAME}
23 add_definitions(-DOPJ_EXPORTS)
25 add_definitions(-DOPJ_STATIC)
29 # Loop over all executables:
30 foreach(exe opj_decompress opj_compress opj_dump)
31 add_executable(${exe} ${exe}.c ${common_SRCS})
32 target_link_libraries(${exe} ${OPENJPEG_LIBRARY_NAME}
33 ${PNG_LIBNAME} ${TIFF_LIBNAME} ${LCMS_LIBNAME}
35 # To support universal exe:
36 if(ZLIB_FOUND AND APPLE)
37 target_link_libraries(${exe} z)
38 ELSe(ZLIB_FOUND AND APPLE)
39 target_link_libraries(${exe} ${Z_LIBNAME})
42 # On unix you need to link to the math library:
44 target_link_libraries(${exe} m)
47 install(TARGETS ${exe}
48 EXPORT OpenJPEGTargets
49 DESTINATION ${OPENJPEG_INSTALL_BIN_DIR} COMPONENT Applications
55 FILES ${OPENJPEG_SOURCE_DIR}/doc/man/man1/opj_compress.1
56 ${OPENJPEG_SOURCE_DIR}/doc/man/man1/opj_decompress.1
57 ${OPENJPEG_SOURCE_DIR}/doc/man/man1/opj_dump.1
58 DESTINATION ${OPENJPEG_INSTALL_MAN_DIR}/man1)