0

I build Qt5.1 for VS2012 x64. Now I wanted to use Qt to build a simple UI application. Unfortunately CMake gives me some error messages:

CMake Error at C:/thirdparty/vs2012/x64/qt-everywhere-opensource-src-5.1.0/qtbase/lib/cmake/Qt5XmlPatterns/Qt5XmlPatternsConfig.cmake:15 (message):
  The imported target "Qt5::XmlPatterns" references the file

     "C:/thirdparty/vs2012/x64/qt-everywhere-opensource-src-5.1.0/qtbase/include/QtXmlPatterns/5.1.0"

  but this file does not exist.  Possible reasons include:

  * The file was deleted, renamed, or moved to another location.

  * An install or uninstall procedure did not complete successfully.

  * The installation package was faulty and contained

     "C:/thirdparty/vs2012/x64/qt-everywhere-opensource-src-5.1.0/qtbase/lib/cmake/Qt5XmlPatterns/Qt5XmlPatternsConfig.cmake"

  but not all the files it references.

Call Stack (most recent call first):
  C:/thirdparty/vs2012/x64/qt-everywhere-opensource-src-5.1.0/qtbase/lib/cmake/Qt5XmlPatterns/Qt5XmlPatternsConfig.cmake:58 (_qt5_XmlPatterns_check_file_exists)
  CMakeLists.txt:59 (find_package)

The same project worked with Qt 5.0.2 and Qt 5.0.1.

I setted the path for Qt5Core_DIR and Qt5Xml_DIR, but it does not work Qt5XmlPatterns_DIR. When looking in the Qt lib directory I see that the Qt5XmlPatterns where build successfully - I can also exectued the designer application.

I build Qt 5.1.0 using this instructions:

  1. configure -developer-build -opensource -nomake examples -nomake tests
  2. nmake

The directory "C:/thirdparty/vs2012/x64/qt-everywhere-opensource-src-5.1.0/qtbase/include/QtXmlPatterns/5.1.0" does not exist. But the directory "C:/thirdparty/vs2012/x64/qt-everywhere-opensource-src-5.1.0/qtbase/include/QtXmlPatterns" does exist. The directory contains only one file: "QtXmlPatternsDepends"

Any ideas what went wrong?

UPDATE: I now used the installer provided from the Qt website (MS2012 x64). After downloading and installing it I tried to setup the project with the installed version. It worked this time –maybe something went wrong when building Qt 5.1.0 – BUT: It seems that the CMake configuration file is pointing to the wrong directory (to “qtbase” instead of “qtxmlpatterns”) – maybe there is something not working properly in the Qt5XmlPatternsConfig.cmake file…</p>

2nd UPDATE: I rebuilt Qt5.1 new from scratch - but I get still the same errors...

3rd UPDATE: I copied the files from the directory "C:\thirdparty\vs2012\x64\qt-everywhere-opensource-src-5.1.0\qtxmlpatterns\include\QtXmlPatterns" to "C:\thirdparty\vs2012\x64\qt-everywhere-opensource-src-5.1.0\qtxmlpatterns\include\QtXmlPatterns" and did the same for QtDeclarative and QtScript

all errors in CMake are gone - but when compiling some headers can not be found...

4

1 回答 1

1

我在vs2012使用的是Qt5.1的自建版本,我不得不修改每个${prefix}/lib/cmake/${Qt5LibraryName}文件夹中的Qt5xxx.cmake文件。例如,我不得不修改 Qt5AxContainer.cmake 从

. . . 设置(_Qt5AxContainer_OWN_INCLUDE_DIRS)。.

. . 设置(_Qt5AxContainer_OWN_INCLUDE_DIRS "${_qt5Gui_install_prefix}/../qtactiveqt/include/" "${_qt5Gui_install_prefix}/../qtactiveqt/include/ActiveQt")。.

我发现 _Qt5XXX_OWN_INCLUDE_DIRS 用于实际标头的目录路径,并且必须正确添加/修改多个路径。

虽然我还没有将此行为提交给 Qt 的错误跟踪系统,但它似乎是构建脚本中的错误。

于 2013-07-26T05:18:35.833 回答