[Qt-interest] cmake: ui library?

Rui Maciel rui.maciel at gmail.com
Tue Feb 14 12:07:31 CET 2012


Rui Maciel wrote:

> This CMakeLists.txt file was a bit broken.  Here follows an updated
> version:
> 
> <example ~/src/ui/CMakeLists.txt>
> set(ui_HEADERS
> MainWindow.h++
> # some other headers
> )
> 
> set(ui_SOURCES
> MainWindow.c++
> # some other sources
> )
> 
> set(ui_FORMS
> MainWindow.ui
> # some other forms
> )
> 
> QT4_WRAP_CPP(ui_HEADERS_MOC ${ui_HEADERS})
> QT4_WRAP_UI(ui_FORMS_HEADERS ${ui_FORMS})
> 
> add_library(ui STATIC ${ui_SOURCES} ${ui_HEADERS_MOC} ${ui_FORMS_HEADERS}
> ) </example>

I've solved this issue.  Apparently, there was nothing wrong with the 
library's CMakeLists.txt file.  The only thing that was missing was adding 
to the CMakeLists.txt file in the base directory (~/src) the macro to 
include the path to the library's headers.

I'll post a how-to for future reference.


Rui Maciel



More information about the Qt-interest-old mailing list