-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #80 from Holzhaus/new-in-2-3-cmake
New in 2.3: Add CMake post
- Loading branch information
Showing
1 changed file
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
title: New in 2.3: Build Mixxx with CMake | ||
author: Holzhaus | ||
date: 2020-07-15 10:00:00 | ||
|
||
{% extends "post.html" %} | ||
|
||
{% block post %} | ||
|
||
{% load markup %} | ||
{% filter markdown %} | ||
|
||
Starting with Mixxx 2.3, we're introducing experimental support for [CMake](https://cmake.org/). | ||
This will probably be more interesting for people who are either compiling Mixxx themselves or going hack on its code base than for regular users, but it will make the build process more straightforward in the future. | ||
|
||
Mixxx has used [SCons](https://www.scons.org/) as its build system for more than 13 years. | ||
Since it's based on the Python programming language, it's quite flexible and can be used to customize every build step. | ||
Unfortunately, it requires lots of boilerplate code to accomplish simple tasks. | ||
This makes our build scripts hard to maintain on all platforms and has lead to problems in the past. | ||
|
||
Hence, we added support for the CMake build system (*or rather:* build system generator), which many C++ developers are already be familiar with. | ||
This has several advantages: | ||
|
||
- The code is more maintainable and requires fewer platform-specific hacks. | ||
Also, less code is necessary. To give you a rough idea: | ||
We managed to reduce the line count from approximately 8000 lines of Python code down to a 2300 line `CMakeLists.txt` file plus modules. | ||
All in all we reduced the line count by almost 3000 lines. | ||
- If you prefer a graphical "build" button over compiling Mixxx on the command line, this is now possible: | ||
IDEs such as [KDevelop](https://www.kdevelop.org/features), [Visual Studio](https://docs.microsoft.com/en-us/cpp/build/cmake-projects-in-visual-studio?view=vs-2019) or [CLion](https://www.jetbrains.com/en-us/clion/features/cmake-support.html) have support for CMake built-in. | ||
There is even a [standalone GUI](https://cmake.org/runningcmake/) that you can try. | ||
- Improved caching: | ||
Unnecessary recompilation is annoying and a waste of time. | ||
To avoid this, we had a custom caching solution in SCons, which cached the compilation units based on the git branch you're working on. | ||
This solution took a lots of disk space and also had occasional issues with failed builds. | ||
With CMake, we added support for [ccache](https://ccache.dev/) (and [clcache](https://github.com/frerich/clcache) on Windows), which makes development significantly faster. | ||
- Arguably, CMake is vastly more popular than SCons, so we hope that more people be able to build and contribute to Mixxx. | ||
|
||
Note that there are still some [issues with building Mixxx on macOS with CMake](https://mixxx.zulipchat.com/#narrow/stream/109171-development/topic/cmake.20on.20macOS/near/194884364), so if you own a Mac we'd appreciate if you help us out. | ||
Apart from that, it's already working quite well. | ||
Most of our core developers already switched over to CMake as their daily driver when working on Mixxx, but since it hasn't been as widely tested as we'd like, we label the support as "experimental" for the 2.3 release and stick with SCons for the release builds. | ||
We plan to drop SCons and fully migrate over to CMake in 2.4. | ||
|
||
If you want to try out building Mixxx with CMake yourself, check the instructions in [our wiki](https://github.com/mixxxdj/mixxx/wiki/Compiling-On-Linux#cmake). | ||
|
||
{% endfilter %} | ||
{% endblock %} |