1 # Build the demo app, small examples
3 # First thing define the common source:
8 ${OPENJPEG_SOURCE_DIR}/src/bin/common/color.c
9 ${OPENJPEG_SOURCE_DIR}/src/bin/common/opj_getopt.c
12 # Headers file are located here:
14 ${OPENJPEG_BINARY_DIR}/src/lib/openjp2 # opj_config.h
15 ${OPENJPEG_BINARY_DIR}/src/bin/common # opj_apps_config.h
16 ${OPENJPEG_SOURCE_DIR}/src/lib/openjp2
17 ${OPENJPEG_SOURCE_DIR}/src/bin/common
18 ${LCMS_INCLUDE_DIRNAME}
20 ${PNG_INCLUDE_DIRNAME}
21 ${TIFF_INCLUDE_DIRNAME}
26 add_definitions(-DOPJ_EXPORTS)
28 add_definitions(-DOPJ_STATIC)
32 # Loop over all executables:
33 foreach(exe opj_decompress opj_compress opj_dump)
34 add_executable(${exe} ${exe}.c ${common_SRCS})
35 target_link_libraries(${exe} ${OPENJPEG_LIBRARY_NAME}
36 ${PNG_LIBNAME} ${TIFF_LIBNAME} ${LCMS_LIBNAME}
38 # To support universal exe:
39 if(ZLIB_FOUND AND APPLE)
40 target_link_libraries(${exe} z)
41 else(ZLIB_FOUND AND APPLE)
42 target_link_libraries(${exe} ${Z_LIBNAME})
45 # On unix you need to link to the math library:
47 target_link_libraries(${exe} m)
50 install(TARGETS ${exe}
51 EXPORT OpenJPEGTargets
52 DESTINATION ${OPENJPEG_INSTALL_BIN_DIR} COMPONENT Applications
55 add_custom_command(TARGET ${exe} POST_BUILD
56 COMMAND "dsymutil" "$<TARGET_FILE:${exe}>"
57 COMMENT "dsymutil $<TARGET_FILE:${exe}>"
65 FILES ${OPENJPEG_SOURCE_DIR}/doc/man/man1/opj_compress.1
66 ${OPENJPEG_SOURCE_DIR}/doc/man/man1/opj_decompress.1
67 ${OPENJPEG_SOURCE_DIR}/doc/man/man1/opj_dump.1
68 DESTINATION ${OPENJPEG_INSTALL_MAN_DIR}/man1)