Cmake: How to have add_custom_command() run after all project files are built

Viewed 18971

Using Cmake v3.8, I need my custom command to run only after my newly built .hex, .map, and .elf files are produced. However, the command is not truly running after all of the *.hex, *.map, and *.elf files are produced. Here is what I have:

    add_custom_command(
    POST_BUILD
    COMMAND python ${CMAKE_CURRENT_SOURCE_DIR}/performCrc32.py
    WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
    OUTPUT  performCrc32.out
    COMMENT "Running CRC32 check..."
)
add_custom_target(
    performCrc32 ALL
    DEPENDS performCrc32.py
    performCrc32.out
) 

What am I missing, if anything?

1 Answers
Related