]> granicus.if.org Git - openjpeg/commitdiff
added cmake files to the project
authorAntonin Descampe <antonin@gmail.com>
Wed, 25 Jan 2006 09:23:17 +0000 (09:23 +0000)
committerAntonin Descampe <antonin@gmail.com>
Wed, 25 Jan 2006 09:23:17 +0000 (09:23 +0000)
CMakeLists.txt [new file with mode: 0644]
ChangeLog
DartConfig.cmake [new file with mode: 0644]
codec/CMakeLists.txt [new file with mode: 0644]
libopenjpeg/CMakeLists.txt [new file with mode: 0644]

diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644 (file)
index 0000000..9dc7f1e
--- /dev/null
@@ -0,0 +1,41 @@
+PROJECT(OPENJPEG C)
+
+#-----------------------------------------------------------------------------
+# OPENJPEG version number, usefull for packaging and doxygen doc:
+SET(OPENJPEG_MAJOR_VERSION 1)
+SET(OPENJPEG_MINOR_VERSION 0)
+SET(OPENJPEG_BUILD_VERSION 0)
+SET(OPENJPEG_VERSION
+  "${OPENJPEG_MAJOR_VERSION}.${OPENJPEG_MINOR_VERSION}.${OPENJPEG_BUILD_VERSION}")
+
+#-----------------------------------------------------------------------------
+# OpenJPEG build configuration options.
+OPTION(BUILD_SHARED_LIBS "Build OpenJPEG with shared libraries." OFF)
+
+#-----------------------------------------------------------------------------
+# For the codec...
+OPTION(BUILD_EXAMPLES "Build the Examples (codec...)." OFF)
+
+#-----------------------------------------------------------------------------
+# Always build the library
+SUBDIRS(
+  libopenjpeg
+  )
+#-----------------------------------------------------------------------------
+# Build example only if requested
+IF(BUILD_EXAMPLES)
+  SUBDIRS(codec)
+ENDIF(BUILD_EXAMPLES)
+
+#-----------------------------------------------------------------------------
+# For openjpeg team if they ever want Dart+CMake
+IF(OPJ_STANDALONE)
+  INCLUDE(Dart)
+  MARK_AS_ADVANCED(BUILD_TESTING DART_ROOT TCL_TCLSH)
+  IF(BUILD_TESTING)
+    ENABLE_TESTING()
+  ENDIF(BUILD_TESTING)
+ENDIF(OPJ_STANDALONE)
+# TODO, technically we should add tests, e.g:
+# http://www.crc.ricoh.com/~gormish/jpeg2000conformance/
+
index 5f2ce4fe1817a90f0dbcfdea314a0f92874bc9db..7cf688830d8c9d8efe0fa30fc545e5b4acd5e5ca 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -6,6 +6,7 @@ What's New for OpenJPEG
 + : added
 
 January 25, 2006
++ [Antonin Descampe] added cmake files to the project
 ! [Antonin Descampe] fix.c : replaced "WIN32" by "_MSC_VER" for int64
 + [Antonin Descampe] added "OPJ_EXPORT" in openjpeg.h to generate shared lib with win32
 ! [Antonin Descampe] removed all CtrlM from files
diff --git a/DartConfig.cmake b/DartConfig.cmake
new file mode 100644 (file)
index 0000000..421763f
--- /dev/null
@@ -0,0 +1,11 @@
+# Dashboard is opened for submissions for a 24 hour period starting at
+# the specified NIGHLY_START_TIME. Time is specified in 24 hour format.
+SET (NIGHTLY_START_TIME "21:00:00 EDT")
+
+# Dart server to submit results (used by client)
+SET (DROP_METHOD "http")
+SET (DROP_SITE "public.kitware.com")
+SET (DROP_LOCATION "/cgi-bin/HTTPUploadDartFile.cgi")
+SET (TRIGGER_SITE 
+    "http://${DROP_SITE}/cgi-bin/Submit-Public-TestingResults.cgi")
+
diff --git a/codec/CMakeLists.txt b/codec/CMakeLists.txt
new file mode 100644 (file)
index 0000000..ee496e3
--- /dev/null
@@ -0,0 +1,42 @@
+# Build the demo app, small examples
+
+# First thing define the common source:
+SET(common_SRCS
+  convert.c
+  )
+# Then check if getopt is present:
+INCLUDE (${CMAKE_ROOT}/Modules/CheckIncludeFile.cmake)
+SET(DONT_HAVE_GETOPT 1)
+IF(UNIX) #I am pretty sure only *nix sys have this anyway
+  CHECK_INCLUDE_FILE("getopt.h" CMAKE_HAVE_GETOPT_H)
+  # Seems like we need the contrary:
+  IF(CMAKE_HAVE_GETOPT_H)
+    SET(DONT_HAVE_GETOPT 0)
+  ENDIF(CMAKE_HAVE_GETOPT_H)
+ENDIF(UNIX)
+
+# If not getopt was found then add it to the lib:
+IF(DONT_HAVE_GETOPT)
+  ADD_DEFINITIONS(-DDONT_HAVE_GETOPT)
+  SET(common_SRCS
+    ${common_SRCS}
+    compat/getopt.c
+  )
+ENDIF(DONT_HAVE_GETOPT)
+
+
+# Headers file are located here:
+INCLUDE_DIRECTORIES(
+  ${OPENJPEG_SOURCE_DIR}/libopenjpeg
+  )
+
+# Loop over all executables:
+FOREACH(exe j2k_to_image image_to_j2k)
+  ADD_EXECUTABLE(${exe} ${exe}.c ${common_SRCS})
+  TARGET_LINK_LIBRARIES(${exe} ${OPJ_PREFIX}openjpeg)
+  IF(UNIX)
+    TARGET_LINK_LIBRARIES(${exe} -lm)
+  ENDIF(UNIX)
+ENDFOREACH(exe)
+
+
diff --git a/libopenjpeg/CMakeLists.txt b/libopenjpeg/CMakeLists.txt
new file mode 100644 (file)
index 0000000..08a072e
--- /dev/null
@@ -0,0 +1,35 @@
+INCLUDE_REGULAR_EXPRESSION("^.*$")
+# Create the lib
+SET(openjpeg_SRCS
+  bio.c
+  cio.c
+  dwt.c
+  event.c
+  fix.c
+  image.c
+  int.c
+  j2k.c
+  j2k_lib.c
+  jp2.c
+  jpt.c
+  mct.c
+  mqc.c
+  openjpeg.c
+  pi.c
+  raw.c
+  t1.c
+  t2.c
+  tcd.c
+  tgt.c
+)
+
+IF (WIN32)
+  IF (BUILD_SHARED_LIBS)
+    ADD_DEFINITIONS(-DOPJ_SHARED)
+  ELSE (BUILD_SHARED_LIBS)
+    ADD_DEFINITIONS(-DOPJ_STATIC)
+  ENDIF (BUILD_SHARED_LIBS)
+ENDIF (WIN32)
+
+ADD_LIBRARY(${OPJ_PREFIX}openjpeg ${openjpeg_SRCS})
+