[CMake] How to embed Qt resources using CMake

Júlio Hoffimann julio.hoffimann at gmail.com
Tue Jul 9 14:43:52 EDT 2013


> Our project tree looks roughly like this, but we don't have a
> CMakeLists.txt in what corresponds to your 'main'; we just do
> (exe/CMakeLists.txt):
>
> qt4_add_resources(resSources ../main/icons.qrc)
> add_executable(... ${resSources})
>
> If you also have sources in 'main' that you are trying to compile into a
> static library (containing the resources), then you probably need
> Q_INIT_RESOURCE, as you discovered.
>
> --
> Matthew


Perfect! That worked, the resources are linked statically to the final
executable.

Thanks,
Júlio.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20130709/e6912c5b/attachment.htm>


More information about the CMake mailing list