1 # Build the demo app, small examples
3 # First thing define the common source:
10 ${OPENJPEG_SOURCE_DIR}/src/bin/common/color.c
11 ${OPENJPEG_SOURCE_DIR}/src/bin/common/color.h
12 ${OPENJPEG_SOURCE_DIR}/src/bin/common/opj_getopt.c
13 ${OPENJPEG_SOURCE_DIR}/src/bin/common/opj_getopt.h
14 ${OPENJPEG_SOURCE_DIR}/src/bin/common/opj_string.h
18 list(APPEND common_SRCS converttif.c)
21 list(APPEND common_SRCS convertpng.c)
24 # Headers file are located here:
26 ${OPENJPEG_BINARY_DIR}/src/lib/openjp2 # opj_config.h
27 ${OPENJPEG_BINARY_DIR}/src/bin/common # opj_apps_config.h
28 ${OPENJPEG_SOURCE_DIR}/src/lib/openjp2
29 ${OPENJPEG_SOURCE_DIR}/src/bin/common
30 ${LCMS_INCLUDE_DIRNAME}
32 ${PNG_INCLUDE_DIRNAME}
33 ${TIFF_INCLUDE_DIRNAME}
38 add_definitions(-DOPJ_EXPORTS)
40 add_definitions(-DOPJ_STATIC)
44 # Loop over all executables:
45 foreach(exe opj_decompress opj_compress opj_dump)
46 add_executable(${exe} ${exe}.c ${common_SRCS})
47 target_link_libraries(${exe} ${OPENJPEG_LIBRARY_NAME}
48 ${PNG_LIBNAME} ${TIFF_LIBNAME} ${LCMS_LIBNAME}
50 # To support universal exe:
51 if(ZLIB_FOUND AND APPLE)
52 target_link_libraries(${exe} z)
53 else(ZLIB_FOUND AND APPLE)
54 target_link_libraries(${exe} ${Z_LIBNAME})
57 # On unix you need to link to the math library:
59 target_link_libraries(${exe} m)
62 install(TARGETS ${exe}
63 EXPORT OpenJPEGTargets
64 DESTINATION ${OPENJPEG_INSTALL_BIN_DIR} COMPONENT Applications
67 add_custom_command(TARGET ${exe} POST_BUILD
68 COMMAND "dsymutil" "$<TARGET_FILE:${exe}>"
69 COMMENT "dsymutil $<TARGET_FILE:${exe}>"
77 FILES ${OPENJPEG_SOURCE_DIR}/doc/man/man1/opj_compress.1
78 ${OPENJPEG_SOURCE_DIR}/doc/man/man1/opj_decompress.1
79 ${OPENJPEG_SOURCE_DIR}/doc/man/man1/opj_dump.1
80 DESTINATION ${OPENJPEG_INSTALL_MAN_DIR}/man1)