# 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
-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
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
// The following crashes on Win32
#include "gdcm.h"
-#include "gdcmConfigure.h"
int bug1(int argc, char* argv[])
{
#include "gdcm.h"
#include "gdcmHeaderEntry.h"
#include "gdcmDicomDir.h"
-#include "gdcmConfigure.h"
#include <fstream>
#ifdef GDCM_NO_ANSI_STRING_STREAM
+#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
+
+
${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
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
#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
#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";
ACR_LIBIDO
};
-//For now gdcm is not willing cmake, try to be more quiet
-//#cmakedefine GDCM_NO_ANSI_STRING_STREAM
-
//-----------------------------------------------------------------------------
#endif
#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
#include <iostream>
#include <iomanip>
-#ifdef GDCM_NO_ANSI_STRING_STREAM
-# include <strstream>
-# define ostringstream ostrstream
-# else
-# include <sstream>
-#endif
-
//-----------------------------------------------------------------------------
// Constructor / Destructor
/**
#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
/**
#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>
#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, ...
// 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"
#define GDCMPARSER_H
#include "gdcmCommon.h"
+
#include "gdcmVR.h"
#include "gdcmTS.h"
#include "gdcmException.h"
#include <map>
#include <list>
+
+
//-----------------------------------------------------------------------------
typedef std::string VRKey;
typedef std::string VRAtr;
#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"
//-----------------------------------------------------------------------------
#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