]> Creatis software - gdcm.git/commitdiff
ENH: First shot at the UseGDCM file. Very usefull indeed
authormalaterre <malaterre>
Mon, 28 Feb 2005 16:34:55 +0000 (16:34 +0000)
committermalaterre <malaterre>
Mon, 28 Feb 2005 16:34:55 +0000 (16:34 +0000)
CMakeLists.txt
GDCMConfig.cmake.in [new file with mode: 0644]
src/gdcmFileHelper.cxx

index aceb0c453ea9b88e7affdc70af814d9e505ddfbf..edde32467566078ff9afe5b49ae8fec94c1b8ab3 100644 (file)
@@ -27,6 +27,29 @@ SET (EXECUTABLE_OUTPUT_PATH ${GDCM_BINARY_DIR}/bin CACHE PATH "Single output dir
 SET (LIBRARY_OUTPUT_PATH ${GDCM_BINARY_DIR}/bin CACHE PATH "Single output directory for building all libraries.")
 MARK_AS_ADVANCED(LIBRARY_OUTPUT_PATH EXECUTABLE_OUTPUT_PATH)
 
+#-----------------------------------------------------------------------------
+# Help outside projects link against gdcm
+
+EXPORT_LIBRARY_DEPENDENCIES(${GDCM_BINARY_DIR}/GDCMLibraryDepends.cmake)
+
+# For GDCM from build tree:
+SET(GDCM_USE_FILE ${GDCM_SOURCE_DIR}/GDCMUse.cmake)
+SET(GDCM_INCLUDE_DIRS
+  ${GDCM_BINARY_DIR}/src
+  )
+SET(GDCM_LIBRARY_DIRS ${LIBRARY_OUTPUT_PATH})
+SET(GDCM_LIBRARY_DEPENDS_FILE ${GDCM_BINARY_DIR}/GDCMLibraryDepends.cmake)
+CONFIGURE_FILE(${GDCM_SOURCE_DIR}/GDCMConfig.cmake.in
+               ${GDCM_BINARY_DIR}/GDCMConfig.cmake @ONLY IMMEDIATE)
+
+# For installed GDCM:
+SET(GDCM_USE_FILE ${CMAKE_INSTALL_PREFIX}/lib/GDCM-${GDCM_VERSION}/GDCMUse.cmake)
+SET(GDCM_INCLUDE_DIRS ${CMAKE_INSTALL_PREFIX}/include/GDCM-${GDCM_VERSION})
+SET(GDCM_LIBRARY_DIRS ${CMAKE_INSTALL_PREFIX}/lib/ExodusII-${GDCM_VERSION})
+SET(GDCM_LIBRARY_DEPENDS_FILE ${CMAKE_INSTALL_PREFIX}/lib/GDCM-${GDCM_VERSION}/GDCMLibraryDepends.cmake)
+CONFIGURE_FILE(${GDCM_SOURCE_DIR}/GDCMConfig.cmake.in
+               ${GDCM_BINARY_DIR}/Utilities/GDCMConfig.cmake @ONLY IMMEDIATE)
+
 #-----------------------------------------------------------------------------
 # Test if compiler defines the pseudo-macro __FUNCTION__
 IF("GDCM_COMPILER_HAS_FUNCTION" MATCHES "^GDCM_COMPILER_HAS_FUNCTION$")
diff --git a/GDCMConfig.cmake.in b/GDCMConfig.cmake.in
new file mode 100644 (file)
index 0000000..5f74344
--- /dev/null
@@ -0,0 +1,14 @@
+SET(GDCM_VERSION_MAJOR "@GDCM_VERSION_MAJOR@")
+SET(GDCM_VERSION_MINOR "@GDCM_VERSION_MINOR@")
+SET(GDCM_VERSION_PATCH "@GDCM_VERSION_PATCH@")
+
+SET(GDCM_BUILD_SHARED_LIBS "@GDCM_BUILD_SHARED_LIBS@")
+SET(GDCM_USE_FILE "@GDCM_USE_FILE@")
+
+SET(GDCM_INCLUDE_DIRS "@GDCM_INCLUDE_DIRS@")
+SET(GDCM_LIBRARY_DIRS "@GDCM_LIBRARY_DIRS@")
+
+# The GDCM library dependencies.
+IF(NOT GDCM_NO_LIBRARY_DEPENDS)
+  INCLUDE("@GDCM_LIBRARY_DEPENDS_FILE@")
+ENDIF(NOT GDCM_NO_LIBRARY_DEPENDS)
index 1e31cd1ca71d20b5058799defa0924a162bc8127..f3f8636623375a410f74f91f5cc93ba21b4f5dbe 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmFileHelper.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/02/23 09:54:59 $
-  Version:   $Revision: 1.20 $
+  Date:      $Date: 2005/02/28 16:34:55 $
+  Version:   $Revision: 1.21 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -448,7 +448,7 @@ uint8_t* FileHelper::GetLutRGBA()
  */
 bool FileHelper::WriteRawData(std::string const &fileName)
 {
-  std::ofstream fp1(fileName.c_str(), std::ios::out | std::ios::binary );
+   std::ofstream fp1(fileName.c_str(), std::ios::out | std::ios::binary );
    if (!fp1)
    {
       gdcmWarningMacro( "Fail to open (write) file:" << fileName.c_str());