Synfig CMake Port

Hi All.

I understand there has been on ongoing interest in porting the Synfig build system to CMake (references: here and here). If there is still active interest in this, I wanted to share a CMake port which is based on a several-month-old “fork” of synfig:master (due to complications it’s not technically a fork, but for practical purposes it is):

https://github.com/0u812/cynfig

Linux support is fairly complete, but is missing some features that were present in the autotools build, but the all of essential features are there. Both Synfig & Synfig Studio compile and run and can render stills and sequences of images. Cygwin is also supported. Attached is a screenshot showing the Linux Build side-by-side with the Cygwin build running inside a Windows 8.1 VM. You can even build parts of it with Visual Studio (the synfig library and executable, although you can’t run it yet). I’m still working on bringing the CMake feature set closer to autotools, but I wanted to post here to get feedback about whether people would want to pull this into synfig:master at some point (after I bring it up to date with the latest changes in master).

I really think that having a good platform-independent CMake build system will help attract new developers to Synfig and accelerate the project, which is one of the reasons I invested a fair amount of my own time in this port. Hopefully, other people agree, and would be interested in trying out the CMake build so any remaining bugs could be fixed. I will post some build instructions on the Github page soon.

Hello 0u812 and welcome here!

I did’t test or review the work you have done, but i can say, from my point of view, that all initiative to deploy and develop synfig in particular, freesoftware in general, is warmly welcome !

Good luck for the last things you have to continue to…

Hi 0u812!
Those news are awesome!. We would be very happy if you rebase your branch onto the master branch. That would allow us to test cmake on different distributions and operating systems and so validate your work.

I can see that you haven’t forked synfig repository and that’s not a good idea. It would make more complex to us to merge it to the normal workflow. Please try to fork synfig repository first and then add the commits on top of master over the fork. This way it would be easier to issue a pull request and to solve the merge from our side.

Fantastic work!
-G

Thanks for the positive responses, everybody! I’ll fork the Synfig master branch and integrate my changes. In the meantime, I uploaded instructions for Fedora (tested with 20 but it should work with any recent version). I also plan on uploading instructions for at least Ubuntu, Cygwin and Visual Studio (partial build) in the near future. I haven’t tested the CMake port on a Mac yet but I hope to do so as soon as I have some time on my hands.

Hi 0u812!
I hope you are still around here.
I would really like to change the build system to cmake. I agree with you that this could also lower the initial barrier and get more people to hack around.
If you are interested, I will have some free time during christmas :slight_smile:
I added an issue for this here: http://www.synfig.org/issues/thebuggenie/synfig/issues/721

PS: edited, I didn’t read the previous comments

Wasn’t aware of this thread, but anyway i’ve just started another effort to port to cmake today: github.com/synfig/synfig/issues/279

Anyway, i’m starting from scratch because i suspect it’ll be easier and i don’t exactly like what i’ve seen from “cynfig” cmakelists.

eldruin, if you are still interested in port, any help is appreciated.

Everything is buildable for me with CMake now, so i need some testers to make it portable.

CMake branch: github.com/caryoscelus/synfig/tree/cmake
Build instructions: github.com/caryoscelus/synfig/t … installing
Issue for discussion: github.com/synfig/synfig/issues/279

I’m currently trying to build the latest version of Synfig Studio from source using CMake on Manjaro 16.10 64bit KDE Linux.

The build of ETL and synfig-core go perfectly.

However the build of synfig-studio fails on building the images. Where I’m currently stuck is:

$ cmake --build . -- build_images Scanning dependencies of target build_images synfig: error while loading shared libraries: libsynfig.so: cannot open shared object file: No such file or directory make[3]: *** [images/CMakeFiles/build_images.dir/build.make:57: build_images] Error 127 make[2]: *** [CMakeFiles/Makefile2:217: images/CMakeFiles/build_images.dir/all] Error 2 make[1]: *** [CMakeFiles/Makefile2:224: images/CMakeFiles/build_images.dir/rule] Error 2 make: *** [Makefile:188: build_images] Error 2

Incidentally, the Synfig Studio AppImage is no good for me, as you need to have SELinux to use it, and Manjaro doesn’t use this.

I can also no-longer build either synfig-core or synfig studio with autotools, as make complains of having no targets.

Judging by the error you give, something went wrong with synfig-core install step, so even if you’d use pre-built images it won’t be of much help. Quiet likely, you need to run ldconfig (from root) after installing. Otherwise, we’ll have to investigate deeper:

I suppose just running synfig gives the same linking error? Have you changed install path? Do you have any previous successful experience with building and installing CMake-based apps on your system? Do you have any previous synfig installation on your system at the moment?

Please upload output of "ldd which synfig" and install_manifest.txt from synfig-core build/ directory.

As for autotools build system, is your issue the same as here: github.com/synfig/synfig/issues/311?

Also, i can try building a generic binary tarball if you’re interested in testing.

Yes, the autotools error is the same as the one in the link.

I tried ldconfig as root when I was trying to install synfig, and that didn’t help.

I needed to do some animation I needed to do this evening, so I deleted my local CMake install of 1.2 and installed 1.0.2 from the Manjaro repository, but I’ll delete this and try installing 1.2 using CMake from scratch next week and send you the output you requested.

I’d like to help you get the CMake working on Manjaro if I can.

Many, many thanks for your help and all your work on Synfig - I have seen all your commits on the Synfig develop list and you’ve done some wonderful work for us all.

Another possible source of problem is missing dependencies, i think. So if you have libsynfig.so installed in the same place as it is referenced in ldd output for synfig binary, “ldd /path/to/libsynfig.so” might be more useful. That said, it sounds more strange (why would cmake finish linking if deps are missing?) than simply linker unable to find library. Maybe you should try setting LD_LIBRARY_PATH env variable (e.g. “LD_LIBRARY_PATH=/usr/local/lib synfig --version”). I’m not really specialist on these things since they just work for me, but that might be because i have /usr/local/lib in /etc/ld.so.conf.d/ by default.

You’re welcome :slight_smile: