<legend id='fGNKu'><style id='fGNKu'><dir id='fGNKu'><q id='fGNKu'></q></dir></style></legend>

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

        <bdo id='fGNKu'></bdo><ul id='fGNKu'></ul>
      1. <tfoot id='fGNKu'></tfoot>
        <i id='fGNKu'><tr id='fGNKu'><dt id='fGNKu'><q id='fGNKu'><span id='fGNKu'><b id='fGNKu'><form id='fGNKu'><ins id='fGNKu'></ins><ul id='fGNKu'></ul><sub id='fGNKu'></sub></form><legend id='fGNKu'></legend><bdo id='fGNKu'><pre id='fGNKu'><center id='fGNKu'></center></pre></bdo></b><th id='fGNKu'></th></span></q></dt></tr></i><div id='fGNKu'><tfoot id='fGNKu'></tfoot><dl id='fGNKu'><fieldset id='fGNKu'></fieldset></dl></div>
      2. 如何在 Windows 上找到 Qt5 CMake 模块

        How to find the Qt5 CMake module on Windows(如何在 Windows 上找到 Qt5 CMake 模块)
        • <small id='OTSGx'></small><noframes id='OTSGx'>

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

            1. <legend id='OTSGx'><style id='OTSGx'><dir id='OTSGx'><q id='OTSGx'></q></dir></style></legend>

                  <tbody id='OTSGx'></tbody>
                <tfoot id='OTSGx'></tfoot>

                • 本文介绍了如何在 Windows 上找到 Qt5 CMake 模块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在尝试在 Windows 上使用 CMake 制作一个非常基本的 Qt5 应用程序.我使用 Qt5 的文档 使用 CMake,而我的 main.cpp 文件只包含一个 main 函数.

                  I'm trying to make a very basic Qt5 application using CMake on Windows. I used the documentation of Qt5 to use CMake, and my main.cpp file just contains a main function.

                  我的 CMakeLists.txt 正是:

                  cmake_minimum_required(VERSION 2.8.9)
                  
                  project(testproject)
                  
                  # Find includes in corresponding build directories
                  set(CMAKE_INCLUDE_CURRENT_DIR ON)
                  # Instruct CMake to run moc automatically when needed.
                  set(CMAKE_AUTOMOC ON)
                  
                  # Find the QtWidgets library
                  find_package(Qt5Widgets)
                  
                  # Tell CMake to create the helloworld executable
                  add_executable(helloworld hello.cpp)
                  
                  # Use the Widgets module from Qt 5.
                  qt5_use_modules(helloworld Widgets)
                  

                  当我在 MSysGit bash 中输入

                  When in MSysGit bash I enter

                  $ cmake -G"Visual Studio 11"
                  

                  我得到这个输出:

                  $ cmake -G"Visual Studio 11"
                  -- The C compiler identification is MSVC 17.0.60204.1
                  -- The CXX compiler identification is MSVC 17.0.60204.1
                  -- Check for working C compiler using: Visual Studio 11
                  -- Check for working C compiler using: Visual Studio 11 -- works
                  -- Detecting C compiler ABI info
                  -- Detecting C compiler ABI info - done
                  -- Check for working CXX compiler using: Visual Studio 11
                  -- Check for working CXX compiler using: Visual Studio 11 -- works
                  -- Detecting CXX compiler ABI info
                  -- Detecting CXX compiler ABI info - done
                  CMake Warning at CMakeLists.txt:11 (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.
                  
                  
                  CMake Error at CMakeLists.txt:17 (qt5_use_modules):
                    Unknown CMake command "qt5_use_modules".
                  
                  
                  -- Configuring incomplete, errors occurred!
                  

                  你有什么想法吗?

                  推荐答案

                  行后

                  cmake_minimum_required(VERSION 2.8.9)
                  
                  project(testproject)
                  

                  添加

                  set (CMAKE_PREFIX_PATH "C:\Qt\Qt5.0.1\5.0.1\msvc2010\")
                  

                  这就解决了问题.

                  这篇关于如何在 Windows 上找到 Qt5 CMake 模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  How to print vector#39;s data(如何打印矢量的数据)
                  Visual C++ appends 0xCC (int3) bytes at the end of functions(Visual C++ 在函数末尾附加 0xCC (int3) 字节)
                  How to use a variable inside a _T wrapper?(如何在 _T 包装器中使用变量?)
                  MSVC++ warning flags(MSVC++ 警告标志)
                  How to read file which contains uxxxx in vc++(如何在vc++中读取包含uxxxx的文件)
                  stack overflow error in C++ program(C++程序中的堆栈溢出错误)
                  • <bdo id='rdF9H'></bdo><ul id='rdF9H'></ul>

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

                              <tbody id='rdF9H'></tbody>