summaryrefslogtreecommitdiffstats
path: root/c++
diff options
context:
space:
mode:
Diffstat (limited to 'c++')
-rw-r--r--c++/CMakeLists.txt8
-rw-r--r--c++/examples/CMakeLists.txt12
-rw-r--r--c++/examples/CMakeTests.cmake49
-rw-r--r--c++/src/CMakeLists.txt8
-rw-r--r--c++/test/CMakeLists.txt2
-rw-r--r--c++/test/CMakeTests.cmake25
6 files changed, 71 insertions, 33 deletions
diff --git a/c++/CMakeLists.txt b/c++/CMakeLists.txt
index 6f288a0..c9c4815 100644
--- a/c++/CMakeLists.txt
+++ b/c++/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required (VERSION 3.1.0)
+cmake_minimum_required (VERSION 3.2.2)
PROJECT (HDF5_CPP)
#-----------------------------------------------------------------------------
@@ -25,7 +25,7 @@ INCLUDE_DIRECTORIES (${HDF5_BINARY_DIR})
if (H5_HAVE_PARALLEL)
add_definitions ("-DMPICH_SKIP_MPICXX")
add_definitions ("-DMPICH_IGNORE_CXX_SEEK")
-endif (H5_HAVE_PARALLEL)
+endif ()
add_subdirectory (${HDF5_CPP_SOURCE_DIR}/src ${HDF5_CPP_BINARY_DIR}/src)
@@ -34,11 +34,11 @@ add_subdirectory (${HDF5_CPP_SOURCE_DIR}/src ${HDF5_CPP_BINARY_DIR}/src)
#-----------------------------------------------------------------------------
if (HDF5_BUILD_EXAMPLES)
add_subdirectory (${HDF5_CPP_SOURCE_DIR}/examples ${HDF5_CPP_BINARY_DIR}/examples)
-endif (HDF5_BUILD_EXAMPLES)
+endif ()
#-----------------------------------------------------------------------------
# Build the CPP unit tests
#-----------------------------------------------------------------------------
if (BUILD_TESTING)
add_subdirectory (${HDF5_CPP_SOURCE_DIR}/test ${HDF5_CPP_BINARY_DIR}/test)
-endif (BUILD_TESTING)
+endif ()
diff --git a/c++/examples/CMakeLists.txt b/c++/examples/CMakeLists.txt
index cfcdd8d..e5b0b4a 100644
--- a/c++/examples/CMakeLists.txt
+++ b/c++/examples/CMakeLists.txt
@@ -1,11 +1,11 @@
-cmake_minimum_required (VERSION 3.1.0)
+cmake_minimum_required (VERSION 3.2.2)
+PROJECT (HDF5_CPP_EXAMPLES)
+
# --------------------------------------------------------------------
# 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
#-----------------------------------------------------------------------------
@@ -38,7 +38,7 @@ foreach (example ${examples})
TARGET_C_PROPERTIES (cpp_ex_${example} STATIC " " " ")
target_link_libraries (cpp_ex_${example} ${HDF5_CPP_LIB_TARGET} ${HDF5_LIB_TARGET})
set_target_properties (cpp_ex_${example} PROPERTIES FOLDER examples/cpp)
-endforeach (example ${examples})
+endforeach ()
foreach (example ${tutr_examples})
add_executable (cpp_ex_${example} ${HDF5_CPP_EXAMPLES_SOURCE_DIR}/${example}.cpp)
@@ -46,8 +46,8 @@ foreach (example ${tutr_examples})
TARGET_C_PROPERTIES (cpp_ex_${example} STATIC " " " ")
target_link_libraries (cpp_ex_${example} ${HDF5_CPP_LIB_TARGET} ${HDF5_LIB_TARGET})
set_target_properties (cpp_ex_${example} PROPERTIES FOLDER examples/cpp)
-endforeach (example ${tutr_examples})
+endforeach ()
if (BUILD_TESTING)
include (CMakeTests.cmake)
-endif (BUILD_TESTING)
+endif ()
diff --git a/c++/examples/CMakeTests.cmake b/c++/examples/CMakeTests.cmake
index 4db8c68..8b5c6b9 100644
--- a/c++/examples/CMakeTests.cmake
+++ b/c++/examples/CMakeTests.cmake
@@ -8,7 +8,7 @@
add_test (
NAME CPP_ex-clear-objects
COMMAND ${CMAKE_COMMAND}
- -E remove
+ -E remove
Group.h5
SDS.h5
SDScompound.h5
@@ -17,16 +17,29 @@
)
if (NOT "${last_test}" STREQUAL "")
set_tests_properties (CPP_ex-clear-objects PROPERTIES DEPENDS ${last_test})
- endif (NOT "${last_test}" STREQUAL "")
+ endif ()
set (last_test "CPP_ex-clear-objects")
foreach (example ${examples})
- add_test (NAME CPP_ex_${example} COMMAND $<TARGET_FILE:cpp_ex_${example}>)
+ if (HDF5_ENABLE_USING_MEMCHECKER)
+ add_test (NAME CPP_ex_${example} COMMAND $<TARGET_FILE:cpp_ex_${example}>)
+ else ()
+ add_test (NAME CPP_ex_${example} COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:cpp_ex_${example}>"
+ -D "TEST_ARGS:STRING="
+ -D "TEST_EXPECT=0"
+ -D "TEST_SKIP_COMPARE=TRUE"
+ -D "TEST_OUTPUT=cpp_ex_${example}.txt"
+ #-D "TEST_REFERENCE=cpp_ex_${example}.out"
+ -D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
+ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
+ )
+ endif ()
if (NOT "${last_test}" STREQUAL "")
set_tests_properties (CPP_ex_${example} PROPERTIES DEPENDS ${last_test})
- endif (NOT "${last_test}" STREQUAL "")
+ endif ()
set (last_test "CPP_ex_${example}")
- endforeach (example ${examples})
+ endforeach ()
#the following dependicies are handled by the order of the files
# SET_TESTS_PROPERTIES(CPP_ex_readdata PROPERTIES DEPENDS CPP_ex_create)
# SET_TESTS_PROPERTIES(CPP_ex_chunks PROPERTIES DEPENDS CPP_ex_extend_ds)
@@ -34,7 +47,7 @@
add_test (
NAME CPP_ex_tutr-clear-objects
COMMAND ${CMAKE_COMMAND}
- -E remove
+ -E remove
h5tutr_cmprss.h5
h5tutr_dset.h5
h5tutr_extend.h5
@@ -44,18 +57,30 @@
)
if (NOT "${last_test}" STREQUAL "")
set_tests_properties (CPP_ex_tutr-clear-objects PROPERTIES DEPENDS ${last_test})
- endif (NOT "${last_test}" STREQUAL "")
+ endif ()
set (last_test "CPP_ex_tutr-clear-objects")
-
+
foreach (example ${tutr_examples})
- add_test (NAME CPP_ex_${example} COMMAND $<TARGET_FILE:cpp_ex_${example}>)
+ if (HDF5_ENABLE_USING_MEMCHECKER)
+ add_test (NAME CPP_ex_${example} COMMAND $<TARGET_FILE:cpp_ex_${example}>)
+ else ()
+ add_test (NAME CPP_ex_${example} COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:cpp_ex_${example}>"
+ -D "TEST_ARGS:STRING="
+ -D "TEST_EXPECT=0"
+ -D "TEST_SKIP_COMPARE=TRUE"
+ -D "TEST_OUTPUT=cpp_ex_${example}.txt"
+ #-D "TEST_REFERENCE=cpp_ex_${example}.out"
+ -D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
+ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
+ )
+ endif ()
if (NOT "${last_test}" STREQUAL "")
set_tests_properties (CPP_ex_${example} PROPERTIES DEPENDS ${last_test})
- endif (NOT "${last_test}" STREQUAL "")
+ endif ()
set (last_test "CPP_ex_${example}")
- endforeach (example ${tutr_examples})
+ endforeach ()
#the following dependicies are handled by the order of the files
# SET_TESTS_PROPERTIES(CPP_ex_h5tutr_crtatt PROPERTIES DEPENDS CPP_ex_h5tutr_crtdat)
# SET_TESTS_PROPERTIES(CPP_ex_h5tutr_rdwt PROPERTIES DEPENDS CPP_ex_h5tutr_crtdat)
# SET_TESTS_PROPERTIES(CPP_ex_h5tutr_crtgrpd PROPERTIES DEPENDS CPP_ex_h5tutr_crtgrpar)
- \ No newline at end of file
diff --git a/c++/src/CMakeLists.txt b/c++/src/CMakeLists.txt
index 445d57b..6c6b330 100644
--- a/c++/src/CMakeLists.txt
+++ b/c++/src/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required (VERSION 3.1.0)
+cmake_minimum_required (VERSION 3.2.2)
PROJECT (HDF5_CPP_SRC)
#-----------------------------------------------------------------------------
@@ -104,7 +104,7 @@ if (BUILD_SHARED_LIBS)
INTERFACE_COMPILE_DEFINITIONS H5_BUILT_AS_DYNAMIC_LIB=1
)
set (install_targets ${install_targets} ${HDF5_CPP_LIBSH_TARGET})
-endif (BUILD_SHARED_LIBS)
+endif ()
#-----------------------------------------------------------------------------
# Add file(s) to CMake Install
@@ -124,7 +124,7 @@ install (
if (HDF5_EXPORTED_TARGETS)
if (BUILD_SHARED_LIBS)
INSTALL_TARGET_PDB (${HDF5_CPP_LIBSH_TARGET} ${HDF5_INSTALL_BIN_DIR} cpplibraries)
- endif (BUILD_SHARED_LIBS)
+ endif ()
install (
TARGETS
@@ -137,4 +137,4 @@ if (HDF5_EXPORTED_TARGETS)
FRAMEWORK DESTINATION ${HDF5_INSTALL_FWRK_DIR} COMPONENT cpplibraries
INCLUDES DESTINATION include
)
-endif (HDF5_EXPORTED_TARGETS)
+endif ()
diff --git a/c++/test/CMakeLists.txt b/c++/test/CMakeLists.txt
index 75ea500..65815f9 100644
--- a/c++/test/CMakeLists.txt
+++ b/c++/test/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required (VERSION 3.1.0)
+cmake_minimum_required (VERSION 3.2.2)
PROJECT (HDF5_CPP_TEST)
# --------------------------------------------------------------------
# Notes: When creating unit test executables they should be prefixed
diff --git a/c++/test/CMakeTests.cmake b/c++/test/CMakeTests.cmake
index 9bcc706..3f90d5b 100644
--- a/c++/test/CMakeTests.cmake
+++ b/c++/test/CMakeTests.cmake
@@ -20,7 +20,20 @@ add_test (
titerate.h5
)
-add_test (NAME CPP_testhdf5 COMMAND $<TARGET_FILE:cpp_testhdf5>)
+if (HDF5_ENABLE_USING_MEMCHECKER)
+ add_test (NAME CPP_testhdf5 COMMAND $<TARGET_FILE:cpp_testhdf5>)
+else ()
+ add_test (NAME CPP_testhdf5 COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:cpp_testhdf5>"
+ -D "TEST_ARGS:STRING="
+ -D "TEST_EXPECT=0"
+ -D "TEST_SKIP_COMPARE=TRUE"
+ -D "TEST_OUTPUT=cpp_testhdf5.txt"
+ #-D "TEST_REFERENCE=cpp_testhdf5.out"
+ -D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
+ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
+ )
+endif ()
set_tests_properties (CPP_testhdf5 PROPERTIES DEPENDS CPP_testhdf5-clear-objects)
if (HDF5_TEST_VFD)
@@ -36,7 +49,7 @@ if (HDF5_TEST_VFD)
if (DIRECT_VFD)
set (VFD_LIST ${VFD_LIST} direct)
- endif (DIRECT_VFD)
+ endif ()
MACRO (ADD_VFD_TEST vfdname resultcode)
if (NOT HDF5_ENABLE_USING_MEMCHECKER)
@@ -66,12 +79,12 @@ if (HDF5_TEST_VFD)
)
set_tests_properties (CPP_VFD-${vfdname}-cpp_testhdf5 PROPERTIES DEPENDS CPP_VFD-${vfdname}-cpp_testhdf5-clear-objects)
set_tests_properties (CPP_VFD-${vfdname}-cpp_testhdf5 PROPERTIES TIMEOUT 30)
- endif (NOT HDF5_ENABLE_USING_MEMCHECKER)
- ENDMACRO (ADD_VFD_TEST)
+ endif ()
+ ENDMACRO ()
# Run test with different Virtual File Driver
foreach (vfd ${VFD_LIST})
ADD_VFD_TEST (${vfd} 0)
- endforeach (vfd ${VFD_LIST})
+ endforeach ()
-endif (HDF5_TEST_VFD)
+endif ()