Describes how to generate build systems for already defined projects using CMake on Windows, macOS, and Linux.
Cinema 4D uses CMake as its build system generator. Currently, CMake version 3.30 or higher is required to run the Cinema 4D SDK CMake scripts. CMake requires a Python installation to operate. The following build systems are supported:
The intended way to use the Cinema 4D CMake scripts is the CMake GUI, as we provide predefined configurations for CMake. We can only provide limited support for using CMake from the command line with our scripts.
The CMake C++ SDK is targeting C++20, unlike the Project Tool SDK which targets C++17. Generating a build system for the 2025.2.X C++ SDK with the Project tool will for example generate a project targeting C++17 (MSVC solutions will actually only enforce their default of C++14), while generating a build system for the same SDK with CMake will target the C++20 standard. The C++ standard of a CMake project can be set in the CMake GUI under the CMAKE_CXX_STANDARD
option (see sections below).
We strongly recommend leaving this option at its default value of 20
to ensure compatibility with the Cinema 4D C++ SDK. Cinema 4D has complied internally with C++20 since release 2025.0.0, which until now was hidden from third parties. The public API of Cinema 4D is still C++17 compliant for 2025.2.X SDK releases. This, however, will likely change in future releases.
CMAKE_CXX_STANDARD
option to 17
as a quick fix. We cannot provide any support for this configuration and it is not recommended for new projects.Describes how to generate Visual Studio build systems on Windows.
Generating a build system with the CMake GUI splits into two phases, a configuration and a generation phase, each invoked by a button press in the middle of the CMake GUI. The video below will take you through all the necessary steps on Windows.
In this phase, basic inputs such as the path of a project, the path of its outputs, and the type of build system which should be generated are defined. The actual configuration, the configuration dialog, is mostly sidestepped in a Cinema 4D project since presets are provided which predefine these configuration settings. The following settings must be defined:
Option | Description |
---|---|
Where is the source code | Set this to the root folder of your project, not the modules/plugins folder in the project. |
Preset | Select here the build system to target. On Windows, you can choose between MSVC (e.g., Visual Studio 2022 v143 ) and Clang (e.g., Visual Studio 2022 ClangCL ). |
Where to build the binaries | The path where CMake will generate the build system. When a preset is picked, this path will be auto-populated but it can be customized. |
Once all these settings are made, the Configure
button will enable and can be clicked to configure the build system. A dialog will open, allowing us to set configuration details. But due to the selected preset, all configuration settings will already be set, and one can directly click Finish
. CMake will now copy relevant data and print output to its console. There should be no errors in the console and when successful, the Generate
button will be enabled.
In the generation phase, settings specific to the Cinema 4D C++ SDK can be made and the final project files will be generated. The available options are:
Option | Type | Description |
---|---|---|
CMAKE_CXX_STANDARD | CMake | Defines the C++ standard which shall be used for the project. Defaults to 20 and should not be changed. See also C++ Standards. |
MAXON_C4D_EXECUTABLE | SDK | Defines the file path where a Cinema 4D executable can be found which shall be used as a debug application for debugging plugin binaries. Setting this option is not mandatory, one can also set the debug application manually in the IDE. Setting this option will not only set the debug application but also feed the project's binary output as additional module paths to that Cinema 4D instance. |
MAXON_FILTER_UNUSED_FRAMEWORKS | SDK | Setting this option to true will only include frameworks in the project which have been referenced in the project definitions of modules. This can cut down build times and minimally reduce file sizes of built binaries. |
MAXON_MODULES_DIR | SDK | Defines the location of the modules folder. Defaults to a plugins folder in the project. |
MAXON_SDK_CUSTOM_PATHS_FILE | SDK | Defines a file to take module paths and aliases from. See Custom Paths for details on how to use this feature. |
MAXON_SDK_EXTERNAL_LIBS_DIR | SDK | Defines the location of the external libs folder. Defaults to a libs folder in the project. |
ALL_BUILD
, which does not have any debug options set. When setting MAXON_C4D_EXECUTABLE
, one must set one of the module projects as the startup project in order to use the preset debug options.Set as Startup Project
. Then open the 'Properties' from the context menu and under Debugging
to set the Command
to a matching Cinema 4D executable. As the Command Arguments
in that section, set g_additionalModulePaths
to the binary output of your project, e.g., g_additionalModulePath=D:/documents/sdk/_build_v143/bin/Debug/plugins/
.The only setting that must be regularly set is MAXON_C4D_EXECUTABLE
(but even that is optional). Once all settings are made, the Generate
button must be pressed. CMake will again print output to the console and there should be no errors. When the generation is successful, the Open Project
button will be enabled and can be used to open the project.
Describes how to generate Xcode build systems on macOS.
Generating a build system with the CMake GUI splits into two phases, a configuration and a generation phase, each invoked by a button press in the middle of the CMake GUI. The video shown below will take you through all necessary steps on macOS.
In this phase, basic inputs such as the path of a project, the path of its outputs, and the type of build system which should be generated are defined. The actual configuration, the configuration dialog, is mostly sidestepped in a Cinema 4D project since presets are provided which predefine these configuration settings. The following settings must be defined:
Option | Description |
---|---|
Where is the source code | Set this to the root folder of your project, not the modules/plugins folder in the project. |
Preset | Select here the build system to target, Xcode macOS Universal under macOS. |
Where to build the binaries | The path where CMake will generate the build system. When a preset is picked, this path will be auto-populated but it can be customized. |
Once all these settings are made, the Configure
button will enable and can be clicked to configure the build system. A dialog will open, allowing us to set configuration details. But due to the selected preset, all configuration settings will already be set, and one can directly click Finish
. CMake will now copy relevant data and print output to its console. There should be no errors in the console and when successful, the Generate
button will be enabled.
In the generation phase, settings specific to the Cinema 4D C++ SDK can be made and the final project files will be generated. The available options are:
Option | Type | Description |
---|---|---|
CMAKE_CXX_STANDARD | CMake | Defines the C++ standard which shall be used for the project. Defaults to 20 and should not be changed. See also C++ Standards. |
MAXON_C4D_EXECUTABLE | SDK | Defines the file path where a Cinema 4D executable can be found which shall be used as a debug application for debugging plugin binaries. Setting this option is not mandatory, one can also set the debug application manually in the IDE. Setting this option will not only set the debug application but also feed the project's binary output as additional module paths to that Cinema 4D instance. |
MAXON_FILTER_UNUSED_FRAMEWORKS | SDK | Setting this option to true will only include frameworks in the project which have been referenced in the project definitions of modules. This can cut down build times and minimally reduce file sizes of built binaries. |
MAXON_MODULES_DIR | SDK | Defines the location of the modules folder. Defaults to a plugins folder in the project. |
MAXON_SDK_CUSTOM_PATHS_FILE | SDK | Defines a file to take module paths and aliases from. See Custom Paths for details on how to use this feature. |
MAXON_SDK_EXTERNAL_LIBS_DIR | SDK | Defines the location of the external libs folder. Defaults to a libs folder in the project. |
CMAKE_OSX_ARCHITECTURES | CMake | Defines the architectures which shall be built. Defaults to arm64; x86_64 . |
MAXON_C4D_EXECUTABLE
before the project has been built at least once will lead to a broken project. You must first compile your project at least once and then set the option MAXON_C4D_EXECUTABLE
. See Fig. II for a demonstration.g_additionalModulePaths
to the binary output of your project, e.g., g_additionalModulePath=/Users/Documents/sdk/_build_xcode/bin/Debug/plugins/
.The only setting which must be regularly set is MAXON_C4D_EXECUTABLE
(but even that is optional). Once all settings are made, the Generate
button must be pressed. CMake will again print output to the console and there should be no errors. When the generation is successful, the Open Project
button will be enabled and can be used to open the project.
Describes how to generate Ninja build systems on Linux.
Generating a build system with the CMake GUI splits into two phases, a configuration and a generation phase, each invoked by a button press in the middle of the CMake GUI. The video shown below will take you through all necessary steps on Linux.
In this phase, basic inputs such as the path of a project, the path of its outputs, and the type of build system which should be generated are defined. The actual configuration, the configuration dialog, is mostly sidestepped in a Cinema 4D project since presets are provided which predefine these configuration settings. The following settings must be defined:
Option | Description |
---|---|
Where is the source code | Set this to the root folder of your project, not the modules/plugins folder in the project. |
Preset | Select here the build system to target, Linux Ninja for Linux. |
Where to build the binaries | The path where CMake will generate the build system. When a preset is picked, this path will be auto-populated but it can be customized. |
Once all these settings are made, the Configure
button will enable and can be clicked to configure the build system. A dialog will open, allowing us to set configuration details. But due to the selected preset, all configuration settings will already be set, and one can directly click Finish
. CMake will now copy relevant data and print output to its console. There should be no errors in the console and when successful, the Generate
button will be enabled.
In the generation phase, settings specific to the Cinema 4D C++ SDK can be made and the final project files will be generated. The available options are:
Option | Type | Description |
---|---|---|
CMAKE_CXX_STANDARD | CMake | Defines the C++ standard which shall be used for the project. Defaults to 20 and should not be changed. See also C++ Standards. |
MAXON_FILTER_UNUSED_FRAMEWORKS | SDK | Setting this option to true will only include frameworks in the project which have been referenced in the project definitions of modules. This can cut down build times and minimally reduce file sizes of built binaries. |
MAXON_MODULES_DIR | SDK | Defines the location of the modules folder. Defaults to a plugins folder in the project. |
MAXON_SDK_CUSTOM_PATHS_FILE | SDK | Defines a file to take module paths and aliases from. See Custom Paths for details on how to use this feature. |
MAXON_SDK_EXTERNAL_LIBS_DIR | SDK | Defines the location of the external libs folder. Defaults to a libs folder in the project. |
When you run into problems with your project generation, you should read carefully the CMake console output, as CMake will usually tell you exactly what is going wrong. When you still run into troubles, please open a topic on the development forums, providing the full console output of your build system generation attempts.
Problem | Solutions |
---|---|
Button is not enabled | Either the 'Generate' or 'Open Project' button not being enabled after 'Configure' or 'Generate' having been run, usually means that an error occurred in the previous step. Check the CMake console for red text containing the word 'warning' or 'error'.
|
Error in Configuration Phase | CMake is quite sensitive to special characters in file paths, which can break the whole system. Make sure that the paths in Where is your source code and Where to build the binaries are only composed of characters from the alphabet, numbers, and the underscore, hyphen, and point character. Naming your project root folder sdk#2025 for example, will break CMake. |
Errors when trying to run Configure can be caused by missing dependencies for the chosen build system. Ensure that Visual Studio/Xcode has the necessary components installed, such as the Clang compiler or the build tools of a matching version and platform. | |
Error in the Generation Phase | Should usually only happen when you provide a path as one of the options which does not exist or does not contain the expected content. |
Debug Application does not work | The debug application settings are only set on the modules and not the ALL_BUILD or Target All meta-projects. You must set a module as the startup project (Visual Studio) or the debug-scheme (Xcode) to use the preset debug arguments. |