Building Musa CAD
Musa CAD builds from a fresh clone. Apart from a C++23 compiler, Qt 6 and the Vulkan headers, everything it needs is fetched by the build itself, and it depends on no other CAD library.
Prerequisites
Section titled “Prerequisites”| What | Minimum | Notes |
|---|---|---|
| C++23 compiler | GCC 13, Clang 17, or MSVC 19.38 (Visual Studio 2022 17.8) | -std=c++23, no extensions |
| CMake | 3.25 | uses presets version 6 |
| Ninja | 1.10 | the presets’ generator |
| Qt 6 (Core, Gui, Widgets) | 6.4 | the window and the event loop |
| Vulkan loader and headers | 1.3 | needed to configure; the drawing area itself uses OpenGL, and nothing links Vulkan |
Catch2, for the unit tests, is downloaded by CMake when the tests are built.
On Debian or Ubuntu:
sudo apt-get install -y build-essential cmake ninja-build qt6-base-dev libvulkan-devgit clone https://github.com/MusaCAD/MusaCAD.gitcd MusaCADcmake --preset releasecmake --build --preset releaseThe program is build/release/bin/musacad_app. To draw, it needs a graphics driver with OpenGL 4.5 (Mesa for Intel and AMD, or NVIDIA’s driver).
You need:
- Visual Studio 2022 (17.8 or newer) with the Desktop development with C++ workload. The Build Tools edition is enough. Add the C++ AddressSanitizer component if you want the
devpreset. - CMake and Ninja (they come with Visual Studio, or install them on their own).
- Qt 6, from the Qt online installer or with aqtinstall as the project’s CI does:
aqt install-qt windows desktop 6.8.1 win64_msvc2022_64 -m qtimageformats. - The Vulkan SDK from LunarG is optional.
Build from an x64 Native Tools Command Prompt, so the presets find the compiler:
cmake --preset release -DCMAKE_PREFIX_PATH=C:/Qt/6.8.1/msvc2022_64cmake --build --preset releaseThe build tree has no Qt DLLs next to the programs. To run one from there, put C:\Qt\6.8.1\msvc2022_64\bin on PATH (the tests find Qt by themselves). Two programs are built in build\<preset>\bin: musacad_app.exe, the window, and musacad.exe, the console front-end that scripts use (see the command line).
With Qt 6, Ninja and rsvg-convert (brew install ninja librsvg):
cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DENABLE_SANITIZERS=OFF -DENABLE_TSAN=OFFcmake --build build --target musacad_appThe command line works. The drawing area does not open, because macOS has no OpenGL 4.5; see Install on macOS. Making the app bundle and disk image is described in Packaging.
The presets
Section titled “The presets”| Preset | What it builds |
|---|---|
release | Optimised, no sanitizers, no tests. |
dev | Debug, with AddressSanitizer and UndefinedBehaviorSanitizer (AddressSanitizer only on MSVC), and the unit tests. |
tsan | ThreadSanitizer, for the concurrency tests. It cannot be combined with the dev sanitizers. |
cmake --preset dev && cmake --build --preset dev && ctest --preset devSee Tests for what the test run covers, and for the ThreadSanitizer setup.
DWG support
Section titled “DWG support”DWG support is not compiled in, and adds nothing to the build. Musa CAD is LGPL; the DWG converters are GPL (LibreDWG) or proprietary (the ODA File Converter), so Musa CAD never links, bundles or ships them. It runs a converter as a separate program and reads the DXF it produces. A fresh build handles DXF straight away; for DWG, see DWG files.
Check a build without a screen
Section titled “Check a build without a screen”Setting MUSACAD_SMOKE makes the program show its window and quit at once, which checks a clean start:
MUSACAD_SMOKE=1 QT_QPA_PLATFORM=offscreen ./build/dev/bin/musacad_appOn a machine with no OpenGL 4.5 (most CI runners), this ends with exit code 2 and the message that the viewport cannot be created. That is expected; the command line still works there.