[vtkusers] How to hide the console for a VTK/Qt app

Jim jiksed at yahoo.com
Mon Apr 6 17:34:49 EDT 2009


Hi John,
 
I modified CMakeList.txt file in qtevents folder with the following entry:
 SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /subsystem:windows"), ran CMake and generated a new VS2008 Solution file. However, my project properties did not reflect this change. My linker properties still show /subsystem:console. 
 
The good news is that the console didnot pop up after manually setting:
SubSystem= Windows (/SUBSYSTEM:WINDOWS)
in VS 2008.
 
Thank you.



--- On Mon, 4/6/09, John Drescher <drescherjm at gmail.com> wrote:


From: John Drescher <drescherjm at gmail.com>
Subject: Re: [vtkusers] How to hide the console for a VTK/Qt app
To: "Jim" <jiksed at yahoo.com>, "VTK" <vtkusers at vtk.org>, "Cmake Mailing List" <cmake at cmake.org>
Date: Monday, April 6, 2009, 3:15 PM


On Mon, Apr 6, 2009 at 5:06 PM, John Drescher <drescherjm at gmail.com> wrote:
> On Mon, Apr 6, 2009 at 4:59 PM, Jim <jiksed at yahoo.com> wrote:
>>
>> Dear vtkusers,
>>
>> While executing VTK examples such as qtevents, a black (debugging) console
>> like Windows Command Prompt pops up. This doesn't look nice if my customers
>> see it. How can I hide this console?
>>
>> #SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /subsystem:windows")
>>
> Bing a windows developer for 15 years I know this should be the
> working one. Check your linker settings in your Visual Studio project
> file and make sure that it does say /subsystem:windows
>
> The default in cmake I believe is /subsystem:console which I know
> starts a new console. I remember that I used that option years ago to
> add debug console to all my GUI apps. :)
>
>From the cmake mailing list, I found this:

if(WIN32)
    set_target_properties(WindowApplicationExample PROPERTIES
LINK_FLAGS_DEBUG "/SUBSYSTEM:CONSOLE")
    set_target_properties(WindowApplicationExample PROPERTIES
RELWITHDEBINFO "/SUBSYSTEM:CONSOLE")
    set_target_properties(WindowApplicationExample PROPERTIES
LINK_FLAGS_RELEASE "/SUBSYSTEM:WINDOWS")
    set_target_properties(WindowApplicationExample PROPERTIES
MINSIZEREL "/SUBSYSTEM:WINDOWS")
endif(WIN32)


-- 
John M. Drescher



      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20090406/c2614832/attachment.htm>


More information about the vtkusers mailing list