From: malaterre Date: Thu, 13 Nov 2003 18:49:07 +0000 (+0000) Subject: *FIX: Some compilation problem on SunOS with no ANSI STRING STREAM X-Git-Tag: Version0.3.1~32 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=adc8d5da8f5fd92da1cd74d2f6b2efaac14d8889;p=gdcm.git *FIX: Some compilation problem on SunOS with no ANSI STRING STREAM *ENH: Some more python installation stuff fixed --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 24314973..afd17045 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -26,6 +26,15 @@ SET(CMAKE_CONFIGURATION_TYPES ) SET(CMAKE_BUILD_TYPE_INIT Debug) +# Deals with problem on SunOS: +# ostrstream vs. ostringstream + +#SET(GDCM_NO_ANSI_STRING_STREAM +# ${CMAKE_NO_ANSI_STRING_STREAM} +#) +#CONFIGURE_FILE(${GDCM_SOURCE_DIR}/src/gdcmCommon.h.in +# ${GDCM_BINARY_DIR}/src/gdcmCommon.h @ONLY IMMEDIATE) + #----------------------------------------------------------------------------- # Output directories. #Put all stuff in one single dir for Win32, otherwise dll are a pain: diff --git a/gdcmPython/CMakeLists.txt b/gdcmPython/CMakeLists.txt index 999d0209..2d1ffc28 100644 --- a/gdcmPython/CMakeLists.txt +++ b/gdcmPython/CMakeLists.txt @@ -47,6 +47,7 @@ ADD_CUSTOM_COMMAND( ${GDCM_SOURCE_DIR}/gdcmPython/gdcm.i TARGET pygdcm OUTPUTS ${GDCM_BINARY_DIR}/gdcmPython/gdcm_wrap.cxx + COMMENT "Generating gdcm_wrap.cxx based on gdcm.i" ) IF(GDCM_VTK) @@ -75,9 +76,12 @@ IF(GDCM_VTK) #generate a setup.py according to VTK installation #put it in subdir in order to not override old one + # as it is a pain...override existing file... + + GET_FILENAME_COMPONENT(VTKPATH ${VTK_DIR}/../../ ABSOLUTE) CONFIGURE_FILE( ${GDCM_SOURCE_DIR}/gdcmPython/setup.py.in - ${GDCM_BINARY_DIR}/gdcmPython/setup.py + ${GDCM_SOURCE_DIR}/setup.py ) ENDIF(GDCM_VTK) diff --git a/gdcmPython/setup.py.in b/gdcmPython/setup.py.in index 3a8d31c8..fe7a51d3 100644 --- a/gdcmPython/setup.py.in +++ b/gdcmPython/setup.py.in @@ -21,7 +21,7 @@ if(os.name=='posix'): libraries=["stdc++"] macros =[('__STDC_LIMIT_MACROS', '1')] - VTKPATH="${VTK_DIR}" + VTKPATH="${VTKPATH}" vtkWrapper="vtkWrapPython" else: targetDir=os.path.join('lib','site-packages') @@ -34,7 +34,7 @@ else: err=str(e) print "Environment variable",err[err.rfind(':')+1:],'not defined, '\ 'please fix it!' - VTKPATH="${VTK_DIR}" + VTKPATH="${VTKPATH}" vtkWrapper=os.path.join(VTKPATH,"bin","vtkWrapPython") targetDir=os.path.join(targetDir, ThisModule) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 0f673d1e..7e0c778c 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -43,8 +43,14 @@ SET_SOURCE_FILES_PROPERTIES(${libgdcm_la_SOURCES} COMPILE_FLAGS "-D__STDC_LIMIT_MACROS -DPUB_DICT_PATH=\\\"${CMAKE_INSTALL_PREFIX}${GDCM_DATA_DIR}\\\"" ) +IF(${CMAKE_NO_ANSI_STRING_STREAM}) +SET_SOURCE_FILES_PROPERTIES(gdcmHeader.cxx + PROPERTIES + COMPILE_FLAGS "-DGDCM_NO_ANSI_STRING_STREAM" +) +ENDIF(${CMAKE_NO_ANSI_STRING_STREAM}) + ADD_LIBRARY(gdcm ${libgdcm_la_SOURCES} ) -#TODO this is not working out of the box (on the first time) IF(UNIX) TARGET_LINK_LIBRARIES(gdcm gdcmijpeg8 @@ -67,4 +73,3 @@ ENDIF(UNIX) INSTALL_FILES(/include "\\.h$") INSTALL_TARGETS(/lib/ gdcm) -#INSTALL_FILES(/include/vtk .h ${Kit_SRCS}) diff --git a/src/gdcmCommon.h b/src/gdcmCommon.h index 326c44ad..a74d6d84 100644 --- a/src/gdcmCommon.h +++ b/src/gdcmCommon.h @@ -60,5 +60,8 @@ enum FileType { ACR_LIBIDO }; +//For now gdcm is not willing cmake, try to be more quiet +//#cmakedefine GDCM_NO_ANSI_STRING_STREAM + #endif diff --git a/src/gdcmHeader.cxx b/src/gdcmHeader.cxx index e9ae38fc..aa54cba0 100644 --- a/src/gdcmHeader.cxx +++ b/src/gdcmHeader.cxx @@ -1,4 +1,4 @@ -// $Header: /cvs/public/gdcm/src/Attic/gdcmHeader.cxx,v 1.117 2003/11/13 18:08:34 jpr Exp $ +// $Header: /cvs/public/gdcm/src/Attic/gdcmHeader.cxx,v 1.118 2003/11/13 18:49:08 malaterre Exp $ #include "gdcmHeader.h" @@ -11,7 +11,14 @@ #include #endif #include // for isalpha -#include + +#ifdef GDCM_NO_ANSI_STRING_STREAM +# include +# define ostringstream ostrstream +# else +# include +#endif + #include "gdcmUtil.h" #include "gdcmTS.h" @@ -1011,8 +1018,8 @@ void gdcmHeader::LoadElementValue(gdcmElValue * ElVal) { s << NewInt; } } - } - s << '\0'; // to avoid oddities on Solaris + } + s << std::ends; // to avoid oddities on Solaris ElVal->SetValue(s.str()); return; }