[cmake-developers] execute_process on windows uses CreateProcess

Brad King brad.king at kitware.com
Wed Apr 4 09:28:05 EDT 2018


On 04/04/2018 03:30 AM, Mathieu Westphal wrote:
> Is there a way, using cmake, to start a gui command on windows
> and have the gui shows up ?

```
execute_process(COMMAND cmd /c notepad)
```

> If not, is this intended?

Yes.  Otherwise console windows appear for everything.

CreateProcessW is *the* way to create a process on Windows.
It has flags to control whether a window is shown, and we
intentionally set them to not show the window.

> Could we have this feature ?

The `cmd /c` workaround should be sufficient, but it wouldn't be
hard to add an option to the execute_process command to allow
the window to be shown.

-Brad


More information about the cmake-developers mailing list