Initial commit of openjpeg version 2. Temprarily added as a separate directory in...
[openjpeg.git] / jp3d / codec / 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 # Then check if getopt is present:
8 INCLUDE (${CMAKE_ROOT}/Modules/CheckIncludeFile.cmake)
9 SET(DONT_HAVE_GETOPT 1)
10 IF(UNIX) #I am pretty sure only *nix sys have this anyway
11   CHECK_INCLUDE_FILE("getopt.h" CMAKE_HAVE_GETOPT_H)
12   # Seems like we need the contrary:
13   IF(CMAKE_HAVE_GETOPT_H)
14     SET(DONT_HAVE_GETOPT 0)
15   ENDIF(CMAKE_HAVE_GETOPT_H)
16 ENDIF(UNIX)
17
18 # If not getopt was found then add it to the lib:
19 IF(DONT_HAVE_GETOPT)
20   ADD_DEFINITIONS(-DDONT_HAVE_GETOPT)
21   SET(common_SRCS
22     ${common_SRCS}
23     compat/getopt.c
24   )
25 ENDIF(DONT_HAVE_GETOPT)
26
27
28 # Headers file are located here:
29 INCLUDE_DIRECTORIES(
30   ${CMAKE_CURRENT_SOURCE_DIR}/../libjp3dvm
31   )
32
33 # Do the proper thing when building static...if only there was configured
34 # headers or def files instead
35 #IF(NOT BUILD_SHARED_LIBS)
36 #  ADD_DEFINITIONS(-DOPJ_STATIC)
37 #ENDIF(NOT BUILD_SHARED_LIBS)
38
39 #FIND_PACKAGE(TIFF REQUIRED)
40
41 # Loop over all executables:
42 FOREACH(exe jp3d_to_volume volume_to_jp3d)
43   ADD_EXECUTABLE(${exe} ${exe}.c ${common_SRCS})
44   TARGET_LINK_LIBRARIES(${exe} ${OPJ_PREFIX}openjp3dvm) # ${TIFF_LIBRARIES})
45   # On unix you need to link to the math library:
46   IF(UNIX)
47     TARGET_LINK_LIBRARIES(${exe} m)
48   ENDIF(UNIX)
49   # Install exe
50   INSTALL_TARGETS(/bin/ ${exe})
51 ENDFOREACH(exe)
52
53