To whom it may concern:<br><br> Here is an example for building a Qt 3 widget as a lib (with CMake taking care of all the moc and uic nonsense). You will only need the .ui file (which you can create in the Qt Designer) and the following
CMakeLists.txt: <br><br><span style="font-family: courier new,monospace;"># # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # </span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
PROJECT(MyWidget)</span><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"># Qt</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">FIND_PACKAGE(Qt3)</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">INCLUDE_DIRECTORIES(${QT_INCLUDE_DIR})</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">ADD_DEFINITIONS (${QT_DEFINITIONS})</span><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
QT_WRAP_UI( ${PROJECT_NAME} WIDGET_H_LIST WIDGET_CPP_LIST ${PROJECT_NAME}.ui)</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">QT_WRAP_CPP(${PROJECT_NAME} WIDGET_CPP_LIST ${WIDGET_H_LIST})
</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> </span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">ADD_LIBRARY(${PROJECT_NAME}
</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> ${WIDGET_H_LIST}</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
${WIDGET_CPP_LIST}</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">)</span><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"># # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #</span><br><br>Naturally, you only need to change "MyWidget" to the name of your widget (case sensitive).
<br><br>I do not yet use Qt 4, so I'm not sure if this would work just as well for Qt 4.<br>Hope this is helpful,<br>Jacob<br><br>