[CMake] setting executable runtime command line argument

David Cole david.cole at kitware.com
Mon Oct 1 15:27:44 EDT 2012


See USERFILE_COMMAND_ARGUMENTS_DEBUG in this Stack Overflow question &
answer:


http://stackoverflow.com/questions/1005901/how-to-set-path-environment-variable-using-cmake-and-visual-studio-to-run-test

Also, be sure to read all the comments, too. There are helpful tips in
there about what versions of Visual Studio this works with, and the fact
that VS overwrites the user files on exit, so be sure to use this technique
when VS is not open while you are running CMake......


HTH,
David


On Mon, Oct 1, 2012 at 2:15 PM, Anton Deguet <anton.deguet at jhu.edu> wrote:

> Hello,
>
> I am wondering if there is a target property for executable to set a
> command line argument.  I did a bit of googling but I might have missed it.
>
> Something like:
>
> add_executable (myProgram main.cpp)
> set_target_properties (myProgram COMMAND_LINE_ARGUMENTS "--verbose --run")
>
> This would set the command line options for debugging for most supported
> IDE (Visual Studio, XCode, ...).
>
> Sincerely,
>
> Anton
>
>
>
>
> --
>
> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20121001/6c0c3fa6/attachment.htm>


More information about the CMake mailing list