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

Mike Jackson mike.jackson at bluequartz.net
Mon Apr 6 19:37:47 EDT 2009


in your cmakelists.txt file you need something like the following:

add_executable(foo WIN32 ${foo_srcs}) which will change the subsystem
to windows and not console.

mike

On Mon, Apr 6, 2009 at 5:34 PM, Jim <jiksed at yahoo.com> wrote:
> 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
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
>



More information about the vtkusers mailing list