Reputation: 8152
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:
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…
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...
Upvotes: 0
Views: 1197
Reputation: 476
I'm using the self-built version of Qt5.1 for vs2012 and I had to modify Qt5xxx.cmake files in each ${prefix}/lib/cmake/${Qt5LibraryName} folder. For example, I had to modify Qt5AxContainer.cmake from
. . . set(_Qt5AxContainer_OWN_INCLUDE_DIRS) . .
to
. . set(_Qt5AxContainer_OWN_INCLUDE_DIRS "${_qt5Gui_install_prefix}/../qtactiveqt/include/" "${_qt5Gui_install_prefix}/../qtactiveqt/include/ActiveQt" ) . .
I found _Qt5XXX_OWN_INCLUDE_DIRS is for directory path of actual headers and had to add/modify several paths correctly.
Though I had not filed up this behavior to Qt's bug tracking system yet, it seems to be bug in build script.
Upvotes: 1