• <tfoot id='Zv5Wu'></tfoot>

      <small id='Zv5Wu'></small><noframes id='Zv5Wu'>

        <bdo id='Zv5Wu'></bdo><ul id='Zv5Wu'></ul>
      <legend id='Zv5Wu'><style id='Zv5Wu'><dir id='Zv5Wu'><q id='Zv5Wu'></q></dir></style></legend>
      1. <i id='Zv5Wu'><tr id='Zv5Wu'><dt id='Zv5Wu'><q id='Zv5Wu'><span id='Zv5Wu'><b id='Zv5Wu'><form id='Zv5Wu'><ins id='Zv5Wu'></ins><ul id='Zv5Wu'></ul><sub id='Zv5Wu'></sub></form><legend id='Zv5Wu'></legend><bdo id='Zv5Wu'><pre id='Zv5Wu'><center id='Zv5Wu'></center></pre></bdo></b><th id='Zv5Wu'></th></span></q></dt></tr></i><div id='Zv5Wu'><tfoot id='Zv5Wu'></tfoot><dl id='Zv5Wu'><fieldset id='Zv5Wu'></fieldset></dl></div>

        cmake 找不到 qt 5.1.1

        时间:2023-08-27

          <small id='wJlJW'></small><noframes id='wJlJW'>

          <legend id='wJlJW'><style id='wJlJW'><dir id='wJlJW'><q id='wJlJW'></q></dir></style></legend>
          • <bdo id='wJlJW'></bdo><ul id='wJlJW'></ul>
            <tfoot id='wJlJW'></tfoot>

              <tbody id='wJlJW'></tbody>

              <i id='wJlJW'><tr id='wJlJW'><dt id='wJlJW'><q id='wJlJW'><span id='wJlJW'><b id='wJlJW'><form id='wJlJW'><ins id='wJlJW'></ins><ul id='wJlJW'></ul><sub id='wJlJW'></sub></form><legend id='wJlJW'></legend><bdo id='wJlJW'><pre id='wJlJW'><center id='wJlJW'></center></pre></bdo></b><th id='wJlJW'></th></span></q></dt></tr></i><div id='wJlJW'><tfoot id='wJlJW'></tfoot><dl id='wJlJW'><fieldset id='wJlJW'></fieldset></dl></div>

                1. 本文介绍了cmake 找不到 qt 5.1.1的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我刚刚为 Windows 32 位(MinGW 4.8,OpenGL)安装了 Qt 5.1.1,并尝试将其添加到我的 cmake 中.但 CMake 只是不想找到它,我不知道为什么.我错过了什么?我需要设置环境变量还是什么?

                  I just installed the Qt 5.1.1 for Windows 32-bit (MinGW 4.8, OpenGL) and tried to add it to my cmake. But CMake just does not want to find it and i dont know why. What am i missing? Do i need to set an environment variable or something?

                  这是我的 cmake :

                  Here is my cmake :

                  cmake_minimum_required( VERSION 2.8.11 )
                  PROJECT(Blemmer)
                  # Find includes in corresponding build directories
                  set(CMAKE_INCLUDE_CURRENT_DIR ON)
                  # Instruct CMake to run moc automatically when needed.
                  set(CMAKE_AUTOMOC ON)
                  # Detect and add SFML
                  set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/Modules" ${CMAKE_MODULE_PATH})
                  
                  set( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin )
                  set( CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib )
                  find_package(SFML REQUIRED system window graphics network audio)
                  # The QUIET option disables messages if the package cannot be found. 
                  FIND_PACKAGE(Qt5Widgets) 
                  add_subdirectory(Entity)
                  add_subdirectory(Engine)
                  add_subdirectory(Game)
                  add_executable(Blemmer main.cpp)
                  
                  include_directories(${SFML_INCLUDE_DIR} ${PROJECT_SOURCE_DIR})
                  target_link_libraries(Blemmer ${SFML_LIBRARIES} Game Engine Qt5::Widgets)
                  

                  这是 cmake-gui 的输出:

                  and this is the output of cmake-gui :

                  CMake Warning at CMakeLists.txt:14 (FIND_PACKAGE):
                    By not providing "FindQt5Widgets.cmake" in CMAKE_MODULE_PATH this project
                    has asked CMake to find a package configuration file provided by
                    "Qt5Widgets", but CMake did not find one.
                  
                    Could not find a package configuration file provided by "Qt5Widgets" with
                    any of the following names:
                  
                      Qt5WidgetsConfig.cmake
                      qt5widgets-config.cmake
                  
                    Add the installation prefix of "Qt5Widgets" to CMAKE_PREFIX_PATH or set
                    "Qt5Widgets_DIR" to a directory containing one of the above files.  If
                    "Qt5Widgets" provides a separate development package or SDK, be sure it has
                    been installed.
                  

                  推荐答案

                  Qt安装需要设置CMAKE_PREFIX_PATH.

                  You need to set the CMAKE_PREFIX_PATH to the Qt installation.

                  见http://doc.qt.io/qt-5/cmake-manual.html

                  这篇关于cmake 找不到 qt 5.1.1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:CMake 错误:“add_subdirectory 未给出二进制目录" 下一篇:C++ CMake(添加非构建文件)

                  相关文章

                2. <i id='qcBOR'><tr id='qcBOR'><dt id='qcBOR'><q id='qcBOR'><span id='qcBOR'><b id='qcBOR'><form id='qcBOR'><ins id='qcBOR'></ins><ul id='qcBOR'></ul><sub id='qcBOR'></sub></form><legend id='qcBOR'></legend><bdo id='qcBOR'><pre id='qcBOR'><center id='qcBOR'></center></pre></bdo></b><th id='qcBOR'></th></span></q></dt></tr></i><div id='qcBOR'><tfoot id='qcBOR'></tfoot><dl id='qcBOR'><fieldset id='qcBOR'></fieldset></dl></div>
                3. <small id='qcBOR'></small><noframes id='qcBOR'>

                      <bdo id='qcBOR'></bdo><ul id='qcBOR'></ul>
                  1. <legend id='qcBOR'><style id='qcBOR'><dir id='qcBOR'><q id='qcBOR'></q></dir></style></legend><tfoot id='qcBOR'></tfoot>