Generating Build Systems

Describes how to generate build systems for already defined projects using CMake on Windows, macOS, and Linux.

Overview

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:

  • Windows: Visual Studio 2022 and the v143 MSVC toolset (v142 might work too but is out of scope of support)
  • Windows: Visual Studio 2022 and Clang
  • macOS: Xcode and Clang
  • Linux: Ninja and GCC

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.

C++ Standards

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.

Note
Developers porting plugins to the 2025.2.0 SDK who wish to migrate to the CMake SDK but do not have the time to update their code base to C++20, can set the 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.
Warning
We strongly recommend migrating code bases to C++ 20 at the latest with Cinema 4D 2026.0.0, as your code base otherwise might become incompatible with future Cinema 4D releases. Cinema 4D 2025.2.X releases will still be compatible with C++17 codebases.

Generating Build Systems for Windows

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.

Fig. I: Setting up Visual Studio build systems for Cinema 4D projects using CMake.
Configuration Phase

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.

Warning
We cannot offer any support or guarantee of functionality outside of the provided build system presets. Different versions of Visual Studio, build tools, or compilers might not work at all, or worse - might work only partially without you noticing first. When you must deviate from the recommended options, still choose a preset, but then modify the Configure popup dialog to your environment.
Generation Phase

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.
Warning
The default startup project of a solution is 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.
Note
The debug application can also be set manually in Visual Studio. Right-click on a project to open its context menu and select 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.

Generating Build Systems for macOS

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.

Fig. II: Setting up Xcode build systems for Cinema 4D projects using CMake.
Configuration Phase

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.

Warning
We cannot offer any support or guarantee of functionality outside of the provided build system presets. Different versions of Visual Studio, build tools, or compilers might not work at all, or worse - might work only partially without you noticing first. When you must deviate from the recommended options, still choose a preset, but then modify the Configure popup dialog to your environment.
Generation Phase

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.
Warning
For Xcode, the automatic configuration of a debug application and its debug options is only semi-functional at the moment. Setting the option 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.
Note
The debug application can also be set manually in Xcode. Select a scheme and set the debug executable to a matching Cinema 4D executable. The debug arguments are set in the scheme settings. You must set 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.

Generating Build Systems for Linux

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.

Fig. III: Setting up Ninja Linux build systems for Cinema 4D projects using CMake.
Configuration Phase

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.

Warning
We cannot offer any support or guarantee of functionality outside of the provided build system presets. Different versions of Visual Studio, build tools, or compilers might not work at all, or worse - might work only partially without you noticing first. When you must deviate from the recommended options, still choose a preset, but then modify the Configure popup dialog to your environment.
Generation Phase

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.

Troubleshooting

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'.
Note
On Linux it is normal that the 'Open Project' button does not enable, as there is no project being generated, just a Ninja build system.
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.