summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2018-11-12 19:45:05 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2018-11-12 19:45:05 (GMT)
commitc2ceeb02b67c182caa62a0488f26fed0d19cd250 (patch)
tree3973407a40249d796020da1bdcb7a716050ce526
parent6a2e97bead3c4d366f28b6a1e4e338fc07014954 (diff)
parent7e204759f861f4f482db2032127a4dc406fcd1d6 (diff)
downloadhdf5-c2ceeb02b67c182caa62a0488f26fed0d19cd250.zip
hdf5-c2ceeb02b67c182caa62a0488f26fed0d19cd250.tar.gz
hdf5-c2ceeb02b67c182caa62a0488f26fed0d19cd250.tar.bz2
Merge pull request #1327 in HDFFV/hdf5 from ~BYRN/hdf5_adb:develop to develop
* commit '7e204759f861f4f482db2032127a4dc406fcd1d6': Fix generate file commands Fix target depends Fix target files for commands
-rw-r--r--src/CMakeLists.txt16
-rw-r--r--tools/test/h5dump/CMakeTests.cmake4
2 files changed, 13 insertions, 7 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 376260e..31a38be 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -947,23 +947,29 @@ if (NOT EXISTS ${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c)
${HDF5_BINARY_DIR}/${HDF5_BATCH_H5DETECT_SCRIPT} ESCAPE_QUOTES @ONLY
)
add_custom_command (
- OUTPUT ${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c
+ OUTPUT ${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.tmp
COMMAND ${HDF5_BATCH_CMD}
ARGS ${HDF5_BINARY_DIR}/${HDF5_BATCH_H5DETECT_SCRIPT}
DEPENDS H5detect
WORKING_DIRECTORY ${HDF5_GENERATED_SOURCE_DIR}
)
- set_source_files_properties (${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c PROPERTIES GENERATED TRUE)
else ()
add_custom_command (
- OUTPUT ${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c
+ OUTPUT ${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.tmp
COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR}$<TARGET_FILE:H5detect>
- ARGS ${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c
+ ARGS ${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.tmp
DEPENDS H5detect
WORKING_DIRECTORY ${HDF5_GENERATED_SOURCE_DIR}
)
- set_source_files_properties (${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c PROPERTIES GENERATED TRUE)
endif ()
+ add_custom_target (gen_H5Tinit ALL DEPENDS ${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.tmp)
+ add_custom_command (
+ OUTPUT ${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c
+ COMMAND ${CMAKE_COMMAND}
+ ARGS -E copy_if_different "${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.tmp" "${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c"
+ DEPENDS gen_H5Tinit ${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.tmp
+ )
+ set_source_files_properties (${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c PROPERTIES GENERATED TRUE)
endif ()
if (BUILD_SHARED_LIBS)
add_custom_command (
diff --git a/tools/test/h5dump/CMakeTests.cmake b/tools/test/h5dump/CMakeTests.cmake
index b02dc35..382e664 100644
--- a/tools/test/h5dump/CMakeTests.cmake
+++ b/tools/test/h5dump/CMakeTests.cmake
@@ -750,10 +750,10 @@
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
set_tests_properties (H5DUMP-IMPORT-${resultfile} PROPERTIES DEPENDS "H5DUMP-IMPORT-${resultfile}-clear-objects")
- add_test (NAME H5DUMP-IMPORT-h5import-${resultfile} COMMAND h5import ${resultfile}.bin -c ${conffile}.out -o ${resultfile}.h5)
+ add_test (NAME H5DUMP-IMPORT-h5import-${resultfile} COMMAND $<TARGET_FILE:h5import> ${resultfile}.bin -c ${conffile}.out -o ${resultfile}.h5)
set_tests_properties (H5DUMP-IMPORT-h5import-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std")
set_tests_properties (H5DUMP-IMPORT-h5import-${resultfile} PROPERTIES DEPENDS H5DUMP-IMPORT-${resultfile})
- add_test (NAME H5DUMP-IMPORT-h5diff-${resultfile} COMMAND h5diff ${testfile} ${resultfile}.h5 /integer /integer)
+ add_test (NAME H5DUMP-IMPORT-h5diff-${resultfile} COMMAND $<TARGET_FILE:h5diff> ${testfile} ${resultfile}.h5 /integer /integer)
set_tests_properties (H5DUMP-IMPORT-h5diff-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std")
set_tests_properties (H5DUMP-IMPORT-h5diff-${resultfile} PROPERTIES DEPENDS H5DUMP-IMPORT-h5import-${resultfile})
endif ()