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

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
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