MantisBT - CMake
View Issue Details
0014685CMakeQtDialogpublic2014-01-07 04:152016-06-10 14:31
Woomla 
Clinton Stimpson 
normalminoralways
closedmoved 
WindowsWindows8.1
CMake 2.8.12 
 
0014685: cmake-gui does not display text in console
Cmake-gui does not display any text in a windows console.
1. Start console: cmd.exe.
2. Execute: cmake-gui --help.
I expect the help text to be displayed, just like cmake does.
Instead nothing seems to happen, no gui, no help text.

Running: cmake-gui --help cmake-help.txt creates the file with the expected text. I was looking for the command-line parameters (-H and -B).


Probably the cause is that when writing to the console in a Qt GUI project (in windows 8.1) the text is not written to the parent console. Redirecting the text works.

To attach to the parent console I once did (when not starting the gui):
AttachConsole(-1);freopen("CONOUT$", "w", stdout);
But this leaves the console open...
No tags attached.
Issue History
2014-01-07 04:15WoomlaNew Issue
2014-01-07 08:59Brad KingAssigned To => Clinton Stimpson
2014-01-07 08:59Brad KingStatusnew => assigned
2014-01-07 21:12Clinton StimpsonNote Added: 0034913
2014-01-15 03:07WoomlaNote Added: 0034942
2016-06-10 14:29Kitware RobotNote Added: 0042460
2016-06-10 14:29Kitware RobotStatusassigned => resolved
2016-06-10 14:29Kitware RobotResolutionopen => moved
2016-06-10 14:31Kitware RobotStatusresolved => closed

Notes
(0034913)
Clinton Stimpson   
2014-01-07 21:12   
This seems a bit difficult. I happened to experiment with this using Visual Studio 11. I wanted to make sure that redirection to a file would keep working (cmake-gui --help > help.txt).

To redirect to the console, we need to do freopen(), but only if it isn't redirected to a file.

_fileno(stdout) might give some indication of this because it is supposed to return -1 or -2 for non-gui apps, and I assume that it does so if there is no redirection.
But _fileno(stdout) is broken under some versions of Visual Studio.
https://connect.microsoft.com/VisualStudio/feedback/details/785119/ [^]

So, I don't yet see a robust way to do this.
Do you have a suggested patch to cmake-gui?
(0034942)
Woomla   
2014-01-15 03:07   
Currently I have no clue how to solve this.
(0042460)
Kitware Robot   
2016-06-10 14:29   
Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.