I've multiple executable targets depending on a custom target that invokes another executable target:
add_executable(MyTool  ${MyTool_SOURCES})
add_custom_target(PreBuildCommands ALL COMMAND "java" "-jar"
                                       "../BuildNumberUpdater.jar"
${GENERATED_SOURCES} COMMAND MyTool DEPENDS ${SOURCES} ${LIB_TO_LINK}
                                       COMMENT "Changing the build number")

add_executable(${TARGET_NAME1} ${SOURCES} ${GENERATED_SOURCES})
add_dependencies(${TARGET_NAME1} MyTool PreBuildCommands)

add_executable(${TARGET_NAME2} ${SOURCES} ${GENERATED_SOURCES})
add_dependencies(${TARGET_NAME2} MyTool PreBuildCommands)

I'd like, or better I need, that when the building of MyTool fails the other dependent targets won't build or fails their build too.
How could I achieve that?


_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to