Fix embed dependency

add_custom_command DEPENDS can only see the output of other commands or targets names, not the targets installation through ExternalProject_Add.
Add the `embed` target (created by `ExternalProject_Add`) as a dependency for commands using the utility
This commit is contained in:
Clément Grégoire
2025-07-18 15:23:18 +02:00
parent 2f17e33851
commit 3f5d07ebd7

View File

@@ -49,7 +49,7 @@ function(Embed LIST NAME FILE)
add_custom_command(
OUTPUT data/${NAME}.cpp data/${NAME}.hpp
COMMAND ${CMAKE_CURRENT_BINARY_DIR}/embed ${NAME} ${CMAKE_CURRENT_LIST_DIR}/${FILE} data/${NAME}
DEPENDS data ${CMAKE_CURRENT_BINARY_DIR}/embed ${CMAKE_CURRENT_LIST_DIR}/${FILE}
DEPENDS data embed ${CMAKE_CURRENT_LIST_DIR}/${FILE}
)
list(APPEND ${LIST} data/${NAME}.cpp)
return(PROPAGATE ${LIST})