[CMake] How can I manage the Qt4's .rc file with CMake?

Kermit Mei kermit.mei at gmail.com
Mon Mar 30 14:10:18 EDT 2009


On Mon, 2009-03-30 at 18:15 +0200, Pau Garcia i Quiles wrote:
> On Mon, Mar 30, 2009 at 6:04 PM, Kermit Mei <kermit.mei at gmail.com> wrote:
> > Hello community! I want to change my program's icon on windows, and it
> > wrote with Qt4. I looked up the assistant, it told me the following.
> >
> > But I don't know how to use it in cmake?
> 
> Just add the .rc file to the sources list, like it was another .cpp file:
> 
> ADD_EXECUTABLE( myexe source1.cpp source2.cpp resource.rc )
> 
> > And, another question: If I use MinGW+Qt, but not M$ VC++, can I use it?
> 
> I think so, yes.

Hi Pau, What you said I have tried. But nothing changed in the view of
myexe, it is also a ugly white area with a blue barrier;p
I do it like this:
IF(WIN32)
  ADD_EXECUTABLE(qfrt WIN32 qfrt.cpp qfrt.rc)
ELSE(WIN32)
  ADD_EXECUTABLE(qfrt qfrt.cpp)
ENDIF(WIN32)

And the content of qfrt.rc is:
IDI_ICON1               ICON    DISCARDABLE     ":/icon/myapp.ico"

and I also tried "./gui/icon/myapp.ico" where the .ico file exists.

Thank you, all the same. And hope more help;p

<snip>



More information about the CMake mailing list