]> Creatis software - gdcm.git/commitdiff
*FIX: Some compilation problem on SunOS with no ANSI STRING STREAM
authormalaterre <malaterre>
Thu, 13 Nov 2003 18:49:07 +0000 (18:49 +0000)
committermalaterre <malaterre>
Thu, 13 Nov 2003 18:49:07 +0000 (18:49 +0000)
*ENH: Some more python installation stuff fixed

CMakeLists.txt
gdcmPython/CMakeLists.txt
gdcmPython/setup.py.in
src/CMakeLists.txt
src/gdcmCommon.h
src/gdcmHeader.cxx

index 24314973602fc5a90043e2228ccd95da0740bd23..afd1704532377114b0b38992efc4f4b79345108a 100644 (file)
@@ -26,6 +26,15 @@ SET(CMAKE_CONFIGURATION_TYPES
 )\r
 SET(CMAKE_BUILD_TYPE_INIT Debug)\r
 \r
+# Deals with problem on SunOS:\r
+# ostrstream vs. ostringstream\r
+\r
+#SET(GDCM_NO_ANSI_STRING_STREAM\r
+#  ${CMAKE_NO_ANSI_STRING_STREAM}\r
+#)\r
+#CONFIGURE_FILE(${GDCM_SOURCE_DIR}/src/gdcmCommon.h.in\r
+#               ${GDCM_BINARY_DIR}/src/gdcmCommon.h @ONLY IMMEDIATE)\r
+\r
 #-----------------------------------------------------------------------------\r
 # Output directories.\r
 #Put all stuff in one single dir for Win32, otherwise dll are a pain:\r
index 999d02094faf09fbac0dc49519c8f51960d09221..2d1ffc28d47f16913a4c9f9f143867a712d2187e 100644 (file)
@@ -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)
index 3a8d31c8c304cc15cc0c7073b8646904b07aa675..fe7a51d356060cfde71bca6d83d5a01946a54f4a 100644 (file)
@@ -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)
index 0f673d1e6bbfc9c7a4f54f5b49235324509091b1..7e0c778c3e255d0c0104c0a92975b7cb0dd520b4 100644 (file)
@@ -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}\\\""\r
 )\r
 \r
+IF(${CMAKE_NO_ANSI_STRING_STREAM})\r
+SET_SOURCE_FILES_PROPERTIES(gdcmHeader.cxx\r
+  PROPERTIES\r
+  COMPILE_FLAGS "-DGDCM_NO_ANSI_STRING_STREAM"\r
+)\r
+ENDIF(${CMAKE_NO_ANSI_STRING_STREAM})\r
+\r
 ADD_LIBRARY(gdcm ${libgdcm_la_SOURCES} )\r
-#TODO this is not working out of the box (on the first time)\r
 IF(UNIX)\r
   TARGET_LINK_LIBRARIES(gdcm \r
     gdcmijpeg8 \r
@@ -67,4 +73,3 @@ ENDIF(UNIX)
 INSTALL_FILES(/include "\\.h$")\r
 \r
 INSTALL_TARGETS(/lib/ gdcm)\r
-#INSTALL_FILES(/include/vtk .h ${Kit_SRCS})\r
index 326c44ad204fb86fd98c7ed3d53630fd4f3f2f44..a74d6d84da462ee9f08d8ef06f74cd94a5a40db6 100644 (file)
@@ -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
index e9ae38fc4c71c315e2f68879429bb3a6fc330da7..aa54cba0fb1a0096d7411bee8d4d9186de7c898a 100644 (file)
@@ -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"
 
 #include <netinet/in.h>
 #endif
 #include <cctype>    // for isalpha
-#include <sstream>
+
+#ifdef GDCM_NO_ANSI_STRING_STREAM
+#  include <strstream>
+#  define  ostringstream ostrstream
+# else
+#  include <sstream>
+#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;  
    }