[trunk]rename the cinema option to old one
[openjpeg.git] / src / bin / jp2 / CMakeLists.txt
1 # Build the demo app, small examples
2
3 # First thing define the common source:
4 set(common_SRCS
5   convert.c
6   index.c
7   ${OPENJPEG_SOURCE_DIR}/src/bin/common/color.c
8   ${OPENJPEG_SOURCE_DIR}/src/bin/common/opj_getopt.c
9   )
10
11 # Headers file are located here:
12 include_directories(
13   ${OPENJPEG_BINARY_DIR}/src/lib/openjp2 # opj_config.h
14   ${OPENJPEG_SOURCE_DIR}/src/lib/openjp2
15   ${OPENJPEG_SOURCE_DIR}/src/bin/common
16   ${LCMS_INCLUDE_DIRNAME}
17   ${Z_INCLUDE_DIRNAME}
18   ${PNG_INCLUDE_DIRNAME}
19   ${TIFF_INCLUDE_DIRNAME}
20   )
21
22 if(WIN32)
23   if(BUILD_SHARED_LIBS)
24     add_definitions(-DOPJ_EXPORTS)
25   else()
26     add_definitions(-DOPJ_STATIC)
27   endif()
28 endif()
29
30 # Loop over all executables:
31 foreach(exe opj_decompress opj_compress opj_dump)
32   add_executable(${exe} ${exe}.c ${common_SRCS})
33   target_link_libraries(${exe} ${OPENJPEG_LIBRARY_NAME}
34     ${PNG_LIBNAME} ${TIFF_LIBNAME} ${LCMS_LIBNAME}
35     )
36   # To support universal exe:
37   if(ZLIB_FOUND AND APPLE)
38     target_link_libraries(${exe} z)
39   else(ZLIB_FOUND AND APPLE)
40     target_link_libraries(${exe} ${Z_LIBNAME})
41   endif()
42
43   # On unix you need to link to the math library:
44   if(UNIX)
45     target_link_libraries(${exe} m)
46   endif()
47   # Install exe
48   install(TARGETS ${exe}
49     EXPORT OpenJPEGTargets
50     DESTINATION ${OPENJPEG_INSTALL_BIN_DIR} COMPONENT Applications
51   )
52 endforeach()
53
54 # Install man pages
55 install(
56   FILES       ${OPENJPEG_SOURCE_DIR}/doc/man/man1/opj_compress.1
57               ${OPENJPEG_SOURCE_DIR}/doc/man/man1/opj_decompress.1
58               ${OPENJPEG_SOURCE_DIR}/doc/man/man1/opj_dump.1
59   DESTINATION ${OPENJPEG_INSTALL_MAN_DIR}/man1)
60 #