[cmake-developers] Controlling CMake GUI source/build directory from CLI

Gößwein Matthias / eeas gmbh matthias.goesswein at eeas.at
Fri Jan 25 03:18:33 EST 2019


Dear Venedict,

Yes, that ist possible. Basically the syntax for cmake-gui is:

cmake-gui [<options>] (<path-to-source> | <path-to-existing-build>)

So you can either pass a source directory or a build directory where
cmake was already run.

If you pass the path to the source directory as parameter, then cmake
uses the current directory as build directory.

So you can set both by changing to the build directory on the shell and
run cmake-gui with the source-directory as parameter from there.

However, the manual does not describe this behavior, maybe it should be
mentioned there.
(https://cmake.org/cmake/help/v3.13/manual/cmake-gui.1.html)

Best regards,
Matthias.

Am 24.01.2019 um 23:33 schrieb Venedict Tchistopolskii:
> Basically I want to launch the CMake GUI and pass in source/build
> directories through the CLI, overriding whatever it has at the moment.
>
> Is that possible? I don't get where it's picking up the previously
> touched source build but I want to override it consistently.
>
> E.g. cmake-gui.exe -HXXXX -BXXXX won't work.....
>
> This is for a project wrapper that handles CMake launch and preparation.
>
> VT
>



More information about the cmake-developers mailing list