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

Kyle Edwards kyle.edwards at kitware.com
Fri Jan 25 16:59:14 EST 2019


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/8187525c/attachment.html>


More information about the cmake-developers mailing list