CMake leverages the Snapcraft Summit with Travis CI to build snaps

by Sarah Dickinson on 18 July 2019

CMake is an open-source, cross-platform family of tools designed to build, test and package software. It is used to control the software compilation process and generate native makefiles and workspaces that can be used in any compiler environment. 

While some users of CMake want to stay up to date with the latest release, others want to be able to stay with a known version and choose when to move forward to newer releases, picking up just the minor bug fixes for the feature release they are tracking. Users may also occasionally need to roll back to an earlier feature release, such as when a bug or a change introduced in a newer CMake version exposes problems within their project.

Craig Scott, one of the co-maintainers of CMake, sees snaps as an excellent solution to these needs. Snaps’ ability to support separate tracks for each feature release in addition to giving users the choice of following official releases, release candidates or bleeding edge builds are an ideal fit. When he received an invitation to the 2019 Snapcraft Summit, he was keen to work directly with those at the pointy end of developing and supporting the snap system. 

He believes snaps can help projects connect with the user population by providing an easy, trustworthy installation path. In his opinion, “users often do not want to install anything that is not in an official repository, and they want the install process to be both simple and familiar.” Together, the Snap Store and snaps meet these requirements. 

Discoverability of CMake is becoming less of an issue these days. According to Craig, “if you’re working  in C++, CMake is getting hard to ignore. Developer surveys show that CMake has become the leading build system for C++ projects.” Therefore, the biggest benefit of having CMake available in the Snap Store is to give users convenient access to official releases in a timely fashion.

CMake’s active user and developer communities ensure that there is a fairly constant stream of contributions in the form of enhancements and fixes. Continuous integration (CI) is part of CMake’s DNA and Craig plans to use Travis CI to automatically release CMake in the edge channel of the Snap Store, in addition to official releases and release candidates. He spent a couple of days at the Summit working directly with the Travis CI team, working through how to set up the builds to be reliable and easy to maintain. “Some of the challenges were related to automatically determining the feature release track to submit builds to and setting up scheduled daily builds to follow CMake development. I found answers to questions on some of the Travis CI and Snapcraft documentation and worked with both teams to iron out several speed bumps.”.

Improvements to snaps that Craig would like to see include better SELinux compatibility. Improving this would further strengthen the case for snaps becoming the standard way of packaging on Linux. Indeed, “Whether an app or a tool is standard and gaining adoption are important points for me when deciding where to spend my time maintaining a project like CMake.”

Craig also has some advice for developers thinking of using snaps. He suggests, “First, find a project in the Snapcraft Store with similar needs to yours. Then look at how they have structured their Snapcraft builds and integrated them into whichever CI system they are using.” He finds the documentation is sometimes behind concerning the latest patches, so it makes sense to leverage the success of another project that already works.

What did he think of the Summit? Craig was impressed to see how quickly people were putting things together and the overall sense of progress. He also said, “People can come to the Summit not only with the expectation of learning how snaps and Snapcraft work, but also with the goal of getting to know other project maintainers and establishing mutually beneficial networks.” With the range of applications in the Snapcraft Store increasing, he would now like to see the tool chain community representation growing too.


Install the CMake snap here.

Newsletter Signup

Related posts

Snaptastic – elementary OS snap manager

An interesting aspect in the life of any technology is how it propagates. Like organisms in nature, technology follows evolutionary patterns, and sometimes, it can be difficult predicting them. But their observation can be quite telling. Case in point, Snaptastic on elementary OS. Snaptastic is a graphical snap manager utility, available […]

The smart dump plugin

As you probably already know, snapcraft supports a range of plugins, designed to aid developers in making their snaps in an easier, faster, more transparent fashion. Plugins work with different programming languages and build tools, like Python, Java, Rust, Cmake, and others. By making complex things simpler, they can accelerate your proj […]

Easy Linux Game Streaming with OBS

For many, watching other people play games has long taken over from TV as the favoured source of entertainment content. As a creator, whether you stream via YouTube, Twitch.tv or Mixer, Open Broadcast Software (OBS) Studio is the swiss-army knife to do it. The OBS snap makes this a breeze, whichever Linux distro you’re playing […]