[CMake] Automatically pull in dependencies from QtDesigner plugins

David Doria daviddoria at gmail.com
Sun Dec 4 10:07:28 EST 2011


I have created a QT widget, MyWidget, and a QtDesigner plugin for
MyWidget. Now I want to use MyWidget in bigger project, MyProject. I
created a ui file for MyProject with QtDesigner and add a MyWidget in
the designer. Now when I try to compile MyProject, I get (of course)
"error: can't find MyWidget.h". Is there any way to automatically pull
in dependencies from qtdesigner plugins? Or would I have to manually
copy MyWidget.h/cpp into the MyProject directory?

One non-portable solution (it would only build on my machine with the
plugin installed) would be to add
QT_INSTALL_EXAMPLES/designer/MyPlugin to include_directories. However,
that qmake variable QT_INSTALL_EXAMPLES does not seem to be defined in
cmake. Is there anything similar?

Can anyone describe a typical workflow for doing this?

Thanks,

David


More information about the CMake mailing list