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 ${LCMS_INCLUDE_DIRNAME}
15 ${OPENJPEG_SOURCE_DIR}/src/bin/common
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 j2k_to_image image_to_j2k j2k_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/image_to_j2k.1
56 ${OPENJPEG_SOURCE_DIR}/doc/man/man1/j2k_dump.1
57 ${OPENJPEG_SOURCE_DIR}/doc/man/man1/j2k_to_image.1
58 DESTINATION ${OPENJPEG_INSTALL_MAN_DIR}/man1)
62 add_executable(JPWL_j2k_to_image
68 TARGET JPWL_j2k_to_image
69 APPEND PROPERTY COMPILE_DEFINITIONS USE_JPWL
72 target_link_libraries(JPWL_j2k_to_image ${OPENJPEG_LIBRARY_NAME}_JPWL
73 ${LCMS_LIBNAME} ${PNG_LIBNAME} ${TIFF_LIBNAME})
75 # To support universal exe:
76 if(ZLIB_FOUND AND APPLE)
77 target_link_libraries(JPWL_j2k_to_image z)
78 ELSe(ZLIB_FOUND AND APPLE)
79 target_link_libraries(JPWL_j2k_to_image ${Z_LIBNAME})
83 target_link_libraries(JPWL_j2k_to_image m)
86 add_executable(JPWL_image_to_j2k
92 TARGET JPWL_image_to_j2k
93 APPEND PROPERTY COMPILE_DEFINITIONS USE_JPWL
96 target_link_libraries(JPWL_image_to_j2k ${OPENJPEG_LIBRARY_NAME}_JPWL
97 ${LCMS_LIBNAME} ${PNG_LIBNAME} ${TIFF_LIBNAME})
99 # To support universal exe:
100 if(ZLIB_FOUND AND APPLE)
101 target_link_libraries(JPWL_image_to_j2k z)
102 ELSe(ZLIB_FOUND AND APPLE)
103 target_link_libraries(JPWL_image_to_j2k ${Z_LIBNAME})
107 target_link_libraries(JPWL_image_to_j2k m)
110 install(TARGETS JPWL_image_to_j2k JPWL_j2k_to_image
111 DESTINATION ${OPENJPEG_INSTALL_BIN_DIR} COMPONENT Applications