1 # Build the demo app, small examples
3 # First thing define the common source:
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)
18 # If not getopt was found then add it to the lib:
20 ADD_DEFINITIONS(-DDONT_HAVE_GETOPT)
25 ENDIF(DONT_HAVE_GETOPT)
28 # Do the proper thing when building static...if only there was configured
29 # headers or def files instead
30 IF(NOT BUILD_SHARED_LIBS)
31 ADD_DEFINITIONS(-DOPJ_STATIC)
32 ENDIF(NOT BUILD_SHARED_LIBS)
34 #FIND_PACKAGE(TIFF REQUIRED)
36 # Loop over all executables:
37 FOREACH(exe jp3d_to_volume volume_to_jp3d)
38 ADD_EXECUTABLE(${exe} ${exe}.c ${common_SRCS})
39 TARGET_LINK_LIBRARIES(${exe} ${OPJ_PREFIX}openjp3dvm) # ${TIFF_LIBRARIES})
40 # On unix you need to link to the math library:
42 TARGET_LINK_LIBRARIES(${exe} m)
45 INSTALL_TARGETS(/bin/ ${exe})