From: malaterre Date: Thu, 9 Oct 2003 14:52:45 +0000 (+0000) Subject: * CMake-ification of gdcm, we have now two build system X-Git-Tag: Version0.3.1~122 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=7b90a94638699fec1143d1928f6a6b6f3c769d54;p=gdcm.git * CMake-ification of gdcm, we have now two build system --- diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 00000000..2b40cf5d --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,66 @@ +PROJECT(GDCM) +CMAKE_MINIMUM_REQUIRED(VERSION 1.6) + +# The GDCM version number. +SET(GDCM_VERSION_MAJOR 1) +SET(GDCM_VERSION_MINOR 9) +SET(GDCM_VERSION_PATCH 0) +SET(GDCM_VERSION "${GDCM_VERSION_MAJOR}.${GDCM_VERSION_MINOR}") +SET(GDCM_VERSION_FULL "${GDCM_VERSION}.${GDCM_VERSION_PATCH}") + +SET(GDCM_DATA_DIR "/share/gdcm" CACHE STRING + "Install location for data (relative to prefix).") +MARK_AS_ADVANCED(GDCM_DATA_DIR) + + +OPTION(BUILD_SHARED_LIBS "Build GDCM with shared libraries." ON) +SET(GDCM_BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS}) + +INCLUDE_DIRECTORIES( +) + +#Build directory on which many applications depend +SUBDIRS(src + Test + Dicts) + +FIND_PACKAGE(VTK) +#If vtk found +IF(VTK_FOUND) + OPTION(GDCM_VTK "Build VTK-GDCM Lib." OFF) + IF(GDCM_VTK) + INCLUDE(${VTK_USE_FILE}) + SUBDIRS(vtk) + ENDIF(GDCM_VTK) +ENDIF(VTK_FOUND) + +FIND_PACKAGE(PythonLibs) +#If PythonLibs found +IF(PYTHON_LIBRARY) + OPTION(GDCM_WRAP_PYTHON "Wrap GDCM classes into the Python language." OFF) + #if wrapping enable + IF(GDCM_WRAP_PYTHON) + SUBDIRS(gdcmPython) + ENDIF(GDCM_WRAP_PYTHON) +ENDIF(PYTHON_LIBRARY) + +#Doxygen stuff +# SUBDIRS(Doc) + + +# EXTRA_DIST = \ +# AUTHORS \ +# ChangeLog \ +# COPYING \ +# INSTALL \ +# NEWS \ +# README \ +# TODO \ +# gdcm.spec \ +# gdcm.dsw + +#release: +# $(MAKE) dist distdir=$(PACKAGE)-$(VERSION) + +#snapshot: +# $(MAKE) dist distdir=$(PACKAGE)`date +"%y%m%d"` diff --git a/ChangeLog b/ChangeLog index 1bf2e060..f29ce9f3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,5 @@ +2003-10-09 Mathieu Malaterre + * CMake-ification of gdcm, we have now two build system 2003-10-03 Mathieu Malaterre * vtkGdcmReader is now able to read rgb dicom file. * src/gdcmHeaderHelper : GetNumberOfScalarComponents() diff --git a/Dicts/CMakeLists.txt b/Dicts/CMakeLists.txt new file mode 100644 index 00000000..d89e386b --- /dev/null +++ b/Dicts/CMakeLists.txt @@ -0,0 +1,16 @@ +#SET(dictsdir +# ${GDCM_SOURCE_DIR}/gdcm +#) + +#SET(dicts_DATA +# dicomV3.dic +# README +#) + +#SET(EXTRA_DIST +# dicomV3.dic +#) + +#IF(UNIX) + INSTALL_FILES(${GDCM_DATA_DIR} FILES dicomV3.dic README) +#ENDIF(UNIX) \ No newline at end of file diff --git a/Doc/CMakeLists.txt b/Doc/CMakeLists.txt new file mode 100644 index 00000000..503fa1da --- /dev/null +++ b/Doc/CMakeLists.txt @@ -0,0 +1 @@ +#TODO \ No newline at end of file diff --git a/Testing/CMakeLists.txt b/Testing/CMakeLists.txt new file mode 100644 index 00000000..c273c1d5 --- /dev/null +++ b/Testing/CMakeLists.txt @@ -0,0 +1,41 @@ +#For later : rewrite this things for more consistencies, such as a 'FOREACH' + +LINK_LIBRARIES(gdcm) +INCLUDE_DIRECTORIES( + ${GDCM_SOURCE_DIR}/src/ +) + +SET(PrintHeader_SOURCES + PrintHeader.cxx +) +ADD_EXECUTABLE(PrintHeader ${PrintHeader_SOURCES}) + +SET(testWrite_SOURCES + testWrite.cxx +) +ADD_EXECUTABLE(testWrite ${testWrite_SOURCES}) + +SET(testChangeEntete_SOURCES + testChangeEntete.cxx +) +ADD_EXECUTABLE(testChangeEntete ${testChangeEntete_SOURCES}) + +SET(hashtest_SOURCES + hashtest.cxx +) +ADD_EXECUTABLE(hashtest ${hashtest_SOURCES}) + +SET(bug1_SOURCES + bug1.cxx +) +ADD_EXECUTABLE(bug1 ${bug1_SOURCES}) + +SET(pourFindTaggs_SOURCES + pourFindTaggs.cxx +) +ADD_EXECUTABLE(pourFindTaggs ${pourFindTaggs_SOURCES}) + +SET(dcm2acr_SOURCES + dcm2acr.cxx +) +ADD_EXECUTABLE(dcm2acr ${dcm2acr_SOURCES}) diff --git a/gdcmPython/CMakeLists.txt b/gdcmPython/CMakeLists.txt new file mode 100644 index 00000000..ab303084 --- /dev/null +++ b/gdcmPython/CMakeLists.txt @@ -0,0 +1,77 @@ +#IF(GDCM_WRAP_PYTHON) +#If we reach this dir we have selected this option + + +#TODO +#http://www.cmake.org/pipermail/cmake/2003-August/004185.html +#http://www.cmake.org/pipermail/cmake/2003-January/001092.html + +#As of 09/10/2003 there was no FindSWIG.cmake + +#gdcm_wrap.cxx: $(srcdir)/gdcm.i +# $(SWIG) -python -c++ $(SWIG_INC) -o $@ $< + +INCLUDE_DIRECTORIES( + ${GDCM_SOURCE_DIR}/src +) + +SET(GDCM_INC + ${GDCM_SOURCE_DIR}/src +# -I$(top_builddir) +) + +SET(SWIG_INC + ${PYTHON_INCLUDES} + ${GDCM_INC} +) + + +SET(GDCM_PYTHON_SOURCES + gdcm_wrap.cxx +) + +SET_SOURCE_FILES_PROPERTIES(gdcm_wrap.cxx GENERATED) + +ADD_CUSTOM_COMMAND( +SOURCE ${GDCM_SOURCE_DIR}/gdcmPython/gdcm.i +COMMAND swig +ARGS -python -c++ -I${GDCM_SOURCE_DIR}/src -o gdcm_wrap.cxx ${GDCM_SOURCE_DIR}/gdcmPython/gdcm.i +OUTPUTS gdcm_wrap.cxx +TARGET pygdcm +) + +ADD_LIBRARY(pygdcm ${GDCM_PYTHON_SOURCES}) + + + +IF(GDCM_VTK) +# INCLUDE_DIRECTORIES( +# ${GDCM_SOURCE_DIR}/vtk +# ) + + SET(vtkgdcmPython_la_SOURCES +# vtkGdcmReaderPython.cxx +# vtkGdcmInit.cxx + ${GDCM_SOURCE_DIR}/vtk/vtkGdcmReader.cxx + ) + SET_SOURCE_FILES_PROPERTIES(vtkGdcmReaderPython.cxx GENERATED) + #vtkWrapPythonInit.c + + # The C++ files must be made into a C++ library + #ADD_LIBRARY ( vtkgdcmPython ${vtkgdcmPython_la_SOURCES}) + + # set the libraries to link against + #TARGET_LINK_LIBRARIES(vtkgdcmPython vtkCommon) + + # Configure Python module, which is the plugin itself + IF (GDCM_WRAP_PYTHON) + VTK_WRAP_PYTHON2(vtkgdcmPython gdcmfoo + ${vtkgdcmPython_la_SOURCES}) + ADD_LIBRARY(vtkgdcmPython SHARED ${gdcmfoo}) + TARGET_LINK_LIBRARIES (vtkgdcmPython + pygdcm + vtkgdcm + vtkCommonPython + vtkIOPython) + ENDIF (GDCM_WRAP_PYTHON) +ENDIF(GDCM_VTK) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt new file mode 100644 index 00000000..09b29782 --- /dev/null +++ b/src/CMakeLists.txt @@ -0,0 +1,76 @@ +SUBDIRS(jpeg) + +#CXXFLAGS = @CXXFLAGS@ -DPUB_DICT_PATH=\"$(datadir)/gdcm/\" \ +# -D__STDC_LIMIT_MACROS # Refer to stdint.h + + +SET(libgdcm_la_SOURCES + gdcmException.cxx + gdcmUtil.cxx + gdcmHeader.cxx + gdcmHeaderHelper.cxx + gdcmElValue.cxx + gdcmDictEntry.cxx + gdcmDict.cxx + gdcmDictSet.cxx + gdcmElValSet.cxx + gdcmHeaderIdo.cxx + gdcmFile.cxx + gdcmVR.cxx + gdcmTS.cxx + gdcmJpeg.cxx + gdcmJpeg12.cxx + gdcmJpeg2000.cxx + gdcmRLE.cxx + gdcmParse.cxx + gdcmJpegIdo.cxx +) +#Why one should not use ADD_DEFINITIONS +#http://www.cmake.org/pipermail/cmake/2003-September/004286.html +#ADD_DEFINITIONS(-DPUB_DICT_PATH=\\"${CMAKE_INSTALL_PREFIX}${GDCM_DATA_DIR}/\\") +#ADD_DEFINITIONS(-D__STDC_LIMIT_MACROS) + +SET_SOURCE_FILES_PROPERTIES(${libgdcm_la_SOURCES} + PROPERTIES + COMPILE_FLAGS -DPUB_DICT_PATH=\\"${CMAKE_INSTALL_PREFIX}${GDCM_DATA_DIR}\\" + COMPILE_FLAGS -D__STDC_LIMIT_MACROS +) + + +#libgdcminclude_HEADERS = \ +# gdcmException.h \ +# gdcmHeader.h \ +# gdcmHeaderHelper.h \ +# gdcmCommon.h \ +# gdcm.h \ +# gdcmDictSet.h \ +# gdcmDict.h \ +# gdcmDictEntry.h \ +# gdcmElValue.h \ +# gdcmElValSet.h \ +# gdcmVR.h \ +# gdcmTS.h \ +# gdcmFile.h + +#EXTRA_DIST = \ +# gdcmUtil.h \ +# gdcmIdo.h \ +# iddcmjpeg.h + + + + +ADD_LIBRARY(gdcm ${libgdcm_la_SOURCES} ) +#TODO this is not working out of the box (on the first time) +IF(WIN32) + TARGET_LINK_LIBRARIES(gdcm + gdcmijpeg8 + gdcmijpeg12 + Wsock32.lib + ) +ELSE(WIN32) + TARGET_LINK_LIBRARIES(gdcm + gdcmijpeg8 + gdcmijpeg12 + ) +ENDIF(WIN32) \ No newline at end of file diff --git a/src/jpeg/CMakeLists.txt b/src/jpeg/CMakeLists.txt new file mode 100644 index 00000000..1b39bd53 --- /dev/null +++ b/src/jpeg/CMakeLists.txt @@ -0,0 +1,4 @@ +SUBDIRS( + libijg12 + libijg8 +) diff --git a/src/jpeg/libijg/CMakeLists.txt b/src/jpeg/libijg/CMakeLists.txt new file mode 100644 index 00000000..d3f0727d --- /dev/null +++ b/src/jpeg/libijg/CMakeLists.txt @@ -0,0 +1,76 @@ +#LTVERSION = 0:1:0 + +#lib_LTLIBRARIES = libgdcmijpeg8.la + +##CXXFLAGS = @CXXFLAGS@ + +SET(libgdcmijpeg8_la_SOURCES + 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 + 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 + jcomapi.c + jutils.c + jerror.c + jmemmgr.c + jmemnobs.c + rdrle.c +) + +#libgdcmijpeg8includedir = $(includedir) +SET(libgdcmijpeg8include_HEADERS + jchuff.h + jconfig.h + jdct.h + jdhuff.h + jerror.h + jinclude.h + jmemsys.h + jmorecfg.h + jpegint.h + jpeglib.h + jversion.h +) + +#EXTRA_DIST = \ +# jconfig.linux \ +# jconfig.vc + +ADD_LIBRARY(gdcmijpeg8 ${libgdcmijpeg8_la_SOURCES}) \ No newline at end of file diff --git a/src/jpeg/libijg12/CMakeLists.txt b/src/jpeg/libijg12/CMakeLists.txt new file mode 100644 index 00000000..257f08a3 --- /dev/null +++ b/src/jpeg/libijg12/CMakeLists.txt @@ -0,0 +1,75 @@ +#LTVERSION = 0:1:0 + +#lib_LTLIBRARIES = libgdcmijpeg12.la + +##CXXFLAGS = @CXXFLAGS@ + +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 +) + +#libgdcmijpeg12includedir = $(includedir) +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}) \ No newline at end of file diff --git a/src/jpeg/libijg8/CMakeLists.txt b/src/jpeg/libijg8/CMakeLists.txt new file mode 100644 index 00000000..d3f0727d --- /dev/null +++ b/src/jpeg/libijg8/CMakeLists.txt @@ -0,0 +1,76 @@ +#LTVERSION = 0:1:0 + +#lib_LTLIBRARIES = libgdcmijpeg8.la + +##CXXFLAGS = @CXXFLAGS@ + +SET(libgdcmijpeg8_la_SOURCES + 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 + 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 + jcomapi.c + jutils.c + jerror.c + jmemmgr.c + jmemnobs.c + rdrle.c +) + +#libgdcmijpeg8includedir = $(includedir) +SET(libgdcmijpeg8include_HEADERS + jchuff.h + jconfig.h + jdct.h + jdhuff.h + jerror.h + jinclude.h + jmemsys.h + jmorecfg.h + jpegint.h + jpeglib.h + jversion.h +) + +#EXTRA_DIST = \ +# jconfig.linux \ +# jconfig.vc + +ADD_LIBRARY(gdcmijpeg8 ${libgdcmijpeg8_la_SOURCES}) \ No newline at end of file diff --git a/vtk/CMakeLists.txt b/vtk/CMakeLists.txt new file mode 100644 index 00000000..e5e30ff7 --- /dev/null +++ b/vtk/CMakeLists.txt @@ -0,0 +1,38 @@ +#VTK GDCM subdir + +INCLUDE_DIRECTORIES( + ${GDCM_SOURCE_DIR}/src/ +) + +SET(VTKGDCM_LIB_SRCS + vtkGdcmReader.cxx +) + +ADD_LIBRARY(vtkgdcm ${VTKGDCM_LIB_SRCS}) +TARGET_LINK_LIBRARIES(vtkgdcm + gdcm + vtkCommon + vtkIO + vtkFiltering +) + +SET(vtkgdcmdemo_SOURCES + testvtkGdcmReader.cxx +# vtkGdcmReader.cxx +) +ADD_EXECUTABLE(vtkgdcmdemo ${vtkgdcmdemo_SOURCES}) +TARGET_LINK_LIBRARIES(vtkgdcmdemo + vtkgdcm + vtkGraphics + vtkRendering +) + +SET(vtkgdcmViewer_SOURCES + vtkgdcmViewer.cxx + #vtkGdcmReader.cxx +) +ADD_EXECUTABLE(vtkgdcmViewer ${vtkgdcmViewer_SOURCES}) +TARGET_LINK_LIBRARIES(vtkgdcmViewer + vtkgdcm + vtkRendering +) \ No newline at end of file