I guess the problem is related to static linkage. I'm actually building
static libraries and it seems in that case the resource files are optimized
out by the compiler. I tried to build shared libraries, but for the moment
I have to fix strongly connected components before doing it.
A possible sol
I'm doing exactly this you have shown. A CMakeLists.txt at the top level
and various subdirs (subprojects).
I must read more about Qt resources for solving the issue, it's really my
lack of experience on this topic that is causing the icons to be missed
during runtime.
Best,
Júlio.
--
Powered by
Hello,
How do you call invoke CMakeLists1.txt and CMakeLists2.txt?
If you want to keep separate CMakeLists.txt, I would do something like this:
main/
CMakeLists.txt
-- resources/
-- -- pixmaps/
-- CMakeLists1.txt
-- icons.qrc
exe/
-- CMakeLists2.txt
-- main.cpp
Where CMakeLists.txt is something
My CMakeLists.txt resides at the same directory as icons.qrc, but my main
application is linked in a completely separate folder:
main/
-- resources/
-- -- pixmaps/
-- CMakeLists1.txt
-- icons.qrc
exe/
-- CMakeLists2.txt
-- main.cpp
Is it okay? What should be the CMakeLists(1|2).txt in this case?
Hello,
Files put in a resource file are converted to base64, then compiled in the
executable/library. That's why CMake (and qmake) add the result of the qrc
"compilation" to the source files.
>From what you say, it looks like icons.qrc is not in the same directory
your CMakeLists.txt is. Make sur
Pau,
I did exactly that, I think the issue is with the file paths not with my
CMakeLists.txt. What Qt does with resource files exactly? Is it a runtime
load? The paths must be relative to the linked executable? Also, where I
can find the complete specification for that XML in icons.qrc?
Bogdan,
The paths should be relative to the folder where your qrc file reside.
Then you can use
QT4_ADD_RESOURCES(lib_resources icons.qrc)
add_library(mylib ${lib_srcs} ${lib_resources})
On 08.07.2013 18:17, Júlio Hoffimann wrote:
Dear all,
I'm not that experienced with Qt, but I'm migrating an exis
Hello,
That's not how Qt4 resources are added with CMake. Here you have a good
explanation:
http://www.qtcentre.org/wiki/index.php?title=Compiling_Qt4_apps_with_CMake
On Mon, Jul 8, 2013 at 6:17 PM, Júlio Hoffimann
wrote:
> Dear all,
>
> I'm not that experienced with Qt, but I'm migrating an e
Dear all,
I'm not that experienced with Qt, but I'm migrating an existing application
to use CMake as the build system. It all worked smoothly, except the icons
in the GUI aren't being shown.
Suppose I'm a directory named main/ that has a subdirectory named
resources/pixmaps:
main/
-- resources/