add_custom_command: default "Generating ..." message can exceed command length limit
We have a tool that we use to generate a lot of source code. It is effectively a compiler itself, but it takes 1 file in and generates on the order of 12000 files.
If I try to do something like:
add_custom_command(
COMMAND bash /path/to/generate-script
OUTPUT
${FILE_LIST}
)
add_custom_target( GENERATED_TARGETS
DEPENDS ${FILE_LIST}
)
I end up with: execvp: /bin/sh: Argument list too long
Looking at the makefile:
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --blue --bold --progress-dir=/my/cmake/path --progress-num=$(CMAKE_PROGRESS_1) "Generating ..."
Where the ... is the list of >12k files. It looks like execvp has a limit of 28k some characters.
Possible solutions:
- Add a way to silence the Generating... bit so that it isn't trying to display a bunch of text
- Tell me I am doing this wrong and should instead use a different idiom for code generation