Skip to content

Commit

Permalink
[dump] improve dump
Browse files Browse the repository at this point in the history
  • Loading branch information
jcelerier committed Sep 23, 2024
1 parent 075726b commit 5661e7b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
15 changes: 7 additions & 8 deletions cmake/avendish.dump.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,16 @@ function(avnd_make_dump)
Avendish::Avendish_dump nlohmann_json::nlohmann_json
)

set(_dump_file_path "dump/$<IF:${multi_config},$<CONFIG>/,>${AVND_TARGET}.json")
add_custom_command(
TARGET ${AVND_FX_TARGET}
COMMAND ${AVND_FX_TARGET} "dump/$<IF:${multi_config},$<CONFIG>/,>${AVND_TARGET}.json"
POST_BUILD
)
add_custom_command(
OUTPUT "dump/$<IF:${multi_config},$<CONFIG>/,>${AVND_TARGET}.json"
COMMAND ${AVND_FX_TARGET} "dump/$<IF:${multi_config},$<CONFIG>/,>${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/$<IF:${multi_config},$<CONFIG>/,>${AVND_TARGET}.json"
AVND_DUMP_PATH "${_dump_file_path}"
)

avnd_common_setup("${AVND_TARGET}" "${AVND_FX_TARGET}")
Expand Down
9 changes: 7 additions & 2 deletions cmake/avendish.max.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -181,10 +181,15 @@ function(avnd_make_max)
set(_maxref_template "${AVND_SOURCE_DIR}/examples/Demos/maxref_template.xml")
set(_maxref_destination "max/$<IF:${multi_config},$<CONFIG>/,>${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}"
Expand Down

0 comments on commit 5661e7b

Please sign in to comment.