Add new CmakePredefinedTarget: "CMAKE_GUI"

Currently there are a couple of predefined targets for cmake in visual studio:
image

I’d like 1 more for VS users.

A simple custom target that just opens cmake-gui so that users don’t have to leave visual studio.
It would save a lot of context switching for me, since Visual Studio is my daily generator.

EDIT:
To be clear it would open cmake-gui with the corresponding projects CMAKE_SOURCE_DIR and CMAKE_BINARY_DIR

This seems reasonable to me, though user-input-awaiting tasks might just not be supported in Visual Studio?

@brad.king

How is this user-input-awaiting?

I believe roughly this is the desired logic being asked for:

cmake-gui.exe -S ${CMAKE_SOURCE_DIR} -B ${CMAKE_BINARY_DIR}

Yes, but Visual Studio doesn’t see it as “complete” until you close cmake-gui again. So “Cancel Build” will forcefully kill the GUI.

I’ll try prototyping this out locally.

Using start as the command could solve that, right?

That looks sandbox-related. It appears that it wouldn’t be allowed to write to the build tree then.

Are you sure? I’ve always understood and used start "" x as a simple way to start x from a prompt without waiting for it to finish, and it’s never given me any problems.

Oh, I had to sift through all kinds of “start.exe is unwanted, here’s our AV to help clean things” results. The first more legitimate one was for something called “sandboxie”. The MSDN pages indicate that it might be work.