I have a script, performCrc32.py, which I want to call after my build has completed. I've modified my CMakeLists.txt file in order to have the build fork to performCrc32.py, however, my script is not executing. Here are my Cmake commands:
add_custom_command(
DEPENDS performCrc32.py
OUTPUT performCrc32.out
COMMAND ${PYTHON_EXECUTABLE}
ARGS performCrc32.py
)
add_custom_target(
performCrc32 ALL
)
The compiler is not complaining, however, my Python (2.7.10) script is not executing. I'm not quite sure what is missing from my calls to add_custom_command() and add_custom_target(). Perhaps there's a more straightforward approach? What am I missing?
I have even tried this, but to no avail:
add_custom_command(
DEPENDS performCrc32.py
OUTPUT performCrc32.out
COMMAND python ${CMAKE_CURRENT_SOURCE_DIR}/performCrc32.py
POST_BUILD
COMMENT "Running CRC32 check"
)
add_custom_target(
performCrc32
DEPENDS performCrc32.py
performCrc32.out
)
I was able to solve the problem. Thank you to all who helped and contributed such great ideas:
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
)