diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2016-08-01 17:35:00 (GMT) |
---|---|---|
committer | Allen Byrne <byrn@hdfgroup.org> | 2016-08-01 17:35:00 (GMT) |
commit | e55844b7523676c381eb22f638369a794021d798 (patch) | |
tree | 9121dc5ee07215bc6389dc8bcf61e96b4040e69f /tools/h5dump | |
parent | 1494413413932f1e640815d109fd1e8386bab3f9 (diff) | |
download | hdf5-e55844b7523676c381eb22f638369a794021d798.zip hdf5-e55844b7523676c381eb22f638369a794021d798.tar.gz hdf5-e55844b7523676c381eb22f638369a794021d798.tar.bz2 |
[svn-r30237] HDFFV-9939: Change cmake commands to reduce POST_BUILD custom commands. Fixes possible overruns on windows command lines.
Diffstat (limited to 'tools/h5dump')
-rw-r--r-- | tools/h5dump/CMakeTests.cmake | 49 | ||||
-rw-r--r-- | tools/h5dump/CMakeTestsPBITS.cmake | 32 | ||||
-rw-r--r-- | tools/h5dump/CMakeTestsVDS.cmake | 36 | ||||
-rw-r--r-- | tools/h5dump/CMakeTestsXML.cmake | 23 |
4 files changed, 26 insertions, 114 deletions
diff --git a/tools/h5dump/CMakeTests.cmake b/tools/h5dump/CMakeTests.cmake index a5de05e..e376b50 100644 --- a/tools/h5dump/CMakeTests.cmake +++ b/tools/h5dump/CMakeTests.cmake @@ -329,14 +329,7 @@ # foreach (tst_h5_file ${HDF5_REFERENCE_TEST_FILES}) get_filename_component (fname "${tst_h5_file}" NAME) - set (dest "${PROJECT_BINARY_DIR}/testfiles/std/${fname}") - #message (STATUS " Copying ${tst_h5_file}") - add_custom_command ( - TARGET h5dump - POST_BUILD - COMMAND ${CMAKE_COMMAND} - ARGS -E copy_if_different ${tst_h5_file} ${dest} - ) + HDFTEST_COPY_FILE("${tst_h5_file}" "${PROJECT_BINARY_DIR}/testfiles/std/${fname}" "h5dump_std_files") endforeach (tst_h5_file ${HDF5_REFERENCE_TEST_FILES}) foreach (tst_exp_file ${HDF5_REFERENCE_EXP_FILES}) @@ -344,60 +337,32 @@ file (READ ${HDF5_TOOLS_SRC_DIR}/testfiles/${tst_exp_file} TEST_STREAM) file (WRITE ${PROJECT_BINARY_DIR}/testfiles/std/${tst_exp_file} "${TEST_STREAM}") else (WIN32) - add_custom_command ( - TARGET h5dump - POST_BUILD - COMMAND ${CMAKE_COMMAND} - ARGS -E copy_if_different ${HDF5_TOOLS_SRC_DIR}/testfiles/${tst_exp_file} ${PROJECT_BINARY_DIR}/testfiles/std/${tst_exp_file} - ) + HDFTEST_COPY_FILE("${HDF5_TOOLS_SRC_DIR}/testfiles/${tst_exp_file}" "${PROJECT_BINARY_DIR}/testfiles/std/${tst_exp_file}" "h5dump_std_files") endif (WIN32) endforeach (tst_exp_file ${HDF5_REFERENCE_EXP_FILES}) foreach (tst_other_file ${HDF5_REFERENCE_FILES}) get_filename_component (fname "${tst_other_file}" NAME) - set (dest "${PROJECT_BINARY_DIR}/testfiles/std/${fname}") - #message (STATUS " Copying ${tst_other_file}") - add_custom_command ( - TARGET h5dump - POST_BUILD - COMMAND ${CMAKE_COMMAND} - ARGS -E copy_if_different ${tst_other_file} ${dest} - ) + HDFTEST_COPY_FILE("${tst_other_file}" "${PROJECT_BINARY_DIR}/testfiles/std/${fname}" "h5dump_std_files") endforeach (tst_other_file ${HDF5_REFERENCE_FILES}) foreach (tst_error_file ${HDF5_ERROR_REFERENCE_TEST_FILES}) get_filename_component (fname "${tst_error_file}" NAME) - set (dest "${PROJECT_BINARY_DIR}/testfiles/std/${fname}") - #message (STATUS " Copying ${tst_error_file}") - add_custom_command ( - TARGET h5dump - POST_BUILD - COMMAND ${CMAKE_COMMAND} - ARGS -E copy_if_different ${tst_error_file} ${dest} - ) + HDFTEST_COPY_FILE("${tst_error_file}" "${PROJECT_BINARY_DIR}/testfiles/std/${fname}" "h5dump_std_files") endforeach (tst_error_file ${HDF5_ERROR_REFERENCE_TEST_FILES}) # -------------------------------------------------------------------- # Special file handling # -------------------------------------------------------------------- - add_custom_command ( - TARGET h5dump - POST_BUILD - COMMAND ${CMAKE_COMMAND} - ARGS -E copy_if_different ${HDF5_TOOLS_SOURCE_DIR}/testfiles/tbin1.ddl ${PROJECT_BINARY_DIR}/testfiles/std/tbin1LE.ddl - ) + HDFTEST_COPY_FILE("${HDF5_TOOLS_SOURCE_DIR}/testfiles/tbin1.ddl" "${PROJECT_BINARY_DIR}/testfiles/std/tbin1LE.ddl" "h5dump_std_files") if (WIN32) file (READ ${HDF5_TOOLS_SRC_DIR}/testfiles/tbinregR.exp TEST_STREAM) file (WRITE ${PROJECT_BINARY_DIR}/testfiles/std/tbinregR.exp "${TEST_STREAM}") else (WIN32) - add_custom_command ( - TARGET h5dump - POST_BUILD - COMMAND ${CMAKE_COMMAND} - ARGS -E copy_if_different ${HDF5_TOOLS_SRC_DIR}/testfiles/tbinregR.exp ${PROJECT_BINARY_DIR}/testfiles/std/tbinregR.exp - ) + HDFTEST_COPY_FILE("${HDF5_TOOLS_SRC_DIR}/testfiles/tbinregR.exp" "${PROJECT_BINARY_DIR}/testfiles/std/tbinregR.exp" "h5dump_std_files") endif (WIN32) + add_custom_target(h5dump_std_files ALL COMMENT "Copying files needed by h5dump_std tests" DEPENDS ${h5dump_std_files_list}) ############################################################################## ############################################################################## diff --git a/tools/h5dump/CMakeTestsPBITS.cmake b/tools/h5dump/CMakeTestsPBITS.cmake index 14f282a..28514fb 100644 --- a/tools/h5dump/CMakeTestsPBITS.cmake +++ b/tools/h5dump/CMakeTestsPBITS.cmake @@ -87,40 +87,20 @@ foreach (pbits_h5_file ${HDF5_REFERENCE_TEST_PBITS}) get_filename_component(fname "${pbits_h5_file}" NAME) - set (dest "${PROJECT_BINARY_DIR}/testfiles/pbits/${fname}") - #message (STATUS " Copying ${pbits_h5_file}") - add_custom_command ( - TARGET h5dump - POST_BUILD - COMMAND ${CMAKE_COMMAND} - ARGS -E copy_if_different ${pbits_h5_file} ${dest} - ) + HDFTEST_COPY_FILE("${pbits_h5_file}" "${PROJECT_BINARY_DIR}/testfiles/pbits/${fname}" "h5dump_pbits_files") endforeach (pbits_h5_file ${HDF5_REFERENCE_TEST_PBITS}) foreach (ddl_pbits ${HDF5_REFERENCE_PBITS}) get_filename_component(fname "${ddl_pbits}" NAME) - set (ddldest "${PROJECT_BINARY_DIR}/testfiles/pbits/${fname}") - #message (STATUS " Copying ${ddl_pbits}") - add_custom_command ( - TARGET h5dump - POST_BUILD - COMMAND ${CMAKE_COMMAND} - ARGS -E copy_if_different ${HDF5_TOOLS_SRC_DIR}/testfiles/pbits/${ddl_pbits} ${ddldest} - ) + HDFTEST_COPY_FILE("${HDF5_TOOLS_SRC_DIR}/testfiles/pbits/${ddl_pbits}" "${PROJECT_BINARY_DIR}/testfiles/pbits/${fname}" "h5dump_pbits_files") endforeach (ddl_pbits ${HDF5_REFERENCE_PBITS}) foreach (ddl_pbits ${HDF5_ERROR_REFERENCE_PBITS}) get_filename_component(fname "${ddl_pbits}" NAME) - set (ddldest "${PROJECT_BINARY_DIR}/testfiles/pbits/${fname}") - #message (STATUS " Copying ${ddl_pbits}") - add_custom_command ( - TARGET h5dump - POST_BUILD - COMMAND ${CMAKE_COMMAND} - ARGS -E copy_if_different ${PROJECT_SOURCE_DIR}/errfiles/${ddl_pbits} ${ddldest} - ) + HDFTEST_COPY_FILE("${PROJECT_SOURCE_DIR}/errfiles/${ddl_pbits}" "${PROJECT_BINARY_DIR}/testfiles/pbits/${fname}" "h5dump_pbits_files") endforeach (ddl_pbits ${HDF5_ERROR_REFERENCE_PBITS}) + add_custom_target(h5dump_pbits_files ALL COMMENT "Copying files needed by h5dump_pbits tests" DEPENDS ${h5dump_pbits_files_list}) ############################################################################## ############################################################################## @@ -135,10 +115,10 @@ set_tests_properties (H5DUMP-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/pbits") if (NOT ${resultcode} STREQUAL "0") set_tests_properties (H5DUMP-${resultfile} PROPERTIES WILL_FAIL "true") - endif (NOT ${resultcode} STREQUAL "0") + endif () if (NOT "${last_pbits_test}" STREQUAL "") set_tests_properties (H5DUMP-${resultfile} PROPERTIES DEPENDS ${last_pbits_test}) - endif (NOT "${last_pbits_test}" STREQUAL "") + endif () else (HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5DUMP-${resultfile}-clear-objects diff --git a/tools/h5dump/CMakeTestsVDS.cmake b/tools/h5dump/CMakeTestsVDS.cmake index dcb90e0..68a62e8 100644 --- a/tools/h5dump/CMakeTestsVDS.cmake +++ b/tools/h5dump/CMakeTestsVDS.cmake @@ -66,40 +66,20 @@ foreach (vds_h5_file ${HDF5_REFERENCE_TEST_VDS}) get_filename_component(fname "${vds_h5_file}" NAME) - set (dest "${PROJECT_BINARY_DIR}/testfiles/vds/${fname}") - #message (STATUS " Copying ${vds_h5_file}") - add_custom_command ( - TARGET h5dump - POST_BUILD - COMMAND ${CMAKE_COMMAND} - ARGS -E copy_if_different ${HDF5_TOOLS_SRC_DIR}/testfiles/vds/${vds_h5_file} ${dest} - ) + HDFTEST_COPY_FILE("${HDF5_TOOLS_SRC_DIR}/testfiles/vds/${vds_h5_file}" "${PROJECT_BINARY_DIR}/testfiles/vds/${fname}" "h5dump_vds_files") endforeach (vds_h5_file ${HDF5_REFERENCE_TEST_VDS}) foreach (ddl_vds ${HDF5_REFERENCE_VDS}) get_filename_component(fname "${ddl_vds}" NAME) - set (ddldest "${PROJECT_BINARY_DIR}/testfiles/vds/${fname}") - #message (STATUS " Copying ${ddl_vds}") - add_custom_command ( - TARGET h5dump - POST_BUILD - COMMAND ${CMAKE_COMMAND} - ARGS -E copy_if_different ${HDF5_TOOLS_SRC_DIR}/testfiles/vds/${ddl_vds} ${ddldest} - ) + HDFTEST_COPY_FILE("${HDF5_TOOLS_SRC_DIR}/testfiles/vds/${ddl_vds}" "${PROJECT_BINARY_DIR}/testfiles/vds/${fname}" "h5dump_vds_files") endforeach (ddl_vds ${HDF5_REFERENCE_VDS}) foreach (ddl_vds ${HDF5_ERROR_REFERENCE_VDS}) get_filename_component(fname "${ddl_vds}" NAME) - set (ddldest "${PROJECT_BINARY_DIR}/testfiles/vds/${fname}") - #message (STATUS " Copying ${ddl_vds}") - add_custom_command ( - TARGET h5dump - POST_BUILD - COMMAND ${CMAKE_COMMAND} - ARGS -E copy_if_different ${PROJECT_SOURCE_DIR}/errfiles/${ddl_vds} ${ddldest} - ) + HDFTEST_COPY_FILE("${PROJECT_SOURCE_DIR}/errfiles/${ddl_vds}" "${PROJECT_BINARY_DIR}/testfiles/vds/${fname}" "h5dump_vds_files") endforeach (ddl_vds ${HDF5_ERROR_REFERENCE_VDS}) + add_custom_target(h5dump_vds_files ALL COMMENT "Copying files needed by h5dump_vds tests" DEPENDS ${h5dump_vds_files_list}) ############################################################################## ############################################################################## @@ -114,10 +94,10 @@ set_tests_properties (H5DUMP-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/vds") if (NOT ${resultcode} STREQUAL "0") set_tests_properties (H5DUMP-${resultfile} PROPERTIES WILL_FAIL "true") - endif (NOT ${resultcode} STREQUAL "0") + endif () if (NOT "${last_vds_test}" STREQUAL "") set_tests_properties (H5DUMP-${resultfile} PROPERTIES DEPENDS ${last_VDS_test}) - endif (NOT "${last_vds_test}" STREQUAL "") + endif () else (HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5DUMP-${resultfile}-clear-objects @@ -147,10 +127,10 @@ set_tests_properties (H5DUMP-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/vds") if (NOT ${resultcode} STREQUAL "0") set_tests_properties (H5DUMP-${resultfile} PROPERTIES WILL_FAIL "true") - endif (NOT ${resultcode} STREQUAL "0") + endif () if (NOT "${last_vds_test}" STREQUAL "") set_tests_properties (H5DUMP-${resultfile} PROPERTIES DEPENDS ${last_VDS_test}) - endif (NOT "${last_vds_test}" STREQUAL "") + endif () else (HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5DUMP-${resultfile}-clear-objects diff --git a/tools/h5dump/CMakeTestsXML.cmake b/tools/h5dump/CMakeTestsXML.cmake index afb1df6..6e8dd15 100644 --- a/tools/h5dump/CMakeTestsXML.cmake +++ b/tools/h5dump/CMakeTestsXML.cmake @@ -129,27 +129,14 @@ foreach (tst_xml_h5_file ${HDF5_XML_REFERENCE_TEST_FILES}) get_filename_component(fname "${tst_xml_h5_file}" NAME) - set (dest "${PROJECT_BINARY_DIR}/testfiles/xml/${fname}") - #message (STATUS " Copying ${tst_xml_h5_file}") - add_custom_command ( - TARGET h5dump - POST_BUILD - COMMAND ${CMAKE_COMMAND} - ARGS -E copy_if_different ${tst_xml_h5_file} ${dest} - ) + HDFTEST_COPY_FILE("${tst_xml_h5_file}" "${PROJECT_BINARY_DIR}/testfiles/xml/${fname}" "h5dump_xml_files") endforeach (tst_xml_h5_file ${HDF5_XML_REFERENCE_TEST_FILES}) foreach (tst_xml_other_file ${HDF5_XML_REFERENCE_FILES}) get_filename_component(fname "${tst_xml_other_file}" NAME) - set (dest "${PROJECT_BINARY_DIR}/testfiles/xml/${fname}") - #message (STATUS " Copying ${tst_xml_other_file}") - add_custom_command ( - TARGET h5dump - POST_BUILD - COMMAND ${CMAKE_COMMAND} - ARGS -E copy_if_different ${tst_xml_other_file} ${dest} - ) + HDFTEST_COPY_FILE("${tst_xml_other_file}" "${PROJECT_BINARY_DIR}/testfiles/xml/${fname}" "h5dump_xml_files") endforeach (tst_xml_other_file ${HDF5_XML_REFERENCE_FILES}) + add_custom_target(h5dump_xml_files ALL COMMENT "Copying files needed by h5dump_xml tests" DEPENDS ${h5dump_xml_files_list}) ############################################################################## ############################################################################## @@ -176,10 +163,10 @@ set_tests_properties (H5DUMP-XML-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/xml") if (NOT ${resultcode} STREQUAL "0") set_tests_properties (H5DUMP-XML-${resultfile} PROPERTIES WILL_FAIL "true") - endif (NOT ${resultcode} STREQUAL "0") + endif () if (NOT "${last_xml_test}" STREQUAL "") set_tests_properties (H5DUMP-XML-${resultfile} PROPERTIES DEPENDS ${last_xml_test}) - endif (NOT "${last_xml_test}" STREQUAL "") + endif () else (HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5DUMP-XML-${resultfile}-clear-objects |