cmake not finding Qt4

后端 未结 5 1925
盖世英雄少女心
盖世英雄少女心 2021-02-19 18:32

Since 4.8.0 is out, I\'ve reinstalled Qt, and now I want to use cmake too. To make cmake work, I remember having to add the mingw bin folder (QtSDK\\Desktop\\Qt\\4.7.3

5条回答
  •  悲&欢浪女
    2021-02-19 19:24

    You just need to set the path to qmake in QT_QMAKE_EXECUTABLE, and then cmake can use qmake -query to find all the other paths it needs (similar to pkg-config on Linux).

    Steps for building a project using Qt and CMake usually are:

    1. Check out / create project source folder
    2. Create build folder outside the project folder
    3. Start Qt command prompt / cmd and cd into build folder e.g. cd build\project
    4. Run cmake or cmake-gui passing path to source folder e.g. cmake-gui ..\..\source\project
    5. Set any variables, such as QT_QMAKE_EXECUTABLE and CMAKE_BUILD_TYPE
    6. Run your build tool, or run cmake --build .

提交回复
热议问题