Procházet zdrojové kódy

Let MSVC find HDF4 library

Moritz Wanzenböck před 6 roky
rodič
revize
4af5bed50a

+ 7 - 1
CMakeLists.txt

@@ -36,12 +36,18 @@ add_library(hdf4cpp
         lib/HdfAttribute.cpp
         lib/HdfException.cpp
         include/hdf4cpp/HdfObject.h
+		include/hdf4cpp/HdfAttribute.h
+		include/hdf4cpp/HdfAttribute_priv.h
+		include/hdf4cpp/HdfException.h
+		include/hdf4cpp/HdfFile.h
+		include/hdf4cpp/HdfItem.h
+		include/hdf4cpp/HdfDefines.h
         )
 
 target_include_directories(hdf4cpp
         PUBLIC
         include/
-        ${HDF4_INCLUDE_DIRS}
+        ${HDF4_INCLUDE_DIR}
         )
 
 target_link_libraries(hdf4cpp

+ 0 - 35
cmake/FindHDF4.cmake

@@ -1,35 +0,0 @@
-# - Find the HDF4 library together with dependencies...
-# This module defines the following variables:
-#  HDF4_INCLUDE_DIRS - include directories for HDF4
-#  HDF4_LIBRARIES - libraries to link against HDF4
-#  HDF4_FOUND - true if HDF4 has been found and can be used
-
-find_path(HDF4_INCLUDE_DIR hdf.h PATH_SUFFIXES hdf)
-find_library(MFHDF_LIB NAMES mfhdf mfhdfalt)
-find_library(DF_LIB NAMES df dfalt)
-
-# dependencies for the static library version of hdf4
-find_package(JPEG)
-find_package(ZLIB)
-
-set(HDF4_INCLUDE_DIRS ${HDF4_INCLUDE_DIR})
-set(HDF4_LIBRARIES
-  ${MFHDF_LIB}
-  ${DF_LIB}
-  ${JPEG_LIBRARIES}
-  ${ZLIB_LIBRARIES}
-  )
-
-include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(HDF4
-	FOUND_VAR HDF4_FOUND
-	REQUIRED_VARS MFHDF_LIB DF_LIB HDF4_INCLUDE_DIR JPEG_LIBRARIES ZLIB_LIBRARIES) 
-
-if(HDF4_FOUND)
-	message(-- " HDF4 include path: ${HDF4_INCLUDE_DIRS}")
-	message(-- " HDF4 libs:  ${HDF4_LIBRARIES}")
-else()
-	message(WARNING "HDF4 not found")	
-endif()
-
-mark_as_advanced(HDF4_INCLUDE_DIR MFHDF_LIB DF_LIB)

+ 2 - 2
include/hdf4cpp/HdfAttribute.h

@@ -4,7 +4,7 @@
 #ifndef HDF4CPP_HDFATTRIBUTE_H
 #define HDF4CPP_HDFATTRIBUTE_H
 
-#include <hdf/hdfi.h>
+#include <hdfi.h>
 #include <hdf4cpp/HdfItem.h>
 #include <hdf4cpp/HdfObject.h>
 
@@ -128,4 +128,4 @@ class HdfAttribute : public HdfObject {
 };
 }
 
-#endif // HDF4CPP_HDFATTRIBUTE_H
+#endif //HDF4CPP_HDFATTRIBUTE_H

+ 1 - 1
include/hdf4cpp/HdfDefines.h

@@ -5,8 +5,8 @@
 #ifndef HDF4CPP_HDFDEFINES_H
 #define HDF4CPP_HDFDEFINES_H
 
-#include <hdf/mfhdf.h>
 #include <map>
+#include <mfhdf.h>
 
 #define MAX_DIMENSION 32
 #define MAX_NAME_LENGTH 1000

+ 1 - 1
include/hdf4cpp/HdfItem.h

@@ -10,7 +10,7 @@
 #include <hdf4cpp/HdfFile.h>
 
 #include <algorithm>
-#include <hdf/hdf.h>
+#include <hdf.h>
 #include <map>
 #include <memory>
 #include <vector>

+ 1 - 1
lib/HdfFile.cpp

@@ -2,7 +2,7 @@
 /// \author Patrik Kovacs, Catalysts GmbH
 
 
-#include <hdf/mfhdf.h>
+#include <mfhdf.h>
 #include <stdexcept>
 
 #include <hdf4cpp/HdfDefines.h>

+ 3 - 3
lib/HdfItem.cpp

@@ -2,11 +2,11 @@
 /// \author Patrik Kovacs, Catalysts GmbH
 
 
-#include <hdf/mfhdf.h>
+#include <hdf4cpp/HdfAttribute.h>
 #include <hdf4cpp/HdfFile.h>
 #include <hdf4cpp/HdfItem.h>
+#include <mfhdf.h>
 #include <sstream>
-#include <hdf4cpp/HdfAttribute.h>
 
 hdf4cpp::HdfItem::HdfDatasetItem::HdfDatasetItem(int32 id, const HdfDestroyerChain &chain)
     : HdfItemBase(id, SDATA, chain) {
@@ -133,4 +133,4 @@ hdf4cpp::HdfItem::Iterator hdf4cpp::HdfItem::end() const {
     }
     default: { return Iterator(sId, vId, item->getId(), 0, getType(), chain); }
     }
-}
+}