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 # Headers file are located here:
30 ${OPENJPEG_SOURCE_DIR}/libopenjpeg
33 # Loop over all executables:
34 FOREACH(exe j2k_to_image image_to_j2k)
35 ADD_EXECUTABLE(${exe} ${exe}.c ${common_SRCS})
36 TARGET_LINK_LIBRARIES(${exe} gdcmopenjpeg)
38 TARGET_LINK_LIBRARIES(${exe} -lm)
42 ## $Id: CMakeLists.txt,v 1.2 2005/10/24 18:40:55 malaterre Exp $
44 ## makefile for OpenJPEG codec
46 #OPENJPEG_DIR = ../libopenjpeg
54 #CFLAGS = -Wall -O3 -fno-strength-reduce -fomit-frame-pointer -I$(OPENJPEG_DIR)
56 #OBJ_DIR_W32 = obj.w32
57 #BIN_DIR_W32 = bin.w32
58 #LIB_DIR_W32 = $(OPENJPEG_DIR)/lib.w32
61 # CC = i386-mingw32-gcc
62 # CFLAGS += -DDONT_HAVE_GETOPT
63 # OBJ_DIR = $(OBJ_DIR_W32)
64 # BIN_DIR = $(BIN_DIR_W32)
66 # all: $(BIN_DIR) $(OBJ_DIR) $(LIB_DIR) \
67 # $(addprefix $(BIN_DIR)/,j2k_to_image.exe image_to_j2k.exe)
73 # all: $(BIN_DIR) $(OBJ_DIR) $(LIB_DIR) \
74 # $(addprefix $(BIN_DIR)/,j2k_to_image image_to_j2k)
79 # LIB_OPENJPEG = $(LIB_DIR)/libopenjpeg.dll
80 # LDFLAGS += -L$(LIB_DIR) -lopenjpeg
82 # LIB_OPENJPEG = $(OPENJPEG_DIR)/$(LIB_DIR)/libopenjpeg.so
83 # LDFLAGS += -L$(OPENJPEG_DIR)/$(LIB_DIR) -lopenjpeg
86 # LIB_OPENJPEG = $(OPENJPEG_DIR)/$(LIB_DIR)/libopenjpeg.a
87 # LDFLAGS += $(LIB_OPENJPEG)
99 #$(LIB_DIR)/libopenjpeg.dll: $(OPENJPEG_DIR)/$(LIB_DIR)/libopenjpeg.dll
101 #$(OPENJPEG_DIR)/$(LIB_DIR)/libopenjpeg.dll:
102 # cd $(OPENJPEG_DIR) && \
103 # $(MAKE) $(OBJ_DIR) $(LIB_DIR) $(LIB_DIR)/libopenjpeg.dll
104 #$(OPENJPEG_DIR)/$(LIB_DIR)/libopenjpeg.a:
105 # cd $(OPENJPEG_DIR) && \
106 # $(MAKE) $(OBJ_DIR) $(LIB_DIR) $(LIB_DIR)/libopenjpeg.a
107 #$(OPENJPEG_DIR)/$(LIB_DIR)/libopenjpeg.so:
108 # cd $(OPENJPEG_DIR) && \
109 # $(MAKE) $(LIB_DIR) $(LIB_DIR)/libopenjpeg.so
112 # $(CC) -c $(CFLAGS) $(CPPFLAGS) -o $@ $<
114 #$(OBJ_DIR)/getopt.o: compat/getopt.c
115 #$(OBJ_DIR)/convert.o: convert.c
116 #$(OBJ_DIR)/j2k_to_image.o: j2k_to_image.c
117 #$(OBJ_DIR)/image_to_j2k.o: image_to_j2k.c convert.h
119 #J2I_OBJS = $(addprefix $(OBJ_DIR)/,j2k_to_image.o)
120 #I2J_OBJS = $(addprefix $(OBJ_DIR)/,image_to_j2k.o convert.o)
122 #$(BIN_DIR)/j2k_to_image: $(J2I_OBJS) $(LIB_OPENJPEG)
123 # ${CC} -o $@ $(J2I_OBJS) ${LDFLAGS}
125 #$(BIN_DIR)/image_to_j2k: $(I2J_OBJS) $(LIB_OPENJPEG)
126 # ${CC} -o $@ $(I2J_OBJS) ${LDFLAGS}
128 #$(BIN_DIR)/j2k_to_image.exe: $(J2I_OBJS) $(LIB_OPENJPEG)
129 # ${CC} -o $@ $(J2I_OBJS) ${LDFLAGS}
131 #$(BIN_DIR)/image_to_j2k.exe: $(I2J_OBJS) $(LIB_OPENJPEG) $(OBJ_DIR)/getopt.o
132 # ${CC} -o $@ $(I2J_OBJS) ${LDFLAGS} $(OBJ_DIR)/getopt.o
135 # rm -f $(BIN_DIR_W32)/* $(BIN_DIR)/* $(OBJ_DIR_W32)/* $(OBJ_DIR)/*