summaryrefslogtreecommitdiffstats
path: root/c++
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2010-07-06 19:45:35 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2010-07-06 19:45:35 (GMT)
commit98754fa9d12090f5e048fdb05cc5e9ce9111676f (patch)
tree407e611b19ee551d8153779104022dd886a467e5 /c++
parent29321bcafa9f1c6108bb92b5a844a9d4d9c2c8e7 (diff)
downloadhdf5-98754fa9d12090f5e048fdb05cc5e9ce9111676f.zip
hdf5-98754fa9d12090f5e048fdb05cc5e9ce9111676f.tar.gz
hdf5-98754fa9d12090f5e048fdb05cc5e9ce9111676f.tar.bz2
[svn-r19050] Description:
Bring r18704:19049 from trunk to revise_chunks branch. Tested on: FreeBSD/32 6.3 (duty) in debug mode FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x, w/C++ & FORTRAN, w/threadsafe, in debug mode Linux/64-amd64 2.6 (amani) w/Intel compilers, w/default API=1.6.x, w/C++ & FORTRAN, in production mode Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN, w/szip filter, in production mode Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN, in production mode Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in debug mode Mac OS X/32 10.6.3 (amazon) in debug mode Mac OS X/32 10.6.3 (amazon) w/C++ & FORTRAN, w/threadsafe, in production mode
Diffstat (limited to 'c++')
-rw-r--r--c++/CMakeLists.txt46
-rw-r--r--c++/Makefile.in2
-rw-r--r--c++/examples/CMakeLists.txt37
-rw-r--r--c++/examples/Makefile.in2
-rw-r--r--c++/src/CMakeLists.txt115
-rw-r--r--c++/src/H5AbstractDs.cpp17
-rw-r--r--c++/src/H5IdComponent.cpp18
-rw-r--r--c++/src/H5PropList.cpp44
-rw-r--r--c++/src/Makefile.in4
-rw-r--r--c++/test/CMakeLists.txt57
-rw-r--r--c++/test/Makefile.in2
11 files changed, 308 insertions, 36 deletions
diff --git a/c++/CMakeLists.txt b/c++/CMakeLists.txt
new file mode 100644
index 0000000..b1edc06
--- /dev/null
+++ b/c++/CMakeLists.txt
@@ -0,0 +1,46 @@
+cmake_minimum_required (VERSION 2.8)
+PROJECT (HDF5_CPP)
+
+#-----------------------------------------------------------------------------
+# Shared/Static Libs
+#-----------------------------------------------------------------------------
+IF (BUILD_SHARED_LIBS)
+ SET (CPP_BUILT_AS_DYNAMIC_LIB 1)
+ENDIF (BUILD_SHARED_LIBS)
+
+#-----------------------------------------------------------------------------
+# Generate configure file
+#-----------------------------------------------------------------------------
+CONFIGURE_FILE (${HDF5_SOURCE_DIR}/Resources/H5cxx_config.h.in
+ ${HDF5_BINARY_DIR}/H5cxx_pubconf.h
+)
+
+#-----------------------------------------------------------------------------
+# Setup Include directories
+#-----------------------------------------------------------------------------
+INCLUDE_DIRECTORIES (${HDF5_CPP_SOURCE_DIR}/src)
+INCLUDE_DIRECTORIES (${HDF5_BINARY_DIR})
+
+#-----------------------------------------------------------------------------
+# Parallel/MPI, prevent spurious cpp/cxx warnings
+#-----------------------------------------------------------------------------
+IF (H5_HAVE_PARALLEL)
+ ADD_DEFINITIONS ("-DMPICH_SKIP_MPICXX")
+ ADD_DEFINITIONS ("-DMPICH_IGNORE_CXX_SEEK")
+ENDIF (H5_HAVE_PARALLEL)
+
+ADD_SUBDIRECTORY (${HDF5_CPP_SOURCE_DIR}/src ${HDF5_CPP_BINARY_DIR}/src)
+
+#-----------------------------------------------------------------------------
+# Build the CPP Examples
+#-----------------------------------------------------------------------------
+IF (HDF5_BUILD_EXAMPLES)
+ ADD_SUBDIRECTORY (${HDF5_CPP_SOURCE_DIR}/examples ${HDF5_CPP_BINARY_DIR}/examples)
+ENDIF (HDF5_BUILD_EXAMPLES)
+
+#-----------------------------------------------------------------------------
+# Build the CPP unit tests
+#-----------------------------------------------------------------------------
+IF (BUILD_TESTING)
+ ADD_SUBDIRECTORY (${HDF5_CPP_SOURCE_DIR}/test ${HDF5_CPP_BINARY_DIR}/test)
+ENDIF (BUILD_TESTING)
diff --git a/c++/Makefile.in b/c++/Makefile.in
index 2dfb03a..e82d4a1 100644
--- a/c++/Makefile.in
+++ b/c++/Makefile.in
@@ -199,12 +199,12 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
INSTRUMENT = @INSTRUMENT@
INSTRUMENT_LIBRARY = @INSTRUMENT_LIBRARY@
+LARGEFILE = @LARGEFILE@
LD = @LD@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
-LINUX_LFS = @LINUX_LFS@
LIPO = @LIPO@
LL_PATH = @LL_PATH@
LN_S = @LN_S@
diff --git a/c++/examples/CMakeLists.txt b/c++/examples/CMakeLists.txt
new file mode 100644
index 0000000..75644a8
--- /dev/null
+++ b/c++/examples/CMakeLists.txt
@@ -0,0 +1,37 @@
+cmake_minimum_required (VERSION 2.8)
+# --------------------------------------------------------------------
+# Notes: When creating examples they should be prefixed
+# with "cpp_ex_". This allows for easier filtering of the examples.
+# --------------------------------------------------------------------
+
+PROJECT (HDF5_CPP_EXAMPLES)
+
+#-----------------------------------------------------------------------------
+# Define examples
+#-----------------------------------------------------------------------------
+
+SET (examples
+ create
+ readdata
+ writedata
+ compound
+ extend_ds
+ chunks
+ h5group
+)
+
+FOREACH (example ${examples})
+ ADD_EXECUTABLE (cpp_ex_${example} ${HDF5_CPP_EXAMPLES_SOURCE_DIR}/${example}.cpp)
+ H5_NAMING (cpp_ex_${example})
+ IF (WIN32)
+ IF (MSVC)
+ IF (NOT BUILD_SHARED_LIBS)
+ SET_TARGET_PROPERTIES (cpp_ex_${example}
+ PROPERTIES
+ LINK_FLAGS "/NODEFAULTLIB:MSVCRT"
+ )
+ ENDIF (NOT BUILD_SHARED_LIBS)
+ ENDIF (MSVC)
+ ENDIF (WIN32)
+ TARGET_LINK_LIBRARIES (cpp_ex_${example} ${HDF5_CPP_LIB_TARGET} ${HDF5_LIB_TARGET})
+ENDFOREACH (example ${examples})
diff --git a/c++/examples/Makefile.in b/c++/examples/Makefile.in
index 46a50c5..63ed0e9 100644
--- a/c++/examples/Makefile.in
+++ b/c++/examples/Makefile.in
@@ -165,12 +165,12 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
INSTRUMENT = @INSTRUMENT@
INSTRUMENT_LIBRARY = @INSTRUMENT_LIBRARY@
+LARGEFILE = @LARGEFILE@
LD = @LD@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
-LINUX_LFS = @LINUX_LFS@
LIPO = @LIPO@
LL_PATH = @LL_PATH@
LN_S = @LN_S@
diff --git a/c++/src/CMakeLists.txt b/c++/src/CMakeLists.txt
new file mode 100644
index 0000000..2cf3d7b
--- /dev/null
+++ b/c++/src/CMakeLists.txt
@@ -0,0 +1,115 @@
+cmake_minimum_required (VERSION 2.8)
+PROJECT (HDF5_CPP_SRC)
+
+#-----------------------------------------------------------------------------
+# Shared/Static Libs
+#-----------------------------------------------------------------------------
+IF (BUILD_SHARED_LIBS)
+ SET (CPP_BUILT_AS_DYNAMIC_LIB 1)
+ENDIF (BUILD_SHARED_LIBS)
+
+#-----------------------------------------------------------------------------
+# Generate configure file
+#-----------------------------------------------------------------------------
+CONFIGURE_FILE (${HDF5_SOURCE_DIR}/Resources/H5cxx_config.h.in
+ ${HDF5_BINARY_DIR}/H5cxx_pubconf.h
+)
+
+#-----------------------------------------------------------------------------
+# Define cpp Library
+#-----------------------------------------------------------------------------
+SET (CPP_SRCS
+ ${HDF5_CPP_SOURCE_DIR}/src/H5AbstractDs.cpp
+ ${HDF5_CPP_SOURCE_DIR}/src/H5ArrayType.cpp
+ ${HDF5_CPP_SOURCE_DIR}/src/H5AtomType.cpp
+ ${HDF5_CPP_SOURCE_DIR}/src/H5Attribute.cpp
+ ${HDF5_CPP_SOURCE_DIR}/src/H5CommonFG.cpp
+ ${HDF5_CPP_SOURCE_DIR}/src/H5CompType.cpp
+ ${HDF5_CPP_SOURCE_DIR}/src/H5DataSet.cpp
+ ${HDF5_CPP_SOURCE_DIR}/src/H5DataSpace.cpp
+ ${HDF5_CPP_SOURCE_DIR}/src/H5DataType.cpp
+ ${HDF5_CPP_SOURCE_DIR}/src/H5DcreatProp.cpp
+ ${HDF5_CPP_SOURCE_DIR}/src/H5DxferProp.cpp
+ ${HDF5_CPP_SOURCE_DIR}/src/H5EnumType.cpp
+ ${HDF5_CPP_SOURCE_DIR}/src/H5Exception.cpp
+ ${HDF5_CPP_SOURCE_DIR}/src/H5FaccProp.cpp
+ ${HDF5_CPP_SOURCE_DIR}/src/H5FcreatProp.cpp
+ ${HDF5_CPP_SOURCE_DIR}/src/H5File.cpp
+ ${HDF5_CPP_SOURCE_DIR}/src/H5FloatType.cpp
+ ${HDF5_CPP_SOURCE_DIR}/src/H5Group.cpp
+ ${HDF5_CPP_SOURCE_DIR}/src/H5IdComponent.cpp
+ ${HDF5_CPP_SOURCE_DIR}/src/H5IntType.cpp
+ ${HDF5_CPP_SOURCE_DIR}/src/H5Library.cpp
+ ${HDF5_CPP_SOURCE_DIR}/src/H5Object.cpp
+ ${HDF5_CPP_SOURCE_DIR}/src/H5PredType.cpp
+ ${HDF5_CPP_SOURCE_DIR}/src/H5PropList.cpp
+ ${HDF5_CPP_SOURCE_DIR}/src/H5StrType.cpp
+ ${HDF5_CPP_SOURCE_DIR}/src/H5VarLenType.cpp
+)
+
+SET (CPP_HDRS
+ ${HDF5_CPP_SOURCE_DIR}/src/H5AbstractDs.h
+ ${HDF5_CPP_SOURCE_DIR}/src/H5Alltypes.h
+ ${HDF5_CPP_SOURCE_DIR}/src/H5ArrayType.h
+ ${HDF5_CPP_SOURCE_DIR}/src/H5AtomType.h
+ ${HDF5_CPP_SOURCE_DIR}/src/H5Attribute.h
+ ${HDF5_CPP_SOURCE_DIR}/src/H5Classes.h
+ ${HDF5_CPP_SOURCE_DIR}/src/H5CommonFG.h
+ ${HDF5_CPP_SOURCE_DIR}/src/H5CompType.h
+ ${HDF5_CPP_SOURCE_DIR}/src/H5Cpp.h
+ ${HDF5_CPP_SOURCE_DIR}/src/H5CppDoc.h
+ ${HDF5_CPP_SOURCE_DIR}/src/H5DataSet.h
+ ${HDF5_CPP_SOURCE_DIR}/src/H5DataSpace.h
+ ${HDF5_CPP_SOURCE_DIR}/src/H5DataType.h
+ ${HDF5_CPP_SOURCE_DIR}/src/H5DcreatProp.h
+ ${HDF5_CPP_SOURCE_DIR}/src/H5DxferProp.h
+ ${HDF5_CPP_SOURCE_DIR}/src/H5EnumType.h
+ ${HDF5_CPP_SOURCE_DIR}/src/H5Exception.h
+ ${HDF5_CPP_SOURCE_DIR}/src/H5FaccProp.h
+ ${HDF5_CPP_SOURCE_DIR}/src/H5FcreatProp.h
+ ${HDF5_CPP_SOURCE_DIR}/src/H5File.h
+ ${HDF5_CPP_SOURCE_DIR}/src/H5FloatType.h
+ ${HDF5_CPP_SOURCE_DIR}/src/H5Group.h
+ ${HDF5_CPP_SOURCE_DIR}/src/H5IdComponent.h
+ ${HDF5_CPP_SOURCE_DIR}/src/H5Include.h
+ ${HDF5_CPP_SOURCE_DIR}/src/H5IntType.h
+ ${HDF5_CPP_SOURCE_DIR}/src/H5Library.h
+ ${HDF5_CPP_SOURCE_DIR}/src/H5Object.h
+ ${HDF5_CPP_SOURCE_DIR}/src/H5PredType.h
+ ${HDF5_CPP_SOURCE_DIR}/src/H5PropList.h
+ ${HDF5_CPP_SOURCE_DIR}/src/H5StrType.h
+ ${HDF5_CPP_SOURCE_DIR}/src/H5VarLenType.h
+)
+
+ADD_LIBRARY (${HDF5_CPP_LIB_TARGET} ${LIB_TYPE} ${CPP_SRCS} ${CPP_HDRS})
+TARGET_LINK_LIBRARIES (${HDF5_CPP_LIB_TARGET} ${HDF5_LIB_TARGET})
+SET_GLOBAL_VARIABLE (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_CPP_LIB_TARGET}")
+H5_SET_LIB_OPTIONS (${HDF5_CPP_LIB_TARGET} ${HDF5_CPP_LIB_NAME} ${LIB_TYPE})
+
+#-----------------------------------------------------------------------------
+# Add file(s) to CMake Install
+#-----------------------------------------------------------------------------
+INSTALL (
+ FILES
+ ${CPP_HDRS}
+ DESTINATION
+ include/cpp
+ COMPONENT
+ cppheaders
+)
+
+#-----------------------------------------------------------------------------
+# Add Target(s) to CMake Install for import into other projects
+#-----------------------------------------------------------------------------
+IF (HDF5_EXPORTED_TARGETS)
+ INSTALL (
+ TARGETS
+ ${HDF5_CPP_LIB_TARGET}
+ EXPORT
+ ${HDF5_EXPORTED_TARGETS}
+ LIBRARY DESTINATION lib COMPONENT cpplibraries
+ ARCHIVE DESTINATION lib COMPONENT cpplibraries
+ RUNTIME DESTINATION bin COMPONENT cpplibraries
+ )
+ENDIF (HDF5_EXPORTED_TARGETS)
+
diff --git a/c++/src/H5AbstractDs.cpp b/c++/src/H5AbstractDs.cpp
index 19eeb33..9cf1ee8 100644
--- a/c++/src/H5AbstractDs.cpp
+++ b/c++/src/H5AbstractDs.cpp
@@ -81,15 +81,26 @@ H5T_class_t AbstractDs::getTypeClass() const
// Gets the class of the datatype and validate it before returning
H5T_class_t type_class = H5Tget_class(datatype_id);
- if( type_class != H5T_NO_CLASS )
- return( type_class );
- else
+
+ // Close temporary datatype_id
+ herr_t ret_value = H5Tclose(datatype_id);
+ if (ret_value < 0)
+ {
+ if (fromClass() == "DataSet")
+ throw DataTypeIException("DataSet::getTypeClass", "H5Tclose failed");
+ else if (fromClass() == "Attribute")
+ throw DataTypeIException("Attribute::getTypeClass", "H5Tclose failed");
+ }
+
+ // Check on the returned type_class
+ if (type_class == H5T_NO_CLASS)
{
if (fromClass() == "DataSet")
throw DataTypeIException("DataSet::getTypeClass", "H5Tget_class returns H5T_NO_CLASS");
else if (fromClass() == "Attribute")
throw DataTypeIException("Attribute::getTypeClass", "H5Tget_class returns H5T_NO_CLASS");
}
+ return(type_class);
}
//--------------------------------------------------------------------------
diff --git a/c++/src/H5IdComponent.cpp b/c++/src/H5IdComponent.cpp
index ef01105..1cac0c1 100644
--- a/c++/src/H5IdComponent.cpp
+++ b/c++/src/H5IdComponent.cpp
@@ -161,6 +161,10 @@ H5I_type_t IdComponent::getHDFObjType(const hid_t obj_id)
// copy the id from rhs to this object, and increment the
// reference counter of the id to indicate that another object
// is referencing that id.
+// Modification
+// 2010/5/9 - BMR
+// Removed close() and incRefCount() because setId/p_setId takes
+// care of close() and setId takes care incRefCount().
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
IdComponent& IdComponent::operator=( const IdComponent& rhs )
@@ -169,16 +173,13 @@ IdComponent& IdComponent::operator=( const IdComponent& rhs )
{
// handling references to this id
try {
- close();
+ setId(rhs.getId());
+ // Note: a = b, so there are two objects with the same hdf5 id
+ // that's why incRefCount is needed, and it is called by setId
}
catch (Exception close_error) {
throw FileIException(inMemFunc("operator="), close_error.getDetailMsg());
}
-
- // copy the data members from the rhs object
- p_setId(rhs.getId());
- incRefCount(getId()); // a = b, so there are two objects with the same
- // hdf5 id
}
return *this;
}
@@ -190,9 +191,8 @@ IdComponent& IdComponent::operator=( const IdComponent& rhs )
///\exception H5::IdComponentException when the attempt to close the HDF5
/// object fails
// Description:
-// The underlaying reference counting in the C library ensures
-// that the current valid id of this object is properly closed.
-// Then the object's id is reset to the new id.
+// p_setId ensures that the current valid id of this object is
+// properly closed before resetting the object's id to the new id.
// Programmer Binh-Minh Ribler - 2000
// Modification
// 2008/7/23 - BMR
diff --git a/c++/src/H5PropList.cpp b/c++/src/H5PropList.cpp
index 579c8ac..2530204 100644
--- a/c++/src/H5PropList.cpp
+++ b/c++/src/H5PropList.cpp
@@ -66,29 +66,35 @@ PropList::PropList(const PropList& original) : IdComponent(original)
///\param plist_id - IN: Id of the existing property list
///\exception H5::PropListIException
// Description
-// This function calls H5Pcreate to create a new property list
-// if the given id, plist_id, is that of a property class. If
-// the given id is equal to H5P_ROOT, then set this
-// property's id to H5P_DEFAULT, otherwise, to the given id.
-// Note: someone else added this code without comments and this
-// description was what I came up with from reading the code.
+// This function creates a new property list if a property
+// class is provided or makes a copy of a property list if one
+// is given. If the given id is anything else, then set this
+// property's id to H5P_DEFAULT.
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
PropList::PropList( const hid_t plist_id ) : IdComponent()
{
- if (H5I_GENPROP_CLS == H5Iget_type(plist_id)) {
- // call C routine to create the new property
- id = H5Pcreate(plist_id);
- if( id < 0 )
- {
- throw PropListIException("PropList constructor", "H5Pcreate failed");
- }
- }
- else {
- if(plist_id==H5P_ROOT)
- id=H5P_DEFAULT;
- else
- id=plist_id;
+ H5I_type_t id_type = H5Iget_type(plist_id);
+ switch (id_type) {
+ case H5I_GENPROP_CLS:
+ // call C routine to create a new property from the given prop class
+ id = H5Pcreate(plist_id);
+ if( id < 0 )
+ {
+ throw PropListIException("PropList constructor", "H5Pcreate failed");
+ }
+ break;
+ case H5I_GENPROP_LST:
+ // call C routine to make a copy of the given property list
+ id = H5Pcopy(plist_id);
+ if( id < 0 )
+ {
+ throw PropListIException("PropList constructor", "H5Pcopy failed");
+ }
+ break;
+ default:
+ id = H5P_DEFAULT;
+ break;
}
}
diff --git a/c++/src/Makefile.in b/c++/src/Makefile.in
index 2c595fc..5ee5f64 100644
--- a/c++/src/Makefile.in
+++ b/c++/src/Makefile.in
@@ -221,12 +221,12 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
INSTRUMENT = @INSTRUMENT@
INSTRUMENT_LIBRARY = @INSTRUMENT_LIBRARY@
+LARGEFILE = @LARGEFILE@
LD = @LD@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
-LINUX_LFS = @LINUX_LFS@
LIPO = @LIPO@
LL_PATH = @LL_PATH@
LN_S = @LN_S@
@@ -390,7 +390,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog
# Add libtool shared library version numbers to the HDF5 library
# See libtool versioning documentation online.
LT_VERS_INTERFACE = 6
-LT_VERS_REVISION = 59
+LT_VERS_REVISION = 63
LT_VERS_AGE = 0
# Include src directory
diff --git a/c++/test/CMakeLists.txt b/c++/test/CMakeLists.txt
new file mode 100644
index 0000000..770348e
--- /dev/null
+++ b/c++/test/CMakeLists.txt
@@ -0,0 +1,57 @@
+cmake_minimum_required (VERSION 2.8)
+# --------------------------------------------------------------------
+# Notes: When creating unit test executables they should be prefixed
+# with "cpp_". This allows for easier filtering of the test suite when
+# using ctest. An example would be
+# ctest -R cpp_
+# which would only run the C++ based unit tests.
+# --------------------------------------------------------------------
+
+PROJECT (HDF5_CPP_TEST)
+
+#-----------------------------------------------------------------------------
+# Define Sources
+#-----------------------------------------------------------------------------
+SET (CPP_TEST_SRCS
+ ${HDF5_CPP_TEST_SOURCE_DIR}/testhdf5.cpp
+ ${HDF5_CPP_TEST_SOURCE_DIR}/tattr.cpp
+ ${HDF5_CPP_TEST_SOURCE_DIR}/tcompound.cpp
+ ${HDF5_CPP_TEST_SOURCE_DIR}/tfile.cpp
+ ${HDF5_CPP_TEST_SOURCE_DIR}/tfilter.cpp
+ ${HDF5_CPP_TEST_SOURCE_DIR}/th5s.cpp
+ ${HDF5_CPP_TEST_SOURCE_DIR}/tlinks.cpp
+ ${HDF5_CPP_TEST_SOURCE_DIR}/trefer.cpp
+ ${HDF5_CPP_TEST_SOURCE_DIR}/ttypes.cpp
+ ${HDF5_CPP_TEST_SOURCE_DIR}/tvlstr.cpp
+ ${HDF5_CPP_TEST_SOURCE_DIR}/dsets.cpp
+ ${HDF5_CPP_TEST_SOURCE_DIR}/h5cpputil.cpp
+)
+
+#-----------------------------------------------------------------------------
+# Generate the H5srcdir_str.h file containing user settings needed by compilation
+#-----------------------------------------------------------------------------
+SET (srcdir ${CMAKE_CURRENT_SOURCE_DIR})
+CONFIGURE_FILE (${HDF5_CPP_TEST_SOURCE_DIR}/H5srcdir_str.h.in H5srcdir_str.h @ONLY)
+INCLUDE_DIRECTORIES (${CMAKE_CURRENT_BINARY_DIR})
+
+INCLUDE_DIRECTORIES (${HDF5_TEST_SOURCE_DIR} )
+
+ADD_EXECUTABLE (cpp_testhdf5 ${CPP_TEST_SRCS} )
+H5_NAMING (cpp_testhdf5)
+IF (WIN32)
+ IF (MSVC)
+ IF (NOT BUILD_SHARED_LIBS)
+ SET_TARGET_PROPERTIES (cpp_testhdf5
+ PROPERTIES
+ LINK_FLAGS "/NODEFAULTLIB:MSVCRT"
+ )
+ ENDIF (NOT BUILD_SHARED_LIBS)
+ ENDIF (MSVC)
+ENDIF (WIN32)
+TARGET_LINK_LIBRARIES (cpp_testhdf5
+ ${HDF5_CPP_LIB_TARGET}
+ ${HDF5_LIB_TARGET}
+ ${HDF5_TEST_LIB_TARGET}
+)
+
+ADD_TEST (NAME cpp_testhdf5 COMMAND $<TARGET_FILE:cpp_testhdf5>)
diff --git a/c++/test/Makefile.in b/c++/test/Makefile.in
index 0945169..9e68dcd 100644
--- a/c++/test/Makefile.in
+++ b/c++/test/Makefile.in
@@ -188,12 +188,12 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
INSTRUMENT = @INSTRUMENT@
INSTRUMENT_LIBRARY = @INSTRUMENT_LIBRARY@
+LARGEFILE = @LARGEFILE@
LD = @LD@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
-LINUX_LFS = @LINUX_LFS@
LIPO = @LIPO@
LL_PATH = @LL_PATH@
LN_S = @LN_S@