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

Venedict Tchistopolskii venytch at gmail.com
Fri Jan 25 17:06:02 EST 2019


Could you clarify on saving the build-directory section?

I'm not sure how it knows which cache or build directory to load. In my
setup here the issue I noted applies even if build directory is generated
on both projects/etc.

VT

On Fri, Jan 25, 2019 at 1:59 PM Kyle Edwards <kyle.edwards at kitware.com>
wrote:

> On Fri, 2019-01-25 at 13:23 -0800, Venedict Tchistopolskii wrote:
>
> Get 2 CMake projects.
>
> Get CMake GUI to 'configure' one of them. Close/re-open and it will
> automatically point to this configured project source and build locations,
> regardless of what build/version/cmake-gui.exe you use.
>
> Run a different cmake-gui.exe through the CLI, passing in source and build
> locations. It will be properly load these instead of the 'last configured
> project' now.
>
> Now close it, without configuring, and re-open it normally without CLI
> overrides. Now it'll load the original project as if you've never set it to
> a different source/build location.
>
> tl;dr CMake loads the last-configured source/bin directory by default. If
> you don't configure (or pass override through CLI) it will keep loading the
> same project.
>
>
> Ah, I see what you mean.
>
> Saving the build path is easy: just add the command-line path to the cache
> of build directories on startup as well as at configure time.
>
> Saving the source path is more difficult. The GUI gets the source
> directory by scanning the files in the build directory. If the build
> directory hasn't been generated yet, then the GUI will have no idea where
> to find the source directory, unless we start caching source directories as
> well.
>
> I think, as you noted, you're better off just triggering "Configure"
> before closing the dialog.
>
> Kyle
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://cmake.org/pipermail/cmake-developers/attachments/20190125/3111fde0/attachment.html>


More information about the cmake-developers mailing list