summaryrefslogtreecommitdiffstats
path: root/c++/test
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2010-05-13 16:01:50 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2010-05-13 16:01:50 (GMT)
commitae06433ab0ca13838c2762c8fad165a041d64c42 (patch)
tree72d645731c00953c3daf6dad8a1cf0dc97326943 /c++/test
parent940931aa853602b0b6edfd4ca1a6526fd7975dd2 (diff)
downloadhdf5-ae06433ab0ca13838c2762c8fad165a041d64c42.zip
hdf5-ae06433ab0ca13838c2762c8fad165a041d64c42.tar.gz
hdf5-ae06433ab0ca13838c2762c8fad165a041d64c42.tar.bz2
[svn-r18793] Add files to support building library with CMake
Tested: Local linux
Diffstat (limited to 'c++/test')
-rw-r--r--c++/test/CMakeLists.txt47
1 files changed, 47 insertions, 0 deletions
diff --git a/c++/test/CMakeLists.txt b/c++/test/CMakeLists.txt
new file mode 100644
index 0000000..ac72772
--- /dev/null
+++ b/c++/test/CMakeLists.txt
@@ -0,0 +1,47 @@
+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)
+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>)