[CMake] Complex command

Magnus Therning magnus at therning.org
Fri Aug 6 14:12:58 EDT 2010


I was trying to put something like this into a CMake file:

add_custom_command( ...
    COMMAND ...
    COMMAND ([[ -f foo ]] || ln -sf foo bar); true
    )

But CMake won't have it.  Skipping the sub-shell is all right with CMake:

add_custom_command( ...
    COMMAND ...
    COMMAND [[ -f foo ]] || ln -sf foo bar
    )

But then make doesn't like it if the file doesn't exist, it exits with an
error.

I put the command in an external shell script instead, but would rather
not do
that.

Any suggestions?

/M

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 262 bytes
Desc: OpenPGP digital signature
URL: <http://www.cmake.org/pipermail/cmake/attachments/20100806/88e6f345/attachment.pgp>


More information about the CMake mailing list