How to create and work with resource files in CLion?

I want to attach some binary resources to my program written using CLion. I googled a lot about it - most articles explain how to do it using Visual Studio, a couple of mouse clicks to add resources via "import" menu. But i need to do it in CLion, and i can't figure out, how to do it. I created "resource.rc" file in my project directory, then i created "resource.h", added #include "resource.h" into my main.cpp and resource.rc. Now i think i need to write some stuff in CMakeLists.txt to link all this together (Because now my FindResource() func call returns an 1812 error code). Can you please help me with that?  What should i write to CMakeLists.txt to make my resource file accessible from code?

Regards, Arthur.

1 comment
Comment actions Permalink

Hi Artur.

CLion doesn't have any specific logic for working with resource files. So you need to use CMake settings for working with them.


Please sign in to leave a comment.