]> Creatis software - gdcm.git/commitdiff
ENH: Remove redundancie about GDCM_DICT stuff, now we only need to modify
authormalaterre <malaterre>
Mon, 26 Apr 2004 00:27:53 +0000 (00:27 +0000)
committermalaterre <malaterre>
Mon, 26 Apr 2004 00:27:53 +0000 (00:27 +0000)
       one file instead of seven + some small cleanup

17 files changed:
CMakeLists.txt
ChangeLog
Testing/CMakeLists.txt
Testing/TestBug.cxx
Testing/TestDicomDir.cxx
gdcmConfigure.h.in
src/CMakeLists.txt
src/gdcmCommon.h
src/gdcmDicomDirElement.cxx
src/gdcmDict.cxx
src/gdcmDictSet.cxx
src/gdcmDirList.cxx
src/gdcmHeaderEntry.cxx
src/gdcmParser.cxx
src/gdcmParser.h
src/gdcmTS.cxx
src/gdcmVR.cxx

index ddb8a40..c253b70 100644 (file)
@@ -63,6 +63,32 @@ FIND_PATH(GDCM_DATA_ROOT gdcm-ACR-LibIDO.acr
 # Deals with problem on SunOS:\r
 # ostrstream vs. ostringstream\r
 \r
+#-----------------------------------------------------------------------------\r
+# Why one should not use ADD_DEFINITIONS\r
+# http://www.cmake.org/pipermail/cmake/2003-September/004286.html\r
+\r
+#-----------------------------------------------------------------------------\r
+# __STDC_LIMIT_MACROS -> Refer to stdint.h\r
+# http://www.cmake.org/pipermail/cmake/2003-October/004369.html\r
+# http://www.cmake.org/pipermail/cmake/2003-October/004373.html\r
+\r
+#SET(GDCM_COMPILE_FLAGS  "-D__STDC_LIMIT_MACROS  -DPUB_DICT_PATH=\\\"${CMAKE_INSTALL_PREFIX}${GDCM_DATA_DIR}\\\""  )\r
+\r
+SET( GDCM_PUB_DICT_PATH "${CMAKE_INSTALL_PREFIX}${GDCM_DATA_DIR}")\r
+\r
+# SunOS + old gcc fixes:\r
+INCLUDE (${CMAKE_ROOT}/Modules/CMakeBackwardCompatibilityCXX.cmake)\r
+IF(CMAKE_NO_ANSI_STRING_STREAM)\r
+  SET(GDCM_NO_ANSI_STRING_STREAM 1)\r
+ENDIF(CMAKE_NO_ANSI_STRING_STREAM)\r
+\r
+INCLUDE (${CMAKE_ROOT}/Modules/CheckIncludeFile.cmake)\r
+CHECK_INCLUDE_FILE("stdint.h"    CMAKE_HAVE_STDINT_H)\r
+\r
+IF(NOT CMAKE_HAVE_STDINT_H)\r
+  SET(GDCM_HAVE_NO_STDINT_H 1)\r
+ENDIF(NOT CMAKE_HAVE_STDINT_H)\r
+\r
 #SET(GDCM_NO_ANSI_STRING_STREAM\r
 #  ${CMAKE_NO_ANSI_STRING_STREAM}\r
 #)\r
index d2c05ca..f019174 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,12 +1,12 @@
-2004-04-25  Mathieu Malaterre  <Mathieu.Malaterre@creatis.insa-lyon.fr>
-     * ENH: Adding a GDCM_DATA_ROOT for testing
-
 2004-04-25  Mathieu Malaterre  <Mathieu.Malaterre@creatis.insa-lyon.fr>
      * ENH: Adding automatic testing
        1. Need a DartConfig.cmake to submit to public
        2. Add a test driver gdcmTest.cxx
        3. gdcmTestMain, an helper for the main test driver gdcmTest
        4. Files in Test don't have a main anymore, this becomes intersting when we add more and more tests, thus dsw don't have to load too many projects
+     * ENH: Adding a GDCM_DATA_ROOT for testing
+     * ENH: Remove redundancie about GDCM_DICT stuff, now we only need to modify
+       one file instead of seven + some small cleanup
 
 2004-04-22  Jean-Pierre Roux
      * ENH Minor changes to the Print() methods
index f722013..feb6a09 100644 (file)
@@ -6,12 +6,12 @@ SET(CXX_TEST_PATH ${EXECUTABLE_OUTPUT_PATH})
 
 SET(GDCM_TESTS ${CXX_TEST_PATH}/gdcmTests)
 
-INCLUDE (${CMAKE_ROOT}/Modules/CheckIncludeFile.cmake)
-CHECK_INCLUDE_FILE("stdint.h"    CMAKE_HAVE_STDINT_H)
+#INCLUDE (${CMAKE_ROOT}/Modules/CheckIncludeFile.cmake)
+#CHECK_INCLUDE_FILE("stdint.h"    CMAKE_HAVE_STDINT_H)
 
-IF(NOT CMAKE_HAVE_STDINT_H)
-  SET(GDCM_TEST_COMPILE_FLAGS "-DHAVE_NO_STDINT_H")
-ENDIF(NOT CMAKE_HAVE_STDINT_H)
+#IF(NOT CMAKE_HAVE_STDINT_H)
+#  SET(GDCM_TEST_COMPILE_FLAGS "-DHAVE_NO_STDINT_H")
+#ENDIF(NOT CMAKE_HAVE_STDINT_H)
 
 
 SET(TEST_SOURCES
index 7126585..b71e660 100644 (file)
@@ -1,6 +1,5 @@
 // The following crashes on Win32
 #include "gdcm.h"
-#include "gdcmConfigure.h"
 
 int bug1(int argc, char* argv[])
 {  
index 4de300a..1cccb79 100644 (file)
@@ -2,7 +2,6 @@
 #include "gdcm.h"
 #include "gdcmHeaderEntry.h"
 #include "gdcmDicomDir.h"
-#include "gdcmConfigure.h"
 
 #include <fstream>
 #ifdef GDCM_NO_ANSI_STRING_STREAM
index ad1abfd..8d856d4 100644 (file)
@@ -1 +1,11 @@
+#define __STDC_LIMIT_MACROS
+
+#define PUB_DICT_PATH "@GDCM_PUB_DICT_PATH@"
+
 #define GDCM_DATA_ROOT "@GDCM_DATA_ROOT@"
+
+#cmakedefine GDCM_NO_ANSI_STRING_STREAM
+
+#cmakedefine HAVE_NO_STDINT_H 
+
+
index 6bd5a09..1ccabed 100644 (file)
@@ -7,6 +7,7 @@ INCLUDE_DIRECTORIES(
   ${GDCM_SOURCE_DIR}/src/jpeg/libijg8\r
   #${GDCM_SOURCE_DIR}/jpeg/libijg12 #all files have been renamed, appending 12\r
   #${GDCM_SOURCE_DIR}/jpeg/ljpg     # JPEG lib from xmedcom \r
+  ${GDCM_BINARY_DIR}/ #for gdcmConfigure.h\r
 )\r
 \r
 SET(libgdcm_la_SOURCES\r
@@ -39,45 +40,6 @@ SET(libgdcm_la_SOURCES
    gdcmUtil.cxx\r
    gdcmVR.cxx\r
 )\r
-#-----------------------------------------------------------------------------\r
-# Why one should not use ADD_DEFINITIONS\r
-# http://www.cmake.org/pipermail/cmake/2003-September/004286.html\r
-\r
-#-----------------------------------------------------------------------------\r
-# __STDC_LIMIT_MACROS -> Refer to stdint.h\r
-# http://www.cmake.org/pipermail/cmake/2003-October/004369.html\r
-# http://www.cmake.org/pipermail/cmake/2003-October/004373.html\r
-\r
-SET(GDCM_COMPILE_FLAGS\r
-  "-D__STDC_LIMIT_MACROS  -DPUB_DICT_PATH=\\\"${CMAKE_INSTALL_PREFIX}${GDCM_DATA_DIR}\\\""\r
-  )\r
-\r
-# SunOS + old gcc fixes:\r
-\r
-INCLUDE (${CMAKE_ROOT}/Modules/CMakeBackwardCompatibilityCXX.cmake)\r
-IF(CMAKE_NO_ANSI_STRING_STREAM)\r
-SET(GDCM_COMPILE_FLAGS\r
-  "${GDCM_COMPILE_FLAGS} -DGDCM_NO_ANSI_STRING_STREAM"\r
-  )\r
-ENDIF(CMAKE_NO_ANSI_STRING_STREAM)\r
-\r
-#INCLUDE (${CMAKE_ROOT}/Modules/CMakeBackwardCompatibilityC.cmake)\r
-#INCLUDE (${CMAKE_ROOT}/Modules/CheckTypeSize.cmake)\r
-\r
-INCLUDE (${CMAKE_ROOT}/Modules/CheckIncludeFile.cmake)\r
-CHECK_INCLUDE_FILE("stdint.h"    CMAKE_HAVE_STDINT_H)\r
-\r
-#MESSAGE(STATUS ${CMAKE_NO_ANSI_STRING_STREAM})\r
-IF(NOT CMAKE_HAVE_STDINT_H)\r
-SET(GDCM_COMPILE_FLAGS\r
-  "${GDCM_COMPILE_FLAGS} -DHAVE_NO_STDINT_H"\r
-  )\r
-ENDIF(NOT CMAKE_HAVE_STDINT_H)\r
-\r
-SET_SOURCE_FILES_PROPERTIES(${libgdcm_la_SOURCES}\r
-  PROPERTIES\r
-  COMPILE_FLAGS ${GDCM_COMPILE_FLAGS}\r
-)\r
 \r
 ADD_LIBRARY(gdcm ${libgdcm_la_SOURCES} )\r
 IF(UNIX)\r
index 173fba7..2b42c8c 100644 (file)
@@ -3,6 +3,8 @@
 #ifndef GDCMCOMMON_H
 #define GDCMCOMMON_H
 
+#include "gdcmConfigure.h"
+
 //-----------------------------------------------------------------------------
 //This is needed when compiling in debug mode
 #ifdef _MSC_VER
 //-----------------------------------------------------------------------------
 #ifdef __GNUC__
 #ifndef HAVE_NO_STDINT_H
+//#if defined __STDC_LIMIT_MACROS
+//#endif
 #include <stdint.h>
+//#ifdef UINT32_MAX
+//#error hehrehhehehehe2
+//#endif
 #define guint16 uint16_t
 #define guint32 uint32_t
 #define gint16  int16_t
@@ -58,6 +65,25 @@ typedef  int                 gint32;
 #define GDCM_EXPORT
 #endif
 
+// ifdef for old gcc / broken compiler
+#ifdef GDCM_NO_ANSI_STRING_STREAM
+#  include <strstream>
+#  define  ostringstream ostrstream
+# else
+#  include <sstream>
+#endif
+
+
+// Centralize information about the gdcm dictionary in only one file:
+#ifndef PUB_DICT_PATH
+#  define PUB_DICT_PATH     "../Dicts/"
+#endif
+#define PUB_DICT_NAME     "DicomV3Dict"
+#define PUB_DICT_FILENAME "dicomV3.dic"
+#define DICT_ELEM "DicomDir.dic"
+#define DICT_TS "dicomTS.dic"
+#define DICT_VR "dicomVR.dic"
+
 #include <string>
 
 const std::string GDCM_UNFOUND = "gdcm::Unfound";
@@ -73,8 +99,5 @@ enum FileType {
       ACR_LIBIDO
 };
 
-//For now gdcm is not willing cmake, try to be more quiet
-//#cmakedefine GDCM_NO_ANSI_STRING_STREAM
-
 //-----------------------------------------------------------------------------
 #endif
index e9558e9..f0f82ed 100644 (file)
@@ -3,22 +3,12 @@
 #include <fstream>
 #include <stdio.h>    // For sprintf
 #include <iostream>
-#ifdef GDCM_NO_ANSI_STRING_STREAM
-#  include <strstream>
-#  define  ostringstream ostrstream
-# else
-#  include <sstream>
-#endif
 
 #include "gdcmDicomDirElement.h"
 #include "gdcmUtil.h"
 #include "gdcmDebug.h"
 #include "gdcmDictSet.h"
 
-#ifndef PUB_DICT_PATH
-#  define PUB_DICT_PATH     "../Dicts/"
-#endif
-#define DICT_ELEM "DicomDir.dic"
 
 /**
  * \ingroup gdcmDicomDirElement
index fd3e990..7d9585c 100644 (file)
@@ -8,13 +8,6 @@
 #include <iostream>
 #include <iomanip>
 
-#ifdef GDCM_NO_ANSI_STRING_STREAM
-#  include <strstream>
-#  define  ostringstream ostrstream
-# else
-#  include <sstream>
-#endif
-
 //-----------------------------------------------------------------------------
 // Constructor / Destructor
 /**
index e2c12ef..0a407bb 100644 (file)
@@ -5,12 +5,6 @@
 #include <fstream>
 #include <stdlib.h>  // For getenv
 
-#define PUB_DICT_NAME     "DicomV3Dict"
-#ifndef PUB_DICT_PATH
-#  define PUB_DICT_PATH     "../Dicts/"
-#endif
-#define PUB_DICT_FILENAME "dicomV3.dic"
-
 //-----------------------------------------------------------------------------
 // Constructor / Destructor
 /** 
index f49c0ba..265f4b4 100644 (file)
@@ -6,13 +6,6 @@
 #include <iostream>
 #include <algorithm>
 
-#ifdef GDCM_NO_ANSI_STRING_STREAM
-   #include <strstream>
-   #define  ostringstream ostrstream
-#else
-   #include <sstream>
-#endif
-
 #ifdef _MSC_VER 
    #include <windows.h> 
    #include <direct.h>
index fef886c..b445b62 100644 (file)
@@ -6,12 +6,6 @@
 #include "gdcmGlobal.h"
 #include "gdcmUtil.h"
 
-#ifdef GDCM_NO_ANSI_STRING_STREAM
-#  include <strstream>
-#  define  ostringstream ostrstream
-# else
-#  include <sstream>
-#endif
 #include <iomanip> // for std::ios::left, ...
 
 
index 14ed156..327a375 100644 (file)
@@ -1,5 +1,10 @@
 // gdcmParser.cxx
 //-----------------------------------------------------------------------------
+#include "gdcmParser.h"
+#include "gdcmGlobal.h"
+#include "gdcmUtil.h"
+#include "gdcmDebug.h"
+
 #include <errno.h>
 #include <vector>
 
    #include <netinet/in.h>
 #endif
 
-#ifdef GDCM_NO_ANSI_STRING_STREAM
-#  include <strstream>
-#  define  ostringstream ostrstream
-# else
-#  include <sstream>
-#endif
 #  include <iomanip>
 
-#include "gdcmParser.h"
-#include "gdcmGlobal.h"
-#include "gdcmUtil.h"
-#include "gdcmDebug.h"
-
 #define UI1_2_840_10008_1_2      "1.2.840.10008.1.2"
 #define UI1_2_840_10008_1_2_1    "1.2.840.10008.1.2.1"
 #define UI1_2_840_10008_1_2_2    "1.2.840.10008.1.2.2"
index 239ff64..1b07a17 100644 (file)
@@ -4,6 +4,7 @@
 #define GDCMPARSER_H
 
 #include "gdcmCommon.h"
+
 #include "gdcmVR.h"
 #include "gdcmTS.h"
 #include "gdcmException.h"
@@ -13,6 +14,8 @@
 #include <map>
 #include <list>
 
+
+
 //-----------------------------------------------------------------------------
 typedef std::string VRKey;
 typedef std::string VRAtr;
index 8946c61..0712d1d 100644 (file)
@@ -3,22 +3,12 @@
 #include <fstream>
 #include <string>
 #include <iostream>
-#ifdef GDCM_NO_ANSI_STRING_STREAM
-#  include <strstream>
-#  define  ostringstream ostrstream
-# else
-#  include <sstream>
-#endif
 
 #include "gdcmTS.h"
 #include "gdcmDebug.h"
 #include "gdcmUtil.h"
 #include "gdcmDictSet.h"
 
-#ifndef PUB_DICT_PATH
-#  define PUB_DICT_PATH     "../Dicts/"
-#endif
-#define DICT_TS "dicomTS.dic"
 
 
 //-----------------------------------------------------------------------------
index 536aea3..9a70916 100644 (file)
@@ -3,23 +3,12 @@
 #include <fstream>
 
 #include <iostream>
-#ifdef GDCM_NO_ANSI_STRING_STREAM
-#  include <strstream>
-#  define  ostringstream ostrstream
-# else
-#  include <sstream>
-#endif
 
 #include "gdcmVR.h"
 #include "gdcmUtil.h"
 #include "gdcmDictSet.h"
 #include "gdcmDebug.h"
 
-#ifndef PUB_DICT_PATH
-#  define PUB_DICT_PATH     "../Dicts/"
-#endif
-#define DICT_VR "dicomVR.dic"
-
 //-----------------------------------------------------------------------------
 /**
  * \brief Constructor