diff --git a/cmake/avendish.dump.cmake b/cmake/avendish.dump.cmake index 8461d208..0870edd1 100644 --- a/cmake/avendish.dump.cmake +++ b/cmake/avendish.dump.cmake @@ -44,17 +44,16 @@ function(avnd_make_dump) Avendish::Avendish_dump nlohmann_json::nlohmann_json ) + set(_dump_file_path "dump/$/,>${AVND_TARGET}.json") add_custom_command( - TARGET ${AVND_FX_TARGET} - COMMAND ${AVND_FX_TARGET} "dump/$/,>${AVND_TARGET}.json" - POST_BUILD - ) - add_custom_command( - OUTPUT "dump/$/,>${AVND_TARGET}.json" - COMMAND ${AVND_FX_TARGET} "dump/$/,>${AVND_TARGET}.json" + DEPENDS ${AVND_FX_TARGET} + COMMAND ${AVND_FX_TARGET} "${_dump_file_path}" + OUTPUT "${_dump_file_path}" + VERBATIM ) + set_target_properties(${AVND_TARGET} PROPERTIES - AVND_DUMP_PATH "dump/$/,>${AVND_TARGET}.json" + AVND_DUMP_PATH "${_dump_file_path}" ) avnd_common_setup("${AVND_TARGET}" "${AVND_FX_TARGET}") diff --git a/cmake/avendish.max.cmake b/cmake/avendish.max.cmake index 2426eaf5..eeed8b8b 100644 --- a/cmake/avendish.max.cmake +++ b/cmake/avendish.max.cmake @@ -181,10 +181,15 @@ function(avnd_make_max) set(_maxref_template "${AVND_SOURCE_DIR}/examples/Demos/maxref_template.xml") set(_maxref_destination "max/$/,>${AVND_C_NAME}.maxref.xml") add_custom_command( - TARGET ${AVND_FX_TARGET} COMMAND json_to_maxref "${_maxref_template}" "${_dump_path}" "${_maxref_destination}" - POST_BUILD + DEPENDS "${_dump_path}" + OUTPUT "${_maxref_destination}" ) + add_custom_target(dump_maxref_${AVND_FX_TARGET} ALL + DEPENDS + "${_dump_file_path}" + ${AVND_FX_TARGET} + ) set_target_properties(${AVND_FX_TARGET} PROPERTIES AVND_MAX_MAXREF_XML "${_maxref_destination}"