ENH: Add jpwl. Also remove old deprecated way of linking lib math on unix
authorMathieu Malaterre <mathieu.malaterre@gmail.com>
Thu, 6 Sep 2007 10:23:40 +0000 (10:23 +0000)
committerMathieu Malaterre <mathieu.malaterre@gmail.com>
Thu, 6 Sep 2007 10:23:40 +0000 (10:23 +0000)
CMakeLists.txt
codec/CMakeLists.txt
jpwl/CMakeLists.txt [new file with mode: 0755]

index 0adeef7ed903deff6cbcb47a2ef2d1b96d54d3ae..e9ac7f701fe7a67bf59e585943a150ad3fa3fd5e 100644 (file)
@@ -54,6 +54,7 @@ INCLUDE_DIRECTORIES(BEFORE ${CMAKE_CURRENT_BINARY_DIR})
 SUBDIRS(
   libopenjpeg
   mj2
+  jpwl
   )
 #-----------------------------------------------------------------------------
 # Build example only if requested
index 2405846381091b88080bd4869c23ab4179c49fe0..7cb80904c4c6c538f65081bb597198fa472b3ffe 100644 (file)
@@ -44,7 +44,7 @@ FOREACH(exe j2k_to_image image_to_j2k)
   TARGET_LINK_LIBRARIES(${exe} ${OPJ_PREFIX}openjpeg ${TIFF_LIBRARIES})
   # On unix you need to link to the math library:
   IF(UNIX)
-    TARGET_LINK_LIBRARIES(${exe} -lm)
+    TARGET_LINK_LIBRARIES(${exe} m)
   ENDIF(UNIX)
   # Install exe
   INSTALL_TARGETS(/bin/ ${exe})
diff --git a/jpwl/CMakeLists.txt b/jpwl/CMakeLists.txt
new file mode 100755 (executable)
index 0000000..591c95f
--- /dev/null
@@ -0,0 +1,55 @@
+# Makefile for the main JPWL OpenJPEG codecs: JPWL_ j2k_to_image and JPWL_image_to_j2k
+
+ADD_DEFINITIONS(-DUSE_JPWL)
+
+SET(OPJ_SRCS 
+../libopenjpeg/bio.c 
+../libopenjpeg/cio.c 
+../libopenjpeg/dwt.c 
+../libopenjpeg/event.c 
+../libopenjpeg/image.c 
+../libopenjpeg/j2k.c 
+../libopenjpeg/j2k_lib.c 
+../libopenjpeg/jp2.c 
+../libopenjpeg/jpt.c 
+../libopenjpeg/mct.c 
+../libopenjpeg/mqc.c 
+../libopenjpeg/openjpeg.c 
+../libopenjpeg/pi.c 
+../libopenjpeg/raw.c 
+../libopenjpeg/t1.c 
+../libopenjpeg/t2.c 
+../libopenjpeg/tcd.c 
+../libopenjpeg/tgt.c
+)
+SET(JPWL_SRCS crc.c jpwl.c jpwl_lib.c rs.c)
+
+ADD_LIBRARY(openjpeg_JPWL ${JPWL_SRCS} ${OPJ_SRCS})
+
+# Do the proper thing when building static...if only there was configured
+# headers or def files instead
+#IF(NOT BUILD_SHARED_LIBS)
+#  ADD_DEFINITIONS(-DOPJ_STATIC)
+#ENDIF(NOT BUILD_SHARED_LIBS)
+
+INCLUDE_DIRECTORIES(
+  ${OPENJPEG_SOURCE_DIR}/libopenjpeg
+  )
+
+FIND_PACKAGE(TIFF REQUIRED)
+
+ADD_EXECUTABLE(JPWL_j2k_to_image
+../codec/convert.c ../codec/j2k_to_image.c
+)
+TARGET_LINK_LIBRARIES(JPWL_j2k_to_image openjpeg_JPWL ${TIFF_LIBRARIES})
+IF(UNIX)
+  TARGET_LINK_LIBRARIES(JPWL_j2k_to_image m)
+ENDIF(UNIX)
+
+ADD_EXECUTABLE(JPWL_image_to_j2k
+../codec/convert.c ../codec/image_to_j2k.c)
+TARGET_LINK_LIBRARIES(JPWL_image_to_j2k openjpeg_JPWL ${TIFF_LIBRARIES})
+IF(UNIX)
+  TARGET_LINK_LIBRARIES(JPWL_image_to_j2k m)
+ENDIF(UNIX)
+