Easy
way to build Qt-Desktop-Components in Visual Studio using Cmake
by
Markus Bohms & Michael Wagner from shared-reality.com
Preparations
- Download & Unzip QmlComponentsTest.zip to c:\QmlComponentsTest
- QmlComponentsTest/extern/ contains the qml-desktop components matsterbranch from : "git://gitorious.org/qt-components/desktop.git"
- in order to use the examples standalone we have to change the import QtDesktop 0.1 statement to point to our extern\desktop\components directory, so change it to import "../components" 0.1
For
example change extern/desktop/examples/gallery.qml as follows:
Make sure to use the correct relative path for example if you change examples/content/panel.qml you have to use import "../../components" <version>
*<version>
can change through developement of qt-dekstop-components!
Also
you have to check if a qml inside of components imports QtDesktop and
change this import, too - at the moment splitter.qml uses the import
QtDesktop statement.
Building
- use the CMakefile placed in "QmlComponentsTest/CMakeLists.txt" to create the project for VS2010, gcc, or any other compiler you want to use. We're doing an out-of-source build which means that all generated stuff like Visual Studio project files go to /BUILD and the source tree doesnt get polluted
- the VisualStudio project contains now three subprojects called styleplugin, INSTALL and ExampleBrowser
- Build the plugin target - it should be created in "QmlComponentsTest/components/plugins/styleplugin.dll" , .lib ...
- Build INSTALL target - this will copy the needed QT-Dlls and the components to "QmlComponentsTest/bin/<Debug/Release/etc.>"
- Build the ExampleBrowser and select it as startup-project. When starting out of Visual Studio make sure that the workingdirectory is set to "QmlComponentsTest/bin/<Debug/Release/etc.>" (see Debug Settings)
There
are many ways to get this plugin to work, but this is a easy and fast
way to get it to work if you are not using QtCreator.
Keine Kommentare:
Kommentar veröffentlichen