From e6aae962178605924ac611ade4dddfe069ef0a98 Mon Sep 17 00:00:00 2001 From: Antonin Descampe Date: Wed, 25 Jan 2006 09:23:17 +0000 Subject: [PATCH] added cmake files to the project --- CMakeLists.txt | 41 +++++++++++++++++++++++++++++++++++++ ChangeLog | 1 + DartConfig.cmake | 11 ++++++++++ codec/CMakeLists.txt | 42 ++++++++++++++++++++++++++++++++++++++ libopenjpeg/CMakeLists.txt | 35 +++++++++++++++++++++++++++++++ 5 files changed, 130 insertions(+) create mode 100644 CMakeLists.txt create mode 100644 DartConfig.cmake create mode 100644 codec/CMakeLists.txt create mode 100644 libopenjpeg/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 00000000..9dc7f1eb --- /dev/null +++ b/CMakeLists.txt @@ -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/ + diff --git a/ChangeLog b/ChangeLog index 5f2ce4fe..7cf68883 100644 --- 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 index 00000000..421763f5 --- /dev/null +++ b/DartConfig.cmake @@ -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 index 00000000..ee496e33 --- /dev/null +++ b/codec/CMakeLists.txt @@ -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 index 00000000..08a072ed --- /dev/null +++ b/libopenjpeg/CMakeLists.txt @@ -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}) +