78ad7543ea74bd337b627c715fe00b5f93c5311a
[openjpeg.git] / src / bin / mj2 / CMakeLists.txt
1 # Makefile for the MJ2 codecs of the OpenJPEG library: frames_to_mj2, mj2_to_frames, extract_j2k_from_mj2 and wrap_j2k_in_mj2
2
3 set(common_SRCS ${OPENJPEG_SOURCE_DIR}/src/bin/common/opj_getopt.c)
4
5 if(WIN32)
6   if(BUILD_SHARED_LIBS)
7     add_definitions(-DOPJ_EXPORTS)
8   else()
9     add_definitions(-DOPJ_STATIC)
10   endif()
11 endif()
12
13 # Headers file are located here:
14 include_directories(
15   ${OPENJPEG_BINARY_DIR}/src/lib/openjp2 # opj_config.h
16   ${OPENJPEG_BINARY_DIR}/src/bin/common # opj_apps_config.h
17   ${OPENJPEG_SOURCE_DIR}/src/lib/openmj2
18   ${OPENJPEG_SOURCE_DIR}/src/bin/common
19   ${LCMS_INCLUDE_DIRNAME}
20   )
21
22 foreach(exe
23   opj_mj2_wrap
24   opj_mj2_extract
25   opj_mj2_decompress
26   opj_mj2_compress
27 )
28   add_definitions(-DOPJ_USE_LEGACY)
29   add_executable(${exe}
30     ${exe}.c
31     ${common_SRCS}
32     ${MJ2_SRCS}
33     ${OPENJPEG_SOURCE_DIR}/src/bin/common/color.c
34     )
35   set_property(
36     TARGET ${exe}
37     APPEND PROPERTY COMPILE_DEFINITIONS USE_MJ2
38   )
39   target_link_libraries(${exe} ${LCMS_LIBNAME} openmj2)
40   
41   if(UNIX)
42     target_link_libraries(${exe} m)
43   endif()
44   
45   install(TARGETS ${exe}
46         DESTINATION ${OPENJPEG_INSTALL_BIN_DIR})
47 endforeach()