From 45490622810d0706cb4ec538634c4a886f39737b Mon Sep 17 00:00:00 2001 From: regrain Date: Tue, 9 Nov 2004 11:21:31 +0000 Subject: [PATCH] * Bugs fix for the Windows build with VC6 * CMakeLists.txt : bug fix - The include of the VTK lib is made only when it's needed (only for projects required VTK). If the VTK is included in all projects, there is conflicts with the jpeg lib of vtk when compiling the gdcmjpeg[8,12,16] projects. The first conflict is on the jmorecfg.h file. * src/gdcmUtil.h : export binary_write methods. Otherwise, there's problems when compiling the gdcm_wrap.cxx file (created by the compilation of the gdcm.i file) * vtk/vtkGdcmDemo.cxx : remove the use of std namespace for the cerr use (like it's already made for the cout use). Otherwise, conflict with the std::cerr of vtk. -- BeNours --- CMakeLists.txt | 2 +- ChangeLog | 13 +++++ Testing/CMakeLists.txt | 5 +- gdcmPython/CMakeLists.txt | 3 ++ src/gdcmUtil.h | 16 +++--- vtk/CMakeLists.txt | 102 ++++++++++++++++++++------------------ vtk/vtkGdcmDemo.cxx | 4 +- 7 files changed, 84 insertions(+), 61 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7438ca39..7d4de892 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -88,7 +88,7 @@ IF(GDCM_VTK) FIND_PACKAGE(VTK) # If vtk found IF(VTK_FOUND) - INCLUDE(${VTK_USE_FILE}) + #INCLUDE(${VTK_USE_FILE}) SUBDIRS(vtk) ENDIF(VTK_FOUND) ENDIF(GDCM_VTK) diff --git a/ChangeLog b/ChangeLog index 0dbb37d0..db27f533 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2004-11-09 Benoit Regrain + * Bugs fix for the Windows build with VC6 + * CMakeLists.txt : bug fix - The include of the VTK lib is made only when it's + needed (only for projects required VTK). If the VTK is included in all + projects, there is conflicts with the jpeg lib of vtk when compiling the + gdcmjpeg[8,12,16] projects. The first conflict is on the jmorecfg.h file. + * src/gdcmUtil.h : export binary_write methods. Otherwise, there's problems + when compiling the gdcm_wrap.cxx file (created by the compilation of the + gdcm.i file) + * vtk/vtkGdcmDemo.cxx : remove the use of std namespace for the cerr use + (like it's already made for the cout use). Otherwise, conflict with the + std::cerr of vtk. + 2004-11-09 Eric Boix * src/gdcmDicomDit.h the Method typedef is now local to DicomDir class. * gdcmPython/gdcm.i: diff --git a/Testing/CMakeLists.txt b/Testing/CMakeLists.txt index 76814532..37e5ccd9 100644 --- a/Testing/CMakeLists.txt +++ b/Testing/CMakeLists.txt @@ -31,11 +31,14 @@ IF (GDCM_DATA_ROOT) ) # add test that require VTK: IF(GDCM_VTK) + # Include the VTK library + INCLUDE(${VTK_USE_FILE}) + INCLUDE_DIRECTORIES( ${GDCM_SOURCE_DIR}/vtk/ ) SET(TEST_SOURCES ${TEST_SOURCES} - ShowDicom.cxx + ShowDicom.cxx ) ENDIF(GDCM_VTK) ENDIF (GDCM_DATA_ROOT) diff --git a/gdcmPython/CMakeLists.txt b/gdcmPython/CMakeLists.txt index c1cb3caf..9622d80e 100644 --- a/gdcmPython/CMakeLists.txt +++ b/gdcmPython/CMakeLists.txt @@ -152,6 +152,9 @@ ENDIF(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 1.9) # VTK Wrapping # IF(GDCM_VTK) + # Include the VTK library + INCLUDE(${VTK_USE_FILE}) + INCLUDE_DIRECTORIES( ${GDCM_SOURCE_DIR}/vtk ) diff --git a/src/gdcmUtil.h b/src/gdcmUtil.h index a32b5f2c..110a7fad 100644 --- a/src/gdcmUtil.h +++ b/src/gdcmUtil.h @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmUtil.h,v $ Language: C++ - Date: $Date: 2004/11/05 20:23:14 $ - Version: $Revision: 1.40 $ + Date: $Date: 2004/11/09 11:21:32 $ + Version: $Revision: 1.41 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -53,12 +53,12 @@ public: static std::string DicomString(const char* s); }; - template - std::ostream& binary_write(std::ostream& os, const T& val); - std::ostream& binary_write(std::ostream& os, const uint16_t& val); - std::ostream& binary_write(std::ostream& os, const uint32_t& val); - std::ostream& binary_write(std::ostream& os, const char* val); - std::ostream& binary_write(std::ostream& os, std::string const & val); + template + GDCM_EXPORT std::ostream& binary_write(std::ostream& os, const T& val); + GDCM_EXPORT std::ostream& binary_write(std::ostream& os, const uint16_t& val); + GDCM_EXPORT std::ostream& binary_write(std::ostream& os, const uint32_t& val); + GDCM_EXPORT std::ostream& binary_write(std::ostream& os, const char* val); + GDCM_EXPORT std::ostream& binary_write(std::ostream& os, std::string const & val); } // end namespace gdcm //----------------------------------------------------------------------------- #endif diff --git a/vtk/CMakeLists.txt b/vtk/CMakeLists.txt index 6b2fa6b5..a7f2b73d 100644 --- a/vtk/CMakeLists.txt +++ b/vtk/CMakeLists.txt @@ -1,49 +1,53 @@ -#----------------------------------------------------------------------------- -# VTK GDCM Reader subdir - -#----------------------------------------------------------------------------- -# Need gdcm header files -INCLUDE_DIRECTORIES( - ${GDCM_SOURCE_DIR}/src/ - ${GDCM_BINARY_DIR}/ -) - -SET(VTKGDCM_LIB_SRCS - vtkGdcmReader.cxx -) - -#----------------------------------------------------------------------------- -# Create vtkgdcm library -ADD_LIBRARY(vtkgdcm ${VTKGDCM_LIB_SRCS}) -TARGET_LINK_LIBRARIES(vtkgdcm - gdcm - vtkCommon - vtkIO - vtkFiltering -) - -#----------------------------------------------------------------------------- -SET(vtkgdcmdemo_SOURCES - vtkGdcmDemo.cxx -) -ADD_EXECUTABLE(vtkgdcmdemo ${vtkgdcmdemo_SOURCES}) -TARGET_LINK_LIBRARIES(vtkgdcmdemo - vtkgdcm - vtkGraphics - vtkRendering -) - -#----------------------------------------------------------------------------- -SET(vtkgdcmViewer_SOURCES - vtkgdcmViewer.cxx -) -ADD_EXECUTABLE(vtkgdcmViewer ${vtkgdcmViewer_SOURCES}) -TARGET_LINK_LIBRARIES(vtkgdcmViewer - vtkgdcm - vtkRendering -) - -# Install vtk header -INSTALL_FILES(/include FILES vtkGdcmReader.h) - -INSTALL_TARGETS(/lib/ vtkgdcm) +#----------------------------------------------------------------------------- +# VTK GDCM Reader subdir + +#----------------------------------------------------------------------------- +# Include the VTK library +INCLUDE(${VTK_USE_FILE}) + +# Need gdcm header files +INCLUDE_DIRECTORIES( + ${GDCM_SOURCE_DIR}/src/ + ${GDCM_BINARY_DIR}/ +) + +SET(VTKGDCM_LIB_SRCS + vtkGdcmReader.cxx +) + +#----------------------------------------------------------------------------- +# Create vtkgdcm library +ADD_LIBRARY(vtkgdcm ${VTKGDCM_LIB_SRCS}) +TARGET_LINK_LIBRARIES(vtkgdcm + gdcm + vtkCommon + vtkIO + vtkFiltering +) + +#----------------------------------------------------------------------------- +SET(vtkgdcmdemo_SOURCES + vtkGdcmDemo.cxx +) +ADD_EXECUTABLE(vtkgdcmdemo ${vtkgdcmdemo_SOURCES}) +TARGET_LINK_LIBRARIES(vtkgdcmdemo + vtkgdcm + vtkGraphics + vtkRendering +) + +#----------------------------------------------------------------------------- +SET(vtkgdcmViewer_SOURCES + vtkgdcmViewer.cxx +) +ADD_EXECUTABLE(vtkgdcmViewer ${vtkgdcmViewer_SOURCES}) +TARGET_LINK_LIBRARIES(vtkgdcmViewer + vtkgdcm + vtkRendering +) + +# Install vtk header +INSTALL_FILES(/include FILES vtkGdcmReader.h) + +INSTALL_TARGETS(/lib/ vtkgdcm) + diff --git a/vtk/vtkGdcmDemo.cxx b/vtk/vtkGdcmDemo.cxx index d94763cb..3dff229e 100644 --- a/vtk/vtkGdcmDemo.cxx +++ b/vtk/vtkGdcmDemo.cxx @@ -1,4 +1,4 @@ -// $Header: /cvs/public/gdcm/vtk/vtkGdcmDemo.cxx,v 1.1 2004/10/01 12:40:58 frog Exp $ +// $Header: /cvs/public/gdcm/vtk/vtkGdcmDemo.cxx,v 1.2 2004/11/09 11:21:33 regrain Exp $ //---------------------------------------------------------------------------- // A simple straightfoward example of vtkGdcmReader vtk class usage. @@ -43,7 +43,7 @@ int main( int argc, char *argv[] ) if (argc < 2) { - std::cerr << "Usage: " << argv[0] << " image.dcm\n"; + cerr << "Usage: " << argv[0] << " image.dcm\n"; return 0; } -- 2.45.1