diff options
Diffstat (limited to 'examples/CMakeLists.txt')
-rw-r--r-- | examples/CMakeLists.txt | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 71eaa34..86d9307 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -24,14 +24,24 @@ SET (examples FOREACH (example ${examples}) ADD_EXECUTABLE (${example} ${HDF5_EXAMPLES_SOURCE_DIR}/${example}.c) - H5_NAMING (${example}) - TARGET_WIN_PROPERTIES (${example}) + H5_NAMING (${example} ${LIB_TYPE}) TARGET_LINK_LIBRARIES (${example} ${HDF5_LIB_TARGET}) + + IF (BUILD_TESTING) + ADD_TEST (NAME ${example} COMMAND $<TARGET_FILE:${example}>) + ENDIF (BUILD_TESTING) ENDFOREACH (example ${examples}) +IF (BUILD_TESTING) + FILE (MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/red ${PROJECT_BINARY_DIR}/blue ${PROJECT_BINARY_DIR}/u2w) +ENDIF (BUILD_TESTING) + IF (H5_HAVE_PARALLEL) ADD_EXECUTABLE (ph5example ${HDF5_EXAMPLES_SOURCE_DIR}/ph5example.c) - H5_NAMING (ph5example) - TARGET_WIN_PROPERTIES (ph5example) + H5_NAMING (ph5example ${LIB_TYPE}) TARGET_LINK_LIBRARIES (ph5example ${HDF5_LIB_TARGET}) + + IF (BUILD_TESTING) + ADD_TEST (NAME ph5example COMMAND $<TARGET_FILE:ph5example>) + ENDIF (BUILD_TESTING) ENDIF (H5_HAVE_PARALLEL) |