Aaron Turner wrote:
From the docs, it sounded like this only worked when adding commands
to existing targets, not for creating new ones.
Correct, as Eric already pointed out. You need to create the target
first with add_custom_target.
My testing though seems to show that the correct usage is actually:
add_custom_command(foo ...)
if you use:
add_custom_command(TARGET foo ...)
then the target name (verified by 'make help') is called "TARGET", not "foo"
That's... interesting. The doc says:
add_custom_command(TARGET target
PRE_BUILD | PRE_LINK | POST_BUILD
COMMAND command1 [ARGS] [args1...]
[COMMAND command2 [ARGS] [args2...] ...]
[WORKING_DIRECTORY dir]
[COMMENT comment] [VERBATIM])
...but that's creating a target named "TARGET"? If so it would seem to
be a bug (either in cmake or in the doc; either way it would be good if
you could confirm this, and if it isn't working according to the doc,
file a bug report).
--
Matthew
Please do not quote my e-mail address unobfuscated in message bodies.
--
We are Microsoft. What you are experiencing is not a problem; it is an
undocumented feature. -- Unknown (from fortune's bofh-excuses)
_______________________________________________
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