add_custom_command - Signature - Build Events
Hello,
on Linux the build events
PRE_LINK, PRE_BUILD, POST_BUILD
are executed after linking.
For POST_BUILD this is what the user would expect, but for PRE_LINK and PRE_BUILD?
CMake build output of my test case
[ 98%] Building C object source/extra/uconv/CMakeFiles/uconv.dir/uwmsg.c.o
[ 98%] Building CXX object source/extra/uconv/CMakeFiles/uconv.dir/uconv.cpp.o
[100%] Linking CXX executable ../../../x64/uconv
Running PRE_BUILD action
I am prebuilt to actual target
Running PRE_LINK action
I am prelinked to actual target
Running POST_BUILD action
I postbuild to actual target
add_custom_command(
TARGET ${TARGET_UCONV}
PRE_LINK
COMMAND ${CMAKE_COMMAND} -E echo I am prelinked to actual target
COMMENT " Running PRE_LINK action "
)
add_custom_command(
TARGET ${TARGET_UCONV}
PRE_BUILD
COMMAND ${CMAKE_COMMAND} -E echo I am prebuilt to actual target
COMMENT " Running PRE_BUILD action"
)
add_custom_command(
TARGET ${TARGET_UCONV}
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E echo I postbuild to actual target
COMMENT " Running POST_BUILD action "
)
Edited by Brad King