summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorDana Robinson <derobins@hdfgroup.org>2015-08-14 19:58:54 (GMT)
committerDana Robinson <derobins@hdfgroup.org>2015-08-14 19:58:54 (GMT)
commitc27d1808480a4ffae4af5ff5384993f63ea6b5d4 (patch)
tree251081393f02ad4fb6767af9d23be50971761d79 /examples
parent37b14fd3ed8aae8f3b83df03ca29f82178c25f8f (diff)
parentd3e931c772a1fea1d8d0676dd6dd3fe95b000d9e (diff)
downloadhdf5-c27d1808480a4ffae4af5ff5384993f63ea6b5d4.zip
hdf5-c27d1808480a4ffae4af5ff5384993f63ea6b5d4.tar.gz
hdf5-c27d1808480a4ffae4af5ff5384993f63ea6b5d4.tar.bz2
[svn-r27507] Merge of r27237-27500 from the trunk.
Tested w/ h5committest NOTES: - The manifest may still be messed up. - Cmake fails since the dual binary work needs to be merged with this repo's CMake externals.
Diffstat (limited to 'examples')
-rw-r--r--examples/CMakeLists.txt22
-rw-r--r--examples/CMakeTests.cmake67
2 files changed, 85 insertions, 4 deletions
diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt
index 1f33f04..7953161 100644
--- a/examples/CMakeLists.txt
+++ b/examples/CMakeLists.txt
@@ -38,18 +38,32 @@ set (examples
foreach (example ${examples})
add_executable (${example} ${HDF5_EXAMPLES_SOURCE_DIR}/${example}.c)
- TARGET_NAMING (${example} ${LIB_TYPE})
- TARGET_C_PROPERTIES (${example} ${LIB_TYPE} " " " ")
+ TARGET_NAMING (${example} STATIC)
+ TARGET_C_PROPERTIES (${example} STATIC " " " ")
target_link_libraries (${example} ${HDF5_LIB_TARGET})
set_target_properties (${example} PROPERTIES FOLDER examples)
+ if (BUILD_SHARED_LIBS)
+ add_executable (${example}-shared ${HDF5_EXAMPLES_SOURCE_DIR}/${example}.c)
+ TARGET_NAMING (${example}-shared SHARED)
+ TARGET_C_PROPERTIES (${example}-shared SHARED " " " ")
+ target_link_libraries (${example}-shared ${HDF5_LIBSH_TARGET})
+ set_target_properties (${example}-shared PROPERTIES FOLDER examples)
+ endif (BUILD_SHARED_LIBS)
endforeach (example ${examples})
if (H5_HAVE_PARALLEL)
add_executable (ph5example ${HDF5_EXAMPLES_SOURCE_DIR}/ph5example.c)
- TARGET_NAMING (ph5example ${LIB_TYPE})
- TARGET_C_PROPERTIES (ph5example ${LIB_TYPE} " " " ")
+ TARGET_NAMING (ph5example STATIC)
+ TARGET_C_PROPERTIES (ph5example STATIC " " " ")
target_link_libraries (ph5example ${HDF5_LIB_TARGET})
set_target_properties (ph5example PROPERTIES FOLDER examples)
+ if (BUILD_SHARED_LIBS)
+ add_executable (ph5example-shared ${HDF5_EXAMPLES_SOURCE_DIR}/ph5example.c)
+ TARGET_NAMING (ph5example-shared SHARED)
+ TARGET_C_PROPERTIES (ph5example-shared SHARED " " " ")
+ target_link_libraries (ph5example-shared ${HDF5_LIBSH_TARGET})
+ set_target_properties (ph5example-shared PROPERTIES FOLDER examples)
+ endif (BUILD_SHARED_LIBS)
endif (H5_HAVE_PARALLEL)
if (BUILD_TESTING)
diff --git a/examples/CMakeTests.cmake b/examples/CMakeTests.cmake
index 5a756c8..42b42b3 100644
--- a/examples/CMakeTests.cmake
+++ b/examples/CMakeTests.cmake
@@ -5,6 +5,10 @@
##############################################################################
##############################################################################
file (MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/red ${PROJECT_BINARY_DIR}/blue ${PROJECT_BINARY_DIR}/u2w)
+ if (BUILD_SHARED_LIBS)
+ file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/H5EX-shared")
+ file (MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/H5EX-shared/red ${PROJECT_BINARY_DIR}/H5EX-shared/blue ${PROJECT_BINARY_DIR}/H5EX-shared/u2w)
+ endif (BUILD_SHARED_LIBS)
# Remove any output file left over from previous test run
add_test (
@@ -56,6 +60,61 @@
set (last_test "EXAMPLES-${example}")
endforeach (example ${examples})
+ if (BUILD_SHARED_LIBS)
+ # Remove any output file left over from previous test run
+ add_test (
+ NAME EXAMPLES-shared-clear-objects
+ COMMAND ${CMAKE_COMMAND}
+ -E remove
+ Attributes.h5
+ btrees_file.h5
+ cmprss.h5
+ default_file.h5
+ dset.h5
+ extend.h5
+ extlink_prefix_source.h5
+ extlink_source.h5
+ extlink_target.h5
+ group.h5
+ groups.h5
+ hard_link.h5
+ mount1.h5
+ mount2.h5
+ one_index_file.h5
+ only_dspaces_and_attrs_file.h5
+ only_huge_mesgs_file.h5
+ REF_REG.h5
+ refere.h5
+ SDS.h5
+ SDScompound.h5
+ SDSextendible.h5
+ Select.h5
+ separate_indexes_file.h5
+ small_lists_file.h5
+ soft_link.h5
+ subset.h5
+ unix2win.h5
+ blue/prefix_target.h5
+ red/prefix_target.h5
+ u2w/u2w_target.h5
+ WORKING_DIRECTORY
+ ${PROJECT_BINARY_DIR}/H5EX-shared
+ )
+ if (NOT "${last_test}" STREQUAL "")
+ set_tests_properties (EXAMPLES-shared-clear-objects PROPERTIES DEPENDS ${last_test})
+ endif (NOT "${last_test}" STREQUAL "")
+ set (last_test "EXAMPLES-shared-clear-objects")
+
+ foreach (example ${examples})
+ add_test (NAME EXAMPLES-shared-${example} COMMAND $<TARGET_FILE:${example}-shared>)
+ set_tests_properties (EXAMPLES-shared-${example} PROPERTIES WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/H5EX-shared)
+ if (NOT "${last_test}" STREQUAL "")
+ set_tests_properties (EXAMPLES-shared-${example} PROPERTIES DEPENDS ${last_test})
+ endif (NOT "${last_test}" STREQUAL "")
+ set (last_test "EXAMPLES-shared-${example}")
+ endforeach (example ${examples})
+ endif (BUILD_SHARED_LIBS)
+
### Windows pops up a modal permission dialog on this test
if (H5_HAVE_PARALLEL AND NOT WIN32)
add_test (NAME EXAMPLES-ph5example COMMAND $<TARGET_FILE:ph5example>)
@@ -63,4 +122,12 @@
set_tests_properties (EXAMPLES-ph5example PROPERTIES DEPENDS ${last_test})
endif (NOT "${last_test}" STREQUAL "")
set (last_test "EXAMPLES-ph5example")
+ if (BUILD_SHARED_LIBS)
+ add_test (NAME EXAMPLES-shared-ph5example COMMAND $<TARGET_FILE:ph5example-shared>)
+ set_tests_properties (EXAMPLES-shared-ph5example PROPERTIES WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/H5EX-shared)
+ if (NOT "${last_test}" STREQUAL "")
+ set_tests_properties (EXAMPLES-shared-ph5example PROPERTIES DEPENDS ${last_test})
+ endif (NOT "${last_test}" STREQUAL "")
+ set (last_test "EXAMPLES-shared-ph5example")
+ endif (BUILD_SHARED_LIBS)
endif (H5_HAVE_PARALLEL AND NOT WIN32)