The app comes with packaging through CPack, creating installer for macOS, Windows, and Linux.
General packaging settings are located under packaging/
. Executable specific settings
in src/app/cmake/Packaging.cmake
and OS specifics under src/app/cmake/packaging/
.
General packaging settings are in packaging/CMakeLists.txt
. It defines names, versions, metadata, where to build the
package to (build/distribution/
), and more.
For macOS a .dmg
(DragNDrop) file will be generated. Resources for the installer are located under packaging/dmg/
,
containing the background image for the DMG view and an apple script to generate the custom DMG view.
Packaging settings for the application executable are in src/app/cmake/packaging/Darwin.cmake
.
The final application build for Apple devices should be built via the Xcode
generator with CMake.
cmake -GXcode -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" -B build/xcode
cmake --build build/xcode --config Release
On Windows a .exe
is created via NSIS. NSIS needs to be installed in
Windows to create the package. Resources for the installer are located under packaging/nsis/
, containing installer
images and the uninstaller icon.
Packaging settings for the application executable are in src/app/cmake/packaging/Windows.cmake
.
For windows there are also installer texts defined in packaging/CMakeLists.txt
. Specifically a welcome text,
description, readme, and license; as txt files under packaging/
. The CPack variables are:
set(CPACK_RESOURCE_FILE_WELCOME ${CMAKE_CURRENT_LIST_DIR}/Welcome.txt)
set(CPACK_PACKAGE_DESCRIPTION_FILE ${CMAKE_CURRENT_LIST_DIR}/Description.txt)
set(CPACK_RESOURCE_FILE_README ${CMAKE_CURRENT_LIST_DIR}/Readme.txt)
set(CPACK_RESOURCE_FILE_LICENSE ${CMAKE_CURRENT_LIST_DIR}/License.txt)
On Linux a .deb
file will be created that can be installed via the systems package manager.
Packaging settings for the application executable are in src/app/cmake/packaging/Linux.cmake
.
A release build is needed before creating the distribution package. Packages for a system are created on the system.
Xcode should be used to create the release build for the application distributable.
cmake -GXcode -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" -B build/xcode
cmake --build build/xcode --config Release
cpack --config build/xcode/CPackConfig.cmake
Attention: Creating the package will open a Finder window a couple of times to set the DMG window properties. This windows should be ignored and will auto-close.
cmake -GNinja -DCMAKE_BUILD_TYPE=Release -B build/release
cmake --build build/release
cpack --config build/release/CPackConfig.cmake
Next up: Cmake Presets