I need to somehow generate .fidl files based on .cpp and .hpp files.
The problem is that if I try to use add_custom_target it runs every time.
For add_custom_command I need specify output files, but I do not want to do it.
I'd like to do something like this:
add_custom_command(gen_fidl
DEPENDS "*.fidl"
COMMAND <My Commands>)
But in this case I need specify a rule for .fidl files
How would I be able to do something like this?
I've found the following solution:
add_custom_command(
OUTPUT fidl_generated_successfully
DEPENDS ./cmake-build-debug/*.fidl
COMMAND touch fidl_generated_successfully
COMMAND <COMMAND TO DO>)
add_custom_target(
fidl_gen
DEPENDS fidl_generated_successfully)
add_dependencies(${PROJECT_NAME} fidl_gen)
But the issue there is the generation on the file (fidl_generated_successfully). Are there anywhere better solution without creating useless file fidl_generated_successfully
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With