Building on macOS#
This guide shows how to build a SAMSON Extension on macOS with Qt Creator and CMake.
Use it after you have already installed the SDK and generated an extension workspace. The goal is to configure the root CMake project, build the install target, and run the correct SAMSON executable for Debug or Release.
Requirements#
If you have not installed the SAMSON SDK yet, complete Installation first.
- Clang, available with Xcode
- CMake 4.0 or newer
- Qt 6.10.2
- Qt Creator or another supported IDE such as Xcode
This page uses Qt Creator as the primary workflow because it aligns well with the generated CMake project.
Configuration of a project in Qt Creator#
Open Qt Creator and choose Open Project... or File > Open File or Project... (Cmd+O).
Select the root CMakeLists.txt in the extension workspace, not the CMakeLists.txt inside one extension folder.

Building for x86_64 on ARM64#
Important
The shipped SAMSON SDK is currently provided for x86_64. On Apple Silicon machines you therefore need to build the extension for x86_64 compatibility.
Change CMakeLists.txt#
If you are on an ARM64 Mac, add the following line near the top of the root CMakeLists.txt, immediately after CMAKE_MINIMUM_REQUIRED:
Create a kit for x86_64 on ARM64#
Create or reuse a Qt Creator kit that targets x86_64:
- Open Manage Kits...
- Clone the auto-detected Qt 6.10.2 macOS kit
- Rename it clearly, for example by adding
x86_64 - Set both the C and C++ compilers to Apple Clang (x86_64)

Configure Project#
- Choose the correct kit
- Expand Details
- Configure both build directories:
-
Debug:PathToExtensions/build/Debug-Release:PathToExtensions/build/Release - Click Configure Project

If Qt Creator reports errors after the first configure step, continue with the CMake variables below.
Build Settings#
CMake configuration#
Add the variables expected by the generated workspace:
- Add a string variable named
SAMSON_SDK_PATHand set it to:$HOME/OneAngstrom/SAMSON-Sdks/11.0.0 - Add a boolean variable named
DEBUG. - Set it toONfor theDebugconfiguration - Leave itOFFfor theReleaseconfiguration - Click Re-configure with Initial Parameters

Build Steps#
To ensure the extension is installed into SAMSON automatically:
- Scroll to Build Steps
- Expand the details
- Enable the
installoption

Build#
Open the Edit view to inspect the project tree, then build with Cmd+B or Build > Build Project "SAMSON-Elements".

Checkpoint:
- the project configures successfully
- the build succeeds
- the
installstep copies the extension into the expected SAMSON location
Note
Building the install target automatically builds the project if needed.
Run Settings#
As on other platforms, the SAMSON executable must match the build configuration:
Debugextension builds run against the SAMSON Debug executable from the SDKReleaseextension builds run against the normal SAMSON application installation
In Projects mode (Cmd+5), create one run configuration for each build configuration and set the executable:
$HOME/OneAngstrom/SAMSON-Sdks/11.0.0/SAMSON-Debug/Binaries/SAMSON-Core-Console
$HOME/Applications/SAMSON.app/11.0.0/Binaries/SAMSON-Core-Console
Important
Replace $HOME with the actual path to your user directory.
Then add the environment variables needed for Qt frameworks and SAMSON libraries:
DYLD_LIBRARY_PATH=$HOME/OneAngstrom/SAMSON-Sdks/11.0.0/SAMSON-Debug/BinariesDYLD_FRAMEWORK_PATH=$HOME/Qt/6.10.2/macos/lib:$HOME/Applications/SAMSON.app/11.0.0/Binaries
DYLD_LIBRARY_PATH=$HOME/OneAngstrom/SAMSON/11.0.0/SAMSON/BinariesDYLD_FRAMEWORK_PATH=$HOME/Qt/6.10.2/macos/lib:$HOME/Applications/SAMSON.app/11.0.0/Binaries

Run#
Once the run settings are configured:
- build with Cmd+B
- run with Cmd+R
- verify that SAMSON starts and the extension is loaded
Tip
If you pair a Debug build with a Debug run configuration, you can debug the extension directly from Qt Creator.
Adding files to a SAMSON Extension#
When you add or remove source files, classes, or resources, regenerate the project by:
- rerunning CMake, or
- making a small change to the relevant
CMakeLists.txtfile and letting Qt Creator reconfigure automatically on the next build
Adding new SAMSON Extensions to the project#
If you generate new extensions in the same workspace, the Extension Generator updates the root CMakeLists.txt through ADD_SUBDIRECTORY. The next CMake reconfiguration should add the new extension targets automatically.
Troubleshooting#
- On Apple Silicon, confirm that you are using an
x86_64kit when targeting the shipped SDK. - If SAMSON starts but the extension does not load, verify that the run configuration matches the build configuration.
- If Qt Creator reports stale targets, trigger a fresh CMake reconfiguration.
If you have questions or issues, use the SAMSON Connect Forum or contact us.
Next steps#
- Continue with Developing GUI if the extension includes Qt forms or windows.
- Continue with Publishing a SAMSON Extension when the macOS build workflow is stable.