Tag Archives: Open Source

Portable C++ Applications with Non-Portable Build Systems

A common setup I see in open source projects is to use makefiles as a way to build its source code.  The code itself is standard C++ (and thus portable to different compilers and operating systems), however that does me no good if I have to struggle to get it to compile on my platform (Windows in particular). This is the same as me handing off my third party library to a Linux developer with Visual Studio projects in it. They can’t really do anything with that. The trouble I have to go through to install Cygwin and learn the required build steps and tools isn’t worth the time to me.

Why is it that as software engineers we neglect our build systems? I strongly believe the build system is just as important as the code itself, especially for open source middleware projects (Take OpenSSL for example). A build system should address what I believe are the two most important ideas. First, the build system has to allow the developer to build the source using the development environment/tools of their choosing. Second, the build system needs to be easily automated (for not only generating automatic builds but for automated testing too).

Makefile scripts can certainly address the second point, however the first point they do not address. If I am a Windows developer and decide to contribute to an open source code base dominated mostly by Linux developers, I’m a bit out of luck in the “convenience” department. Working out of VIM/EMACS and ‘make’ suits a Linux developer, especially if they don’t have a GUI frontend for their OS. However, on Windows I have Visual Studio and I would love the ability to take advantage of using that IDE (or any IDE for that matter). Not only does this benefit the Windows developers, but it encourages more people to join in on the project because we can jump straight into worrying about the code and not have to deal with a frustrating and confusing build pipeline.

This philosophy on build systems is something I’ve acquired over the years after I was introduced to CMake. It’s a fantastic tool that you can use to generate scripts/projects for the build tools of your choice. For example, I can take the same CMake scripts and generate makefiles on Linux and Visual Studio project files on Windows. This is such an obviously great thing to have, I am quite frankly appalled that more projects (both open source and proprietary, such as products you will find at software companies) don’t use them. It’s been a struggle so far to get people to migrate to CMake at the company I’m working for now, but it’s not because they fail to find the value in the tool itself. It’s just a matter of migrating over (which is a whole process in itself, especially for a large company). Fortunately it’s a lot easier to migrate to something like this in an open source project where things are not as strict and risk is lower, so I hope to see more things moving towards CMake in the future. The least I can do is blog about what I feel is important and share information about CMake itself. Hopefully this will help spread the word.

About HareSVN

On my spare time, I usually work on my personal open source project called HareSVN. It’s a fairly ambitious project with the goal of becoming a portable, GUI Subversion client. For those who have heard of TortoiseSVN, it will follow the same design principle for the most part. You will be working out of a context menu to access most of the features and functionality. The big difference is that HareSVN will not be using shell integration. This can’t be done in a portable way since features vary between platforms.

Because shell integration will not be used, this means the program will come with its own file-browser. I aim to make it follow the same look-and-feel of Windows Explorer on Windows XP. However, the interface design for this has not been started. I’d post some mock ups if I could. However, the basic vision I have for it is that it will be very familiar to what you use already (Windows + TortoiseSVN).

I’ve always loved TortoiseSVN, and I think Stefan and his team has done (and continues to do) a great job on this piece of software. However, there are some architectural issues, such as portability, that cannot simply be added to TortoiseSVN and would require a full rewrite anyway. I’ve taken it upon myself to start a new project that will hopefully address some of the missing features I always wanted in TortoiseSVN.

Oh, and why did I name it HareSVN? Because when I hear “TortoiseSVN”, I think of the fairy tale “Tortoise and the Hare”. Yes, yes… I know the hare loses :(