]> Creatis software - gdcm.git/blob - src/gdcmjpeg/CMakeLists.txt
Rmove now useless PhilipsToBrucker.cxx (use PhilipsToBrucker2.cxx instead)
[gdcm.git] / src / gdcmjpeg / CMakeLists.txt
1 PROJECT(GDCMJPEG)
2
3 INCLUDE_REGULAR_EXPRESSION("^(jchuff|jconfig|jdct|jdhuff|jerror|jinclude|jmemsys|jmorecfg|jpegint|jpeglib|jversion|jpeg).*$")
4
5 # memmgr back ends: compile only one of these into a working library
6 # (For now, let's use the mode that requires the image fit into memory.
7 # This is the recommended mode for Win32 anyway.)
8 SET(systemdependent_SRCS jmemnobs.c)
9
10 # library object files common to compression and decompression
11 SET(common_SRCS
12 jcomapi.c jutils.c jerror.c jmemmgr.c
13 )
14
15 # compression library object files
16 SET(compression_SRCS
17 jcapimin.c jcapistd.c jctrans.c jcparam.c  jcinit.c
18 jcmaster.c jcmarker.c jcmainct.c jcprepct.c jccoefct.c jccolor.c
19 jcsample.c jchuff.c jcphuff.c jcdctmgr.c jfdctfst.c jfdctflt.c
20 jdatadst.c
21 )
22
23 # Lossy (DCT) codec:
24 SET(comp_lossy_SRCS
25 jfdctint.c
26 jclossy.c
27
28 # lossless
29 jclossls.c
30
31 jdarith.c
32 jcodec.c
33 jcscale.c
34 jcshuff.c
35 jclhuff.c
36 jcpred.c
37 jcdiffct.c
38 )
39
40 # decompression library object files
41 SET(decompression_SRCS
42 jdapimin.c jdapistd.c jdtrans.c  jdmaster.c
43 jdinput.c jdmarker.c jdhuff.c jdphuff.c jdmainct.c jdcoefct.c
44 jdpostct.c jddctmgr.c jidctfst.c jidctflt.c jidctint.c jidctred.c
45 jdsample.c jdcolor.c jquant1.c jquant2.c jdmerge.c
46 jdatasrc.c
47 )
48
49 SET(decomp_lossy_SRCS
50  jdlossls.c jdlossy.c
51 jcarith.c
52 jdlhuff.c
53 jddiffct.c
54 jdpred.c
55 jdscale.c
56 jdshuff.c
57 )
58
59 SET(JPEG_HEADER_FILES
60   jchuff.h  
61   jdct.h  
62   jdhuff.h  
63   jerror.h  
64   jinclude.h  
65   jmemsys.h  
66 #  jmorecfg.h     #this one need to be configured
67   jpegint.h  
68   jpeglib.h  
69   jversion.h
70   jlossy.h
71   jlossls.h
72   )
73
74 SET(JPEG_SOURCES)
75 FOREACH(src
76   ${systemdependent_SRCS}
77   ${common_SRCS}
78   ${compression_SRCS}
79   ${decompression_SRCS}
80   ${comp_lossy_SRCS}
81   ${decomp_lossy_SRCS}
82   )
83   SET(JPEG_SOURCES ${JPEG_SOURCES}
84     "${GDCMJPEG_SOURCE_DIR}/${src}")
85 ENDFOREACH(src)
86
87 IF (WIN32)
88   IF (BUILD_SHARED_LIBS)
89     #ADD_DEFINITIONS(-DJPEGDLL)
90     SET(JPEGDLL 1)
91   ELSE (BUILD_SHARED_LIBS)
92     #ADD_DEFINITIONS(-DJPEGSTATIC)
93     SET(JPEGSTATIC 1)
94   ENDIF (BUILD_SHARED_LIBS)
95 ENDIF (WIN32)
96
97 # By default support DICOMObjects bug, if this is a speed penalty for you
98 # you should consider disabling it
99 SET(SUPPORT_DICOMOBJECTS_BUG ON)
100
101 CONFIGURE_FILE(${GDCMJPEG_SOURCE_DIR}/.NoDartCoverage
102                ${GDCMJPEG_BINARY_DIR}/.NoDartCoverage)
103
104 # Generate three libraries: jpeg 8bits, 12bits and 16bits
105 # using only one source directory
106
107 # Particular case jmorecfg.h needs to be specified either 8, 12 or 16 bits:
108 FOREACH(bits 8 12 16)
109   SET(CMAKE_BITS_IN_JSAMPLE ${bits})
110   CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/jmorecfg.h.in
111                  ${CMAKE_CURRENT_BINARY_DIR}/${bits}/jmorecfg.h @ONLY IMMEDIATE)
112   SET(BITS_TYPE_JPEG_MANGLE_NAME "gdcmjpeg/mangle_jpeg${bits}bits.h")
113   CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/jconfig.h.in
114                  ${CMAKE_CURRENT_BINARY_DIR}/${bits}/jconfig.h @ONLY IMMEDIATE)
115   # Dummy copy for GDCM to include <gdcmjpeg/8/jpeglib.h> with no conflict
116   CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/jpeglib.h
117                  ${CMAKE_CURRENT_BINARY_DIR}/${bits}/jpeglib.h COPYONLY IMMEDIATE)
118   CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/jerror.h
119                  ${CMAKE_CURRENT_BINARY_DIR}/${bits}/jerror.h COPYONLY IMMEDIATE)
120   CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/jinclude.h
121                  ${CMAKE_CURRENT_BINARY_DIR}/${bits}/jinclude.h COPYONLY IMMEDIATE)
122 ENDFOREACH(bits)
123
124 SUBDIRS(8 12 16)
125