I'd like to do something like add_custom_command, with the output file
name as a target in the generated makefile. Is there an elegant way of
doing this?
The closest I've come is:
add_executable (hello hello.c)
add_custom_command(OUTPUT hello.bin
COMMAND objcopy
The target in the Makefile is created with the add_custom_target()
call. So just change yours to:
add_custom_target(hello.bin ALL DEPENDS hello.bin)
hth,
tyler
On Fri, Mar 11, 2011 at 7:58 AM, Jim Newsome jnews...@cmu.edu wrote:
I'd like to do something like add_custom_command, with the output
Unfortunately it seems that the target needs to have a different name
from its dependencies. When building I get:
make[2]: Circular CMakeFiles/hello.bin - hello.bin dependency dropped.
Another workaround I thought of is to change the output filename to,
e.g., _hello.bin and have a command in the
On Fri, Mar 11, 2011 at 12:05 PM, Jim Newsome jnews...@cmu.edu wrote:
Unfortunately it seems that the target needs to have a different name
from its dependencies. When building I get:
make[2]: Circular CMakeFiles/hello.bin - hello.bin dependency dropped.
Another workaround I thought of is to
On 03/11/2011 08:00 PM, David Cole wrote:
On Fri, Mar 11, 2011 at 12:05 PM, Jim Newsome jnews...@cmu.edu wrote:
Unfortunately it seems that the target needs to have a different name
from its dependencies. When building I get:
make[2]: Circular CMakeFiles/hello.bin - hello.bin dependency
That doesn't quite work either. I get some errors about circular
dependencies. Strangely, doing it this way hello.bin _does_ get built,
but it gets built every time, even if 'hello' hasn't changed.
I imagine this behavior could depend on the build system- I'm using
GNU make 3.81.
Here's what I
On 03/11/2011 09:41 PM, Jim Newsome wrote:
That doesn't quite work either. I get some errors about circular
dependencies. Strangely, doing it this way hello.bin _does_ get built,
Yes, I can see these messages - not errors - too, but obviously, they
don't prevent the hello.bin file from being