What is the post build command in CMake?
You should be able to attach the post-build actions to the gen_project_binary target or the application target (which is the high-level target that compiles all parts related to the application, but not the bootloader, partition table, etc. ). app depends on gen_project_binary among other things.
Table of Contents
When to use the option depends on CMake?
The DEPENDS option specifies the files that the command depends on. If any dependency is an OUTPUT of another custom command in the same directory (CMakeLists.txt file), CMake automatically brings the other custom command to the target where this command is created.
How to add a custom command in CMake 3.20.2?
Don’t list the output in more than one separate target that can be compiled in parallel or the two instances of the rule may conflict (instead use the add_custom_target() command to boost the command and make the other targets dependent on that). In makefile terms, this creates a new destination in the following way:
When to add target level dependency in CMake?
Whenever a target is used as a command to run or is mentioned in a factory expression as a command argument, a target-level dependency will be automatically added so that the named target is built before any targets that use this custom command.
How to add a custom target in CMake 3.2?
By default, nothing depends on the custom goal. Use the add_dependencies() command to add dependencies to or from other destinations. Indicate that this target should be added to the default build target to be executed every time (the command cannot be called ALL ). New in version 3.2.
Where to find custom command calls in CMake?
Reference files and outputs of custom commands created with add_custom_command() command calls in the same directory (CMakeLists.txt file). They will be updated when the target is built.
Why doesn’t the CMake target cross-compile?
The target is not being cross-compiled (that is, the CMAKE_CROSSCOMPILING variable is not set to true). New in version 3.6: The target is cross-compiled and an emulator is provided (ie its CROSSCOMPILING_EMULATOR target property is set).