Migrate linux build system from autotools to cmake + other build system changes for 1.0.0 release

For discussion of the code running behind the game

Moderator: Staff

User avatar
Posts: 8666
Joined: Wed Jun 16, 2004 6:07 pm
Location: Austin TX

Migrate linux build system from autotools to cmake + other build system changes for 1.0.0 release

Postby Roots » Wed Sep 09, 2015 3:01 am

http://stackoverflow.com/questions/4071 ... e-vs-scons

I had the thought tonight that maybe Allacrost would be better served on Linux to move to a new build system. We've been using autotools since the beginning for Linux and while it works, it's horribly difficult to maintain due to the complexity of it, and there are already a couple open issues that are related to problems with it. I read tonight that Valyria Tear is converting their editor to Qt5, and doing so required a very simple and easy change to their build files. And since VT already uses CMake, that's a good incentive for us because it should be easy to take their build files and modify them to work with ours (we use nearly the same libraries and code organization).

I'm going to play around with CMake on the side and see if I can get it working for Allacrost. If I do and the result is just as good or better than our current autotools solution, I think it would be wise to migrate over to it. I'm open to other build systems as well, but CMake right now seems like the easiest and most obvious choice. This should not affect other systems, although I believe that CMake has better support for cross-compiling on Windows (wouldn't it be awesome to have two build systems to maintain instead of three?). But that can be explored at a later date if we do move to CMake on Linux.
Senior Member
Posts: 157
Joined: Fri Apr 29, 2011 7:53 am
Location: Sachsen/Germany

Re: Migrate Linux build system from autotools to cmake/other

Postby nemesis » Sun Sep 13, 2015 11:38 pm

I was playing around with SCons in some of my last projects. It works quite well and has a nice interface. Migrating to CMake would be nice but I fear I won't solve all issues with different operating systems. I don't know how good the macros provided there are but giving it a try is definitely worth. Especially since it works pretty well for Valyrias Tear.

However, nevertheless I would suggest maintaining the original autotools files as well for the (unlikely case) that on some (exotic) platforms CMake will not produce to correct correct results.
User avatar
Posts: 8666
Joined: Wed Jun 16, 2004 6:07 pm
Location: Austin TX

Re: Migrate Linux build system from autotools to cmake/other?

Postby Roots » Tue Sep 13, 2016 5:01 pm

I've been looking into cmake again this week. More generally, I've been looking into making changes to our build process as a whole in preparation for the upcoming 1.0.0 release.

Here's what my ideal build system would be:
1) Be fine with having only a single makefile for the entire source tree (I would hate to have a makefile in each of our 20+ sub-directories)
2) Allow build files (C++ .o files, for instance) to be placed in a specified directory, and not in the base directory or the same directory as the source code
3) Be easy to use and maintain, and not require writing custom macro code to satisfy certain requirements (we have some m4 scripts for our autotools build)
4) If possible, be cross-platform so it can be used on Linux and Windows with MinGW. OS X support would be nice as well

Here are my thoughts so far on an improved build system:

1) A new directory, build/, will be used to hold any files used only for the build process
Of course I expect some files will still be located in the main directory. Project files, perhaps. For cmake, we'd have a directory: build/cmake/modules, where these module files are used to search for all the appropriate libraries

2) cmake will only be used for the Linux build, for now
Eventually we may look into using cmake to build on other platforms as well, as it is cross-platform. But for now I just want to focus on getting it working for Linux.

3) Generated build files will be placed in build/, or perhaps build/generated/ or another subdirectory
*.o files, specifically. Right now they are dumped to the main directory with autotools and it really pollutes the directory space making it hard to find other files.

4) Configure the build system so only a single Makefile is generated
I know some projects create a Makefile in each source directory, but honestly I don't like that and don't see a reason for it. A single makefile is fine, and that's what is generated with autotools right now.

5) Remove any old build files that we no longer maintain
I think there's still some visual studio stuff laying around that hasn't been used in many years. It can be confusing for someone new to the project who thinks we have a VS build available.

6) Add installer programs for Windows (and OS X?)
In past releases I'm pretty sure we had a windows installer program that put all our files in the right place. I don't really know anything about install processes on Windows or OS X though.

7) Prepare Allacrost for packaging in .deb and .rpm formats
The next official release should be made available on Linux systems in a more convenient fashion. Not many people are willing to grab the source package, compile it, and install it themselves. If we want to have a solid Linux player base, we must do this.

Any thoughts or suggestions on how our build process can be improved? Or concerns with what I outlined above?

Return to “Programming”

Who is online

Users browsing this forum: No registered users and 1 guest