From 84dbda823f69cf067652d18a263c3f9d9a9e184c Mon Sep 17 00:00:00 2001 From: malaterre Date: Thu, 7 Oct 2004 03:10:35 +0000 Subject: [PATCH] ENH: Apply remaining patch for the CMakeLists, and sublevel (8 & 12) ones --- src/jpeg/CMakeLists.txt | 114 +++++++++++++++++++++++++++++++ src/jpeg/libijg12/CMakeLists.txt | 82 ++-------------------- src/jpeg/libijg8/CMakeLists.txt | 57 ++-------------- 3 files changed, 123 insertions(+), 130 deletions(-) diff --git a/src/jpeg/CMakeLists.txt b/src/jpeg/CMakeLists.txt index c4816501..8a7e5f37 100644 --- a/src/jpeg/CMakeLists.txt +++ b/src/jpeg/CMakeLists.txt @@ -3,3 +3,117 @@ SUBDIRS( libijg8 ljpg ) + +# JPEG 8 bits project + +#PROJECT(GDCMJPEG) +#INCLUDE_REGULAR_EXPRESSION("^(jchuff|jconfig|jdct|jdhuff|jerror|jinclude|jmemsys|jmorecfg|jpegint|jpeglib|jversion|jpeg|gdcm).*$") +#INCLUDE_DIRECTORIES(${GDCMJPEG_SOURCE_DIR}) + + +# memmgr back ends: compile only one of these into a working library +# (For now, let's use the mode that requires the image fit into memory. +# This is the recommended mode for Win32 anyway.) +SET(systemdependent_SRCS jmemnobs.c) + +# library object files common to compression and decompression +SET(common_SRCS +jcomapi.c jutils.c jerror.c jmemmgr.c +) + +# compression library object files +SET(compression_SRCS +jcapimin.c jcapistd.c jctrans.c jcparam.c jdatadst.c jcinit.c +jcmaster.c jcmarker.c jcmainct.c jcprepct.c jccoefct.c jccolor.c +jcsample.c jchuff.c jcphuff.c jcdctmgr.c jfdctfst.c jfdctflt.c +jfdctint.c +) + +# decompression library object files +SET(decompression_SRCS +jdapimin.c jdapistd.c jdtrans.c jdatasrc.c jdmaster.c +jdinput.c jdmarker.c jdhuff.c jdphuff.c jdmainct.c jdcoefct.c +jdpostct.c jddctmgr.c jidctfst.c jidctflt.c jidctint.c jidctred.c +jdsample.c jdcolor.c jquant1.c jquant2.c jdmerge.c +) + +SET(JPEG_HEADER_FILES + jchuff.h + jdct.h + jdhuff.h + jerror.h + jinclude.h + jmemsys.h +# jmorecfg.h #no this one need to be configured + jpegint.h + jpeglib.h + jversion.h + ) + +SET(JPEG_SOURCES + ${systemdependent_SRCS} + ${common_SRCS} + ${compression_SRCS} + ${decompression_SRCS} + ) + + +# Attempt to generate two libraries: jpeg 8bits and 12 bits using only one +# source directory + +SET(JPEG8_SOURCES) +SET(JPEG12_SOURCES) +# MESSAGE("WOOOO") +FOREACH(file ${JPEG_SOURCES}) + # Duplicate jpeg source in subdir libijg8 + CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/libijg/${file}" + "${CMAKE_CURRENT_BINARY_DIR}/libijg8/${file}" + ) + SET(JPEG8_SOURCES ${JPEG8_SOURCES} "${CMAKE_CURRENT_BINARY_DIR}/libijg8/${file}") + + SET(BITS_TYPE_JPEG_MANGLE_NAME gdcm_mangle_8bits.h) + CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/libijg/jconfig.h.in + ${CMAKE_CURRENT_BINARY_DIR}/libijg8/jconfig.h @ONLY IMMEDIATE) + CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/libijg/gdcm_mangle_8bits.h + ${CMAKE_CURRENT_BINARY_DIR}/libijg8/gdcm_mangle_8bits.h @ONLY IMMEDIATE) + + #MESSAGE("${CMAKE_CURRENT_BINARY_DIR}/libijg8/${file}") + # Duplicate jpeg source in subdir libijg12 + CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/libijg/${file}" + "${CMAKE_CURRENT_BINARY_DIR}/libijg12/${file}" + ) + SET(JPEG12_SOURCES ${JPEG12_SOURCES} "${CMAKE_CURRENT_BINARY_DIR}/libijg12/${file}") + + SET(BITS_TYPE_JPEG_MANGLE_NAME gdcm_mangle_12bits.h) + CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/libijg/jconfig.h.in + ${CMAKE_CURRENT_BINARY_DIR}/libijg12/jconfig.h @ONLY IMMEDIATE) + CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/libijg/gdcm_mangle_12bits.h + ${CMAKE_CURRENT_BINARY_DIR}/libijg12/gdcm_mangle_12bits.h @ONLY IMMEDIATE) +ENDFOREACH(file) + +# Now copy the header file +FOREACH(file ${JPEG_HEADER_FILES}) + CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/libijg/${file}" + "${CMAKE_CURRENT_BINARY_DIR}/libijg8/${file}" + ) + CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/libijg/${file}" + "${CMAKE_CURRENT_BINARY_DIR}/libijg12/${file}" + ) +ENDFOREACH(file) +# Particular case jmorecfg.h needs to be specified either 8 or 12 bits: +SET(GDCM_BITS_IN_JSAMPLE 8) +CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/libijg/jmorecfg.h + ${CMAKE_CURRENT_BINARY_DIR}/libijg8/jmorecfg.h @ONLY IMMEDIATE) +SET(GDCM_BITS_IN_JSAMPLE 12) +CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/libijg/jmorecfg.h + ${CMAKE_CURRENT_BINARY_DIR}/libijg12/jmorecfg.h @ONLY IMMEDIATE) + +# MESSAGE("${JPEG8_SOURCES}") + +#ADD_LIBRARY(gdcmijpeg8 ${systemdependent_SRCS} ${common_SRCS} ${compression_SRCS} ${decompression_SRCS}) +#ADD_LIBRARY(gdcmijpeg8 ${JPEG8_SOURCES}) +#ADD_LIBRARY(gdcmijpeg12 ${JPEG12_SOURCES}) + +#INSTALL_TARGETS(/lib/ gdcmijpeg8) +#INSTALL_TARGETS(/lib/ gdcmijpeg12) +#INSTALL_FILES(/include .h jconfig.linux jconfig.vc) diff --git a/src/jpeg/libijg12/CMakeLists.txt b/src/jpeg/libijg12/CMakeLists.txt index 72548603..5ca8509c 100644 --- a/src/jpeg/libijg12/CMakeLists.txt +++ b/src/jpeg/libijg12/CMakeLists.txt @@ -1,78 +1,6 @@ -#----------------------------------------------------------------------------- -# Build jpeg lib for 12 bits: +# JPEG 12 bits project -SET(libgdcmijpeg12_la_SOURCES - jcapimin12.c - jcapistd12.c - jctrans12.c - jcparam12.c - jdatadst12.c - jcinit12.c - jcmaster12.c - jcmarker12.c - jcmainct12.c - jcprepct12.c - jccoefct12.c - jccolor12.c - jcsample12.c - jchuff12.c - jcphuff12.c - jcdctmgr12.c - jfdctfst12.c - jfdctflt12.c - jfdctint12.c - jdapimin12.c - jdapistd12.c - jdtrans12.c - jdatasrc12.c - jdmaster12.c - jdinput12.c - jdmarker12.c - jdhuff12.c - jdphuff12.c - jdmainct12.c - jdcoefct12.c - jdpostct12.c - jddctmgr12.c - jidctfst12.c - jidctflt12.c - jidctint12.c - jidctred12.c - jdsample12.c - jdcolor12.c - jquant112.c - jquant212.c - jdmerge12.c - jcomapi12.c - jutils12.c - jerror12.c - jmemmgr12.c - jmemnobs12.c -) - -SET(libgdcmijpeg12include_HEADERS - jchuff12.h - jconfig12.h - jdct12.h - jdhuff12.h - jerror12.h - jinclude12.h - jmemsys12.h - jmorecfg12.h - jpegint12.h - jpeglib12.h - jversion12.h -) - -#EXTRA_DIST = \ -# jconfig.linux \ -# jconfig.vc - -ADD_LIBRARY(gdcmijpeg12 ${libgdcmijpeg12_la_SOURCES}) - -#INSTALL_FILES(/include "\\.h$") -INSTALL_FILES(/include FILES ${libgdcmijpeg12include_HEADERS}) -#INSTALL_FILES(/include FILES jconfig.linux jconfig.vc) -INSTALL_FILES(/include FILES jconfig.linux) - -INSTALL_TARGETS(/lib/ gdcmijpeg12) +INCLUDE_DIRECTORIES( + ${GDCM_BINARY_DIR}/src/jpeg/libijg12 + ) +ADD_LIBRARY(gdcmijpeg12 ${JPEG12_SOURCES}) diff --git a/src/jpeg/libijg8/CMakeLists.txt b/src/jpeg/libijg8/CMakeLists.txt index d9dbe443..e0b9bd8b 100644 --- a/src/jpeg/libijg8/CMakeLists.txt +++ b/src/jpeg/libijg8/CMakeLists.txt @@ -1,55 +1,6 @@ # JPEG 8 bits project -PROJECT(GDCMJPEG) -INCLUDE_REGULAR_EXPRESSION("^(jchuff|jconfig|jdct|jdhuff|jerror|jinclude|jmemsys|jmorecfg|jpegint|jpeglib|jversion|jpeg|gdcm).*$") -INCLUDE_DIRECTORIES(${GDCMJPEG_SOURCE_DIR}) - - -# memmgr back ends: compile only one of these into a working library -# (For now, let's use the mode that requires the image fit into memory. -# This is the recommended mode for Win32 anyway.) -SET(systemdependent_SRCS jmemnobs.c) - -# library object files common to compression and decompression -SET(common_SRCS -jcomapi.c jutils.c jerror.c jmemmgr.c -) - -# compression library object files -SET(compression_SRCS -jcapimin.c jcapistd.c jctrans.c jcparam.c jdatadst.c jcinit.c -jcmaster.c jcmarker.c jcmainct.c jcprepct.c jccoefct.c jccolor.c -jcsample.c jchuff.c jcphuff.c jcdctmgr.c jfdctfst.c jfdctflt.c -jfdctint.c -) - -# decompression library object files -SET(decompression_SRCS -jdapimin.c jdapistd.c jdtrans.c jdatasrc.c jdmaster.c -jdinput.c jdmarker.c jdhuff.c jdphuff.c jdmainct.c jdcoefct.c -jdpostct.c jddctmgr.c jidctfst.c jidctflt.c jidctint.c jidctred.c -jdsample.c jdcolor.c jquant1.c jquant2.c jdmerge.c -) - -ADD_LIBRARY(gdcmijpeg8 ${systemdependent_SRCS} ${common_SRCS} ${compression_SRCS} ${decompression_SRCS}) - -INSTALL_TARGETS(/lib/ gdcmijpeg8) -INSTALL_FILES(/include .h jconfig.linux jconfig.vc) - -# Attempt to generate two libraries: jpeg 8bits and 12 bits using only one -# source directory - -# For now disable it - -#extremly dangerous as there could be a /usr/include/jconfig.h from regular jpeg lib -#INCLUDE_DIRECTORIES(${GDCMJPEG_BINARY_DIR}) - -SET(BITS_TYPE_JPEG_MANGLE_NAME gdcm_mangle_8bits.h) -CONFIGURE_FILE(${GDCMJPEG_SOURCE_DIR}/jconfig.h.in - ${GDCMJPEG_BINARY_DIR}/jconfig.h @ONLY) -#ADD_LIBRARY(gdcmijpeg8 ${systemdependent_SRCS} ${common_SRCS} ${compression_SRCS} ${decompression_SRCS}) - -SET(BITS_TYPE_JPEG_MANGLE_NAME gdcm_mangle_12bits.h) -CONFIGURE_FILE(${GDCMJPEG_SOURCE_DIR}/jconfig.h.in - ${GDCMJPEG_BINARY_DIR}/jconfig.h @ONLY) -#ADD_LIBRARY(gdcmijpeg12 ${systemdependent_SRCS} ${common_SRCS} ${compression_SRCS} ${decompression_SRCS}) +INCLUDE_DIRECTORIES( + ${GDCM_BINARY_DIR}/src/jpeg/libijg8 + ) +ADD_LIBRARY(gdcmijpeg8 ${JPEG8_SOURCES}) -- 2.48.1