diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2014-03-11 21:14:57 (GMT) |
---|---|---|
committer | Allen Byrne <byrn@hdfgroup.org> | 2014-03-11 21:14:57 (GMT) |
commit | a3292a77cef4fc760aab8b496cd6b105c5370890 (patch) | |
tree | 188bd8e5268775213f516dc7062ead790a9997b1 /tools/h5copy | |
parent | 5b7c8c7a7d0b40e36a744f7e1dc68cd189e321b2 (diff) | |
download | hdf5-a3292a77cef4fc760aab8b496cd6b105c5370890.zip hdf5-a3292a77cef4fc760aab8b496cd6b105c5370890.tar.gz hdf5-a3292a77cef4fc760aab8b496cd6b105c5370890.tar.bz2 |
[svn-r24781] HDFFV-8700 -
KitWare recommendations: Change CMake commands to lower case.
Remove INCLUDE_DIRECTORIES in src for target level includes.
Change ADD_DEFINITIONS package debug defines into CMake option.
Remove -DNDEBUG
Diffstat (limited to 'tools/h5copy')
-rw-r--r-- | tools/h5copy/CMakeLists.txt | 26 | ||||
-rw-r--r-- | tools/h5copy/CMakeTests.cmake | 134 |
2 files changed, 80 insertions, 80 deletions
diff --git a/tools/h5copy/CMakeLists.txt b/tools/h5copy/CMakeLists.txt index 6faf332..79deec9 100644 --- a/tools/h5copy/CMakeLists.txt +++ b/tools/h5copy/CMakeLists.txt @@ -9,27 +9,27 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_SRC_DIR}/lib) # -------------------------------------------------------------------- # Add the h5copy and test executables # -------------------------------------------------------------------- -ADD_EXECUTABLE (h5copy ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/h5copy.c) +add_executable (h5copy ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/h5copy.c) TARGET_NAMING (h5copy ${LIB_TYPE}) TARGET_C_PROPERTIES (h5copy " " " ") -TARGET_LINK_LIBRARIES (h5copy ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) -SET_TARGET_PROPERTIES (h5copy PROPERTIES FOLDER tools) +target_link_libraries (h5copy ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) +set_target_properties (h5copy PROPERTIES FOLDER tools) -SET (H5_DEP_EXECUTABLES h5copy) +set (H5_DEP_EXECUTABLES h5copy) -IF (BUILD_TESTING) - IF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) - ADD_EXECUTABLE (h5copygentest ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/h5copygentest.c) +if (BUILD_TESTING) + if (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) + add_executable (h5copygentest ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/h5copygentest.c) TARGET_NAMING (h5copygentest ${LIB_TYPE}) TARGET_C_PROPERTIES (h5copygentest " " " ") - TARGET_LINK_LIBRARIES (h5copygentest ${HDF5_LIB_TARGET}) - SET_TARGET_PROPERTIES (h5copygentest PROPERTIES FOLDER generator/tools) + target_link_libraries (h5copygentest ${HDF5_LIB_TARGET}) + set_target_properties (h5copygentest PROPERTIES FOLDER generator/tools) #ADD_TEST (NAME h5copygentest COMMAND $<TARGET_FILE:h5copygentest>) - ENDIF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) + endif (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) - INCLUDE (CMakeTests.cmake) -ENDIF (BUILD_TESTING) + include (CMakeTests.cmake) +endif (BUILD_TESTING) ############################################################################## ############################################################################## @@ -43,7 +43,7 @@ ENDIF (BUILD_TESTING) #INSTALL_PROGRAM_PDB (h5copy ${HDF5_INSTALL_BIN_DIR} toolsapplications) -INSTALL ( +install ( TARGETS h5copy RUNTIME DESTINATION diff --git a/tools/h5copy/CMakeTests.cmake b/tools/h5copy/CMakeTests.cmake index a4cce03..0d8f121 100644 --- a/tools/h5copy/CMakeTests.cmake +++ b/tools/h5copy/CMakeTests.cmake @@ -8,30 +8,30 @@ # -------------------------------------------------------------------- # Copy all the HDF5 files from the source directory into the test directory # -------------------------------------------------------------------- - SET (LIST_HDF5_TEST_FILES + set (LIST_HDF5_TEST_FILES ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/testfiles/h5copy_extlinks_src.h5 ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/testfiles/h5copy_extlinks_trg.h5 ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/testfiles/h5copy_ref.h5 ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/testfiles/h5copytst.h5 ) - SET (LIST_OTHER_TEST_FILES + set (LIST_OTHER_TEST_FILES ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/testfiles/h5copy_misc1.out ) FILE (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") - FOREACH (listfiles ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES}) + foreach (listfiles ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES}) GET_FILENAME_COMPONENT(fname "${listfiles}" NAME) - SET (dest "${PROJECT_BINARY_DIR}/testfiles/${fname}") - #MESSAGE (STATUS " Copying ${listfiles}") - ADD_CUSTOM_COMMAND ( + set (dest "${PROJECT_BINARY_DIR}/testfiles/${fname}") + #message (STATUS " Copying ${listfiles}") + add_custom_command ( TARGET h5copy POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${listfiles} ${dest} ) - ENDFOREACH (listfiles ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES}) + endforeach (listfiles ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES}) ############################################################################## ############################################################################## @@ -43,7 +43,7 @@ # Perform h5copy according to passing parmeters # MACRO (ADD_H5_F_TEST testname resultcode infile fparam vparam sparam srcname dparam dstname) - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) + if (NOT HDF5_ENABLE_USING_MEMCHECKER) # Remove any output file left over from previous test run ADD_TEST ( NAME H5COPY_F-${testname}-clear-objects @@ -51,35 +51,35 @@ -E remove ./testfiles/${testname}.out.h5 ) - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( NAME H5COPY_F-${testname} COMMAND $<TARGET_FILE:h5copy> -f ${fparam} -i ./testfiles/${infile} -o ./testfiles/${testname}.out.h5 ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN} ) - IF (HDF5_ENABLE_USING_MEMCHECKER) - IF (NOT "${last_test}" STREQUAL "") + if (HDF5_ENABLE_USING_MEMCHECKER) + if (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (H5COPY_F-${testname} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - ELSE (HDF5_ENABLE_USING_MEMCHECKER) + endif (NOT "${last_test}" STREQUAL "") + else (HDF5_ENABLE_USING_MEMCHECKER) SET_TESTS_PROPERTIES (H5COPY_F-${testname} PROPERTIES DEPENDS H5COPY_F-${testname}-clear-objects) - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + endif (HDF5_ENABLE_USING_MEMCHECKER) # resultcode=2 will cause the test to skip the diff test - IF (NOT ${resultcode} STREQUAL "2") + if (NOT ${resultcode} STREQUAL "2") ADD_TEST ( NAME H5COPY_F-${testname}-DIFF COMMAND $<TARGET_FILE:h5diff> -q ./testfiles/${infile} ./testfiles/${testname}.out.h5 ${srcname} ${dstname} ) SET_TESTS_PROPERTIES(H5COPY_F-${testname}-DIFF PROPERTIES DEPENDS H5COPY_F-${testname}) - IF (${resultcode} STREQUAL "1") + if (${resultcode} STREQUAL "1") SET_TESTS_PROPERTIES (H5COPY_F-${testname}-DIFF PROPERTIES WILL_FAIL "true") - ENDIF (${resultcode} STREQUAL "1") - ENDIF (NOT ${resultcode} STREQUAL "2") + endif (${resultcode} STREQUAL "1") + endif (NOT ${resultcode} STREQUAL "2") ENDMACRO (ADD_H5_F_TEST) MACRO (ADD_H5_TEST testname resultcode infile vparam sparam srcname dparam dstname) - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) + if (NOT HDF5_ENABLE_USING_MEMCHECKER) # Remove any output file left over from previous test run ADD_TEST ( NAME H5COPY-${testname}-clear-objects @@ -87,35 +87,35 @@ -E remove ./testfiles/${testname}.out.h5 ) - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( NAME H5COPY-${testname} COMMAND $<TARGET_FILE:h5copy> -i ./testfiles/${infile} -o ./testfiles/${testname}.out.h5 ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN} ) - IF (HDF5_ENABLE_USING_MEMCHECKER) - IF (NOT "${last_test}" STREQUAL "") + if (HDF5_ENABLE_USING_MEMCHECKER) + if (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (H5COPY-${testname} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - ELSE (HDF5_ENABLE_USING_MEMCHECKER) + endif (NOT "${last_test}" STREQUAL "") + else (HDF5_ENABLE_USING_MEMCHECKER) SET_TESTS_PROPERTIES (H5COPY-${testname} PROPERTIES DEPENDS H5COPY-${testname}-clear-objects) - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + endif (HDF5_ENABLE_USING_MEMCHECKER) # resultcode=2 will cause the test to skip the diff test - IF (NOT ${resultcode} STREQUAL "2") + if (NOT ${resultcode} STREQUAL "2") ADD_TEST ( NAME H5COPY-${testname}-DIFF COMMAND $<TARGET_FILE:h5diff> -q ./testfiles/${infile} ./testfiles/${testname}.out.h5 ${srcname} ${dstname} ) SET_TESTS_PROPERTIES(H5COPY-${testname}-DIFF PROPERTIES DEPENDS H5COPY-${testname}) - IF (${resultcode} STREQUAL "1") + if (${resultcode} STREQUAL "1") SET_TESTS_PROPERTIES (H5COPY-${testname}-DIFF PROPERTIES WILL_FAIL "true") - ENDIF (${resultcode} STREQUAL "1") - ENDIF (NOT ${resultcode} STREQUAL "2") + endif (${resultcode} STREQUAL "1") + endif (NOT ${resultcode} STREQUAL "2") ENDMACRO (ADD_H5_TEST) MACRO (ADD_H5_TEST2 testname resultcode infile psparam pdparam vparam sparam srcname dparam dstname) - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) + if (NOT HDF5_ENABLE_USING_MEMCHECKER) # Remove any output file left over from previous test run ADD_TEST ( NAME H5COPY-${testname}-clear-objects @@ -123,19 +123,19 @@ -E remove ./testfiles/${testname}.out.h5 ) - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( NAME H5COPY-${testname}-prefill COMMAND $<TARGET_FILE:h5copy> -i ./testfiles/${infile} -o ./testfiles/${testname}.out.h5 -v -s ${psparam} -d ${pdparam} ) - IF (HDF5_ENABLE_USING_MEMCHECKER) - IF (NOT "${last_test}" STREQUAL "") + if (HDF5_ENABLE_USING_MEMCHECKER) + if (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (H5COPY-${testname}-prefill PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - ELSE (HDF5_ENABLE_USING_MEMCHECKER) + endif (NOT "${last_test}" STREQUAL "") + else (HDF5_ENABLE_USING_MEMCHECKER) SET_TESTS_PROPERTIES (H5COPY-${testname}-prefill PROPERTIES DEPENDS H5COPY-${testname}-clear-objects) - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + endif (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( NAME H5COPY-${testname} @@ -143,20 +143,20 @@ ) SET_TESTS_PROPERTIES (H5COPY-${testname} PROPERTIES DEPENDS H5COPY-${testname}-prefill) # resultcode=2 will cause the test to skip the diff test - IF (NOT ${resultcode} STREQUAL "2") + if (NOT ${resultcode} STREQUAL "2") ADD_TEST ( NAME H5COPY-${testname}-DIFF COMMAND $<TARGET_FILE:h5diff> -q ./testfiles/${infile} ./testfiles/${testname}.out.h5 ${srcname} ${dstname} ) SET_TESTS_PROPERTIES(H5COPY-${testname}-DIFF PROPERTIES DEPENDS H5COPY-${testname}) - IF (${resultcode} STREQUAL "1") + if (${resultcode} STREQUAL "1") SET_TESTS_PROPERTIES (H5COPY-${testname}-DIFF PROPERTIES WILL_FAIL "true") - ENDIF (${resultcode} STREQUAL "1") - ENDIF (NOT ${resultcode} STREQUAL "2") + endif (${resultcode} STREQUAL "1") + endif (NOT ${resultcode} STREQUAL "2") ENDMACRO (ADD_H5_TEST2) MACRO (ADD_H5_TEST_SAME testname resultcode pfile psparam pdparam vparam sparam srcname dparam dstname) - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) + if (NOT HDF5_ENABLE_USING_MEMCHECKER) # Remove any output file left over from previous test run ADD_TEST ( NAME H5COPY_SAME-${testname}-clear-objects @@ -164,19 +164,19 @@ -E remove ./testfiles/${testname}.out.h5 ) - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( NAME H5COPY_SAME-${testname}-prefill COMMAND $<TARGET_FILE:h5copy> -i ./testfiles/${pfile} -o ./testfiles/${testname}.out.h5 -v -s ${psparam} -d ${pdparam} ) - IF (HDF5_ENABLE_USING_MEMCHECKER) - IF (NOT "${last_test}" STREQUAL "") + if (HDF5_ENABLE_USING_MEMCHECKER) + if (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (H5COPY_SAME-${testname}-prefill PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - ELSE (HDF5_ENABLE_USING_MEMCHECKER) + endif (NOT "${last_test}" STREQUAL "") + else (HDF5_ENABLE_USING_MEMCHECKER) SET_TESTS_PROPERTIES (H5COPY_SAME-${testname}-prefill PROPERTIES DEPENDS H5COPY_SAME-${testname}-clear-objects) - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + endif (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( NAME H5COPY_SAME-${testname} @@ -184,16 +184,16 @@ ) SET_TESTS_PROPERTIES (H5COPY_SAME-${testname} PROPERTIES DEPENDS H5COPY_SAME-${testname}-prefill) # resultcode=2 will cause the test to skip the diff test - IF (NOT ${resultcode} STREQUAL "2") + if (NOT ${resultcode} STREQUAL "2") ADD_TEST ( NAME H5COPY_SAME-${testname}-DIFF COMMAND $<TARGET_FILE:h5diff> -q ./testfiles/${testname}.out.h5 ./testfiles/${testname}.out.h5 ${srcname} ${dstname} ) SET_TESTS_PROPERTIES(H5COPY_SAME-${testname}-DIFF PROPERTIES DEPENDS H5COPY_SAME-${testname}) - IF (${resultcode} STREQUAL "1") + if (${resultcode} STREQUAL "1") SET_TESTS_PROPERTIES (H5COPY_SAME-${testname}-DIFF PROPERTIES WILL_FAIL "true") - ENDIF (${resultcode} STREQUAL "1") - ENDIF (NOT ${resultcode} STREQUAL "2") + endif (${resultcode} STREQUAL "1") + endif (NOT ${resultcode} STREQUAL "2") ENDMACRO (ADD_H5_TEST_SAME) # @@ -202,15 +202,15 @@ # MACRO (ADD_H5_CMP_TEST testname resultcode infile vparam sparam srcname dparam dstname) # If using memchecker add tests without using scripts - IF (HDF5_ENABLE_USING_MEMCHECKER) + if (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST (NAME H5COPY-CMP-${testname} COMMAND $<TARGET_FILE:h5copy> -i ./testfiles/${infile} -o ./testfiles/${testname}.out.h5 ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN}) - IF (${resultcode} STREQUAL "1") + if (${resultcode} STREQUAL "1") SET_TESTS_PROPERTIES (H5COPY-CMP-${testname} PROPERTIES WILL_FAIL "true") - ENDIF (${resultcode} STREQUAL "1") - IF (NOT "${last_test}" STREQUAL "") + endif (${resultcode} STREQUAL "1") + if (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (H5COPY-CMP-${testname} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - ELSE (HDF5_ENABLE_USING_MEMCHECKER) + endif (NOT "${last_test}" STREQUAL "") + else (HDF5_ENABLE_USING_MEMCHECKER) # Remove any output file left over from previous test run ADD_TEST ( NAME H5COPY-CMP-${testname}-clear-objects @@ -233,7 +233,7 @@ -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) SET_TESTS_PROPERTIES (H5COPY-CMP-${testname} PROPERTIES DEPENDS H5COPY-CMP-${testname}-clear-objects) - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + endif (HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_H5_CMP_TEST) ############################################################################## @@ -245,12 +245,12 @@ # -------------------------------------------------------------------- # test file names # -------------------------------------------------------------------- - SET (HDF_FILE1 h5copytst) - SET (HDF_FILE2 h5copy_ref) - SET (HDF_EXT_SRC_FILE h5copy_extlinks_src) - SET (HDF_EXT_TRG_FILE h5copy_extlinks_trg) + set (HDF_FILE1 h5copytst) + set (HDF_FILE2 h5copy_ref) + set (HDF_EXT_SRC_FILE h5copy_extlinks_src) + set (HDF_EXT_TRG_FILE h5copy_extlinks_trg) - IF (HDF5_ENABLE_USING_MEMCHECKER) + if (HDF5_ENABLE_USING_MEMCHECKER) # Remove any output file left over from previous test run ADD_TEST ( NAME H5COPY-clearall-objects @@ -292,11 +292,11 @@ h5copy_misc1.out.out.err ) SET_TESTS_PROPERTIES (H5COPY-clearall-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") - IF (NOT "${last_test}" STREQUAL "") + if (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (H5COPY-clearall-objects PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5COPY-clearall-objects") - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + endif (NOT "${last_test}" STREQUAL "") + set (last_test "H5COPY-clearall-objects") + endif (HDF5_ENABLE_USING_MEMCHECKER) # "Test copying various forms of datasets" ADD_H5_TEST (simple 0 ${HDF_FILE1}.h5 -v -s simple -d simple) |