How to link QtMain in CMake with Qt5?

后端 未结 3 1546
無奈伤痛
無奈伤痛 2020-12-30 02:05

I upgraded my project code from Qt4 to Qt5. It uses CMake. The conversion got well except for one line of Cmake commands related to Qt. I can’t find in current documentation

3条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-30 02:18

    As of CMake 2.8.11 and Qt 5.1, linking to Qt5::WinMain is automatic/implicit if you specify WIN32 in your add_executable call, or otherwise set the WIN32_EXECUTABLE target property.

    The presentation at

    https://devdays.kdab.com/wp-content/uploads/2012/cmake.pdf

    with video at

    http://www.youtube.com/watch?feature=player_detailpage&v=GJ0kMsLbk6Q#t=751

    describes the features which made it into CMake 2.8.11.

    For more about CMake with Qt see

    http://www.kdab.com/modern-cmake-with-qt-and-boost/

提交回复
热议问题