M CHANGES
[openjpeg.git] / JavaOpenJPEG / 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   )
7
8 # If not getopt was found then add it to the lib:
9 IF(DONT_HAVE_GETOPT)
10   SET(common_SRCS
11     ${common_SRCS}
12     compat/getopt.c
13   )
14 ENDIF(DONT_HAVE_GETOPT)
15
16
17 # Headers file are located here:
18 INCLUDE_DIRECTORIES(
19   ${OPENJPEG_SOURCE_DIR}/libopenjpeg
20   )
21
22 FIND_PACKAGE(TIFF REQUIRED)
23
24 # Loop over all executables:
25 FOREACH(exe j2k_to_image image_to_j2k)
26   ADD_EXECUTABLE(${exe} ${exe}.c ${common_SRCS})
27   TARGET_LINK_LIBRARIES(${exe} ${OPJ_PREFIX}openjpeg ${TIFF_LIBRARIES})
28   # On unix you need to link to the math library:
29   IF(UNIX)
30     TARGET_LINK_LIBRARIES(${exe} -lm)
31   ENDIF(UNIX)
32   # Install exe
33   INSTALL_TARGETS(/bin/ ${exe})
34 ENDFOREACH(exe)
35
36