[CMake] Why the ui_header.h can not be found in Qt project when I add a share lib?

Michael Jackson mike.jackson at bluequartz.net
Tue Jan 20 13:43:36 EST 2009


When on Windows making a GUI application MFC (I think) has its own  
special "main" instead of the normal "main" that everyone else uses.  
Qt has an implementation of this and the If() statement below makes  
sure that if you are on windows your program will link in this special  
"main". If you don't use it then you will get link errors on windows.  
If you _never_ will compile your program on Windows or you are just  
making a console application then you can probably skip it.

    All that is from memory and I am not a Windows Expert by any  
stretch of the imagination.
_________________________________________________________
Mike Jackson                  mike.jackson at bluequartz.net
BlueQuartz Software                    www.bluequartz.net
Principal Software Engineer                  Dayton, Ohio



On Jan 20, 2009, at 1:35 PM, Kermit Mei wrote:

> Michael Jackson wrote:
>> TARGET_LINK_LIBRARIES( gtc GUI  ${QT_LIBRARIES} )
>>
>> Also BEFORE the FindPackage(Qt4) add the following line:
>>
>> IF (WIN32)
>>    SET (QT_USE_QTMAIN TRUE)
> It works. But what's the meaning here?
> I hope you can give me some links. I googled it, but
> I can't  find enough answers for me.
>> ENDIF (WIN32)
>>
>> _________________________________________________________
>> Mike Jackson                  mike.jackson at bluequartz.net
>> BlueQuartz Software                    www.bluequartz.net
>> Principal Software Engineer                  Dayton, Ohio
> Thank you!
>
>



More information about the CMake mailing list