🦁 An example CLion mulle-objc project
This example project is also useful as a template for new CLion projects. Follow these three steps to generate a new mulle-objc project based on the "Foundation".
On GitHub generate your own project with MulleObjCClionDemo as the template. Here we are using "myproject" as the new name.
In CLion in the welcome screen choose "Get from VCS" then enter the URL of your new project:
You should now have the project local and opened in CLion. In a fresh installation you can now configure the mulle-clang compiler.
If this doesn't show up, check "File / Settings / Build Execution Deployment / ToolChains", which is the same dialog basically.
To get things to compile you need the Foundation repackaged in a special format and placed
into a folder usr
in your project directory. Check the "FoundationWrap" release page for possibly pre-packaged release archives.
Otherwise, here is how to build and repackage the Foundation:
For this to work you need to repackage all the Objective-c libraries as well as mulle-sprintf of Foundation into
FoundationWrap. Place the Foundation-startup
, mulle-atinit
, mulle-atexit
libraries into FoundationWrap-startup. Combine all the remaining
C files into a c-wrap library. Create a directory usr/include
and copy all the headers recursively there. Create a directory usr/lib
and copy the three
libraries there.
Use FoundationWrap to create a directory usr
in your project with
all the required headers and libraries.
Assuming your project is called "myproject" and has been placed into ~/CLionProjects
.
mulle-sde install --debug --prefix ~/CLionProjects/myproject/usr https://github.com/MulleFoundation/FoundationWrap
CLion's cmake cache needs to be resetted to work with the new configuration. Chose "Tools / Cmake / Reset Cache and Reload Project"