]> 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 ddb8a4001e02ddfb7a47a7a4c97534d72cdd341a..c253b70140298854fca6c2918621359f17298de4 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 d2c05cab593b1be0df176525b76e9be59d1d7e84..f0191743be55a3b150babb421c0eb2575b89614c 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 f722013e4396f85c1fda339afac168b7e6db00a1..feb6a09012359f1ca0d2a447868abbdc3b186a5d 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 7126585c3b024fdd77285cc4a8c6369664c280fb..b71e660e6d2f6d19b592dcb08a29defe94460e6f 100644 (file)
@@ -1,6 +1,5 @@
 // The following crashes on Win32
 #include "gdcm.h"
-#include "gdcmConfigure.h"
 
 int bug1(int argc, char* argv[])
 {  
index 4de300aa36b426b777dd8d4ff08d144f1fc13393..1cccb798bd5a265cf6f6685c54c9eb1b4a29f2c7 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 ad1abfd06795214f6339fa4bbe0b0f4555df1be7..8d856d4bf0d48da9506d62ee0429048b1480bc1c 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 6bd5a093990c7cda4e4c4e431cddbdbc2c8bc4ed..1ccabed4e0e8f5cafb2e7195e92627f64cd58857 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 173fba77914867722a5dfe28a327aa18c2aad314..2b42c8cde613eb9e527d62b478a03e7da1b6e805 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 e9558e9b0d6447f4760f2c275f086fdb8647c5e9..f0f82ed195fe3a2e061f6142ee1c146d7db4b331 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 fd3e990c26905caa7c4f9895ae717e90d74ffc8e..7d9585cdc1ff65d78682e514fc8b91a5c5077eac 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 e2c12ef4b49de9313bd827dd7f9b00b592547cc8..0a407bb4657f54311efd467b63a3f0e6660a7ead 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 f49c0ba92c0168caa0fa2b42137ca15558fefaf3..265f4b4f68891f11558f3b816b32fe85e3e4c294 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 fef886cbf9eb9ce432c3ce17a1be11d991ddc9d0..b445b624d4a6f70fcf3cedf2215c9bfb43a43833 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 14ed156457d5256f06fcea4ea2f676ffae9d13d4..327a37534531f3e366e43edf50576f340a8bfcd8 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 239ff64417a71a74c1bae9b931f660730ae99d42..1b07a17492891fb5c3ecf6cc9ae0505ebbe7a0ff 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 8946c61a9a95d6b47bbc2fc88ffc3f3bfabc68dc..0712d1db9705799b46dfdb7d8e15d63227a8f64d 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 536aea3695acd93c8094f62f478bc1e74642b408..9a7091686fa497306cc87d39d2643d6e5f22e3cc 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