Describes how to configure build systems using projectdefinition.txt
files.
Cinema 4D uses CMake to generate projects. But to configure the build settings of a module, it currently still uses projectdefinition.txt
files, the build system generator configuration files of the former project generation tool used by the Cinema 4D C++ SDK, the Project Tool. It is possible to switch to a pure CMake setup, see Pure CMake Workflow for details, but project tool files are the recommended way to configure build systems. This manual describes the syntax of projectdefinition.txt
files which can be found in the project
folder of each module as shown in Fig. I.
project
folder of a module. By default this is done with projectdefinition.txt
files. When alternatively a CMakeLists.txt
file is provided, it will take precedence over the other configuration type. Migrating projects written for the Project Tool will require in most cases no, or only minimal changes, as the CMake setup is largely compatible with Project Tool configurations and uses the same file format, projectdefinition.txt
files. When the configuration files of your plugins are relatively simple and similar to what could be found in past SDKs, you very likely will be able to just run CMake without any changes.
In any case, migrating should start by following the Generating Build Systems guide to see if you encounter any errors at all. The following differences exist between Project Tool and the new CMake configurations.
Change | Description |
---|---|
Language Standard | With CMake, the Cinema 4D SDK targets C++ 20, unlike the Project Tool which targeted C++ 17. See C++ Standards for more information. |
Solution Definitions | The Project Tool system used a projectdefinition.txt file in the modules folder of a project, e.g., in root/plugins/project/ , to define the modules which shall be loaded. While this file is still shipped with the 2025.2.X SDK, it only exists for legacy Project Tool support. The CMake system either automatically ingests all modules in the path MAXON_SDK_MODULES_DIR , which is set by default to root/plugins , or reads the MAXON_CUSTOM_PATHS_FILE file can contain a list of custom module paths. See Custom Paths for details. |
Relative Paths | The Project Tool system could use relative paths to reference files and folders in the project. The CMake system uses absolute paths or path aliases. This means that paths in projectdefinition.txt files must be updated to use absolute paths or using path aliases. See General Conventions for details on how path aliases work. This usually only applies in expert projects which use external libraries, header files, or source code that must be included manually.
|
AdditionalSolutionFiles | The AdditionalSolutionFiles argument in projectdefinition.txt files has been deprecated. There is no alternative for this argument in CMake. The major use case for this argument, to include the natvis files for the cinema.framework and core.framework , now has been automated. |
Include.{OS} | This configuration variable has not been deprecated, but it cannot be used anymore to include header files. Use the build system specific options such as AdditionalIncludeDirectories , HEADER_SEARCH_PATHS , or SystemIncludePaths instead.
|
StrictIncludeDirectories | This configuration variable has been deprecated without a replacement, as Include.{OS} is not anymore meant to include header files, i.e., all includes act as if this would be set to true . |
FRAMEWORK_SEARCH_PATHS | This configuration variable has been deprecated without a replacement. |
The following conventions are used in projectdefinition.txt
files:
Convention | Description |
---|---|
Comments | Comments are marked with // and can be placed at the end of a line or on a line by themselves. |
Keywords | Configuration variable keywords are case insensitive, e.g., both C4D=true and c4d=true are valid statements. |
Values | Values assigned to a variable are separated by an equal sign, e.g., FOO = 1 .
|
Boolean Values | Configuration variable that can be either enabled or disabled, can take the values true or false , e.g., FOO = true . |
List Values | Many configuration variables accept optionally a list of values separated by a semicolon, e.g., BAR = 1; 2; 3 is valid just as BAR = 1 would be. Variables which support this usually show this directly in their example. |
Line Concatenations | Overly long lines can be concatenated using the \ character and a line break. |
Postfixes | Many configuration variables support postfixes which allow for specializations by operating system or other factors. E.g., a variable FOO which has the specializations FOO.WIN and FOO.LINUX . These variables are usually documented in the form FOO.{OS} , where .{OS} or a similar placeholder then indicates that the argument can be specialized. The description will then mention which specializations are supported. The description mentioning the 'empty string' means that the variable can be used without a postfix. E.g., FOO.{X} and 'Supports the empty string, BAR and BAZ ' means that FOO can be used without a postfix, as FOO.BAR , or as FOO.BAZ . |
All paths assigned to variables must be absolute paths or use path aliases. Path aliases become relevant in more complex projects which must include external libraries or source code. The average project will likely never have to deal with them. A path alias is denoted by a dollar sign and parentheses, e.g., .
Projects have access to up to four predefined path aliases:
MAXON_SDK_ROOT_DIR
: The root directory of the project, i.e., the folder which contains at least the frameworks and the CMake files of the project. E.g., sdk/
.MAXON_SDK_CURRENT_MODULE_DIR
: The module directory from which this alias is invoked. When it is for example invoked from the projectdefinition.txt
in sdk/plugins/foo
, the path will be sdk/plugins/foo/
. It does not matter if this module is inside or outside of MAXON_SDK_ROOT_DIR
, i.e., this also works with custom module paths.MAXON_SDK_EXTERNAL_LIBS_DIR
: Points to a centralized folder where external libs are stored. By default this points to sdk/libs/
. This alias will be unavailable if the folder does not exist. And project generation will fail if it is used in a project where it is unset.MAXON_SDK_BUILD_DIR
: The root of the current build directory in a project, i.e., the build system which is currently being generated. E.g., sdk/_build_v143/
when generating a Visual Studio 2022 MSVC project. Most users will never need this alias.MAXON_SDK_CURRENT_MODULE_DIR
is resolved upon configuration. This means that when one configures a project and then generates it, moves a module using MAXON_SDK_CURRENT_MODULE_DIR
, and just regenerates the build system, the result will not work. One must always invoke Configure and Generate in the CMake GUI in such case.To learn how to define custom path aliases, see Custom Paths.
By default, the Cinema 4D SDK will include all modules from the MAXON_SDK_MODULES_DIR
path, which is set by default to root/plugins
. I.e., other than the Project Tool, the CMake SDK will automatically discover and include all modules in a project.
This is the recommended way to include modules. However, it is possible to define custom paths for modules in a text file which is then read by the build system generator to include modules which might not all be located within one root folder. This is done by setting the MAXON_SDK_CUSTOM_PATHS_FILE
in the configuration step of CMake. The SDK comes by default with a predefined custom_paths.txt
file which can be used as a template or place for such custom path instructions. When such file is provided, and does not provide any module paths, the build system generator will automatically fall back to the MAXON_SDK_MODULES_DIR
path. This is because such custom path files can also be used to define path aliases, which can then be used in projectdefinition.txt
files.
A custom paths file has a simple syntax, it can define module paths using the MODULE
command, path aliases using the ALIAS
command, and a new root directory using the ROOT
command.
Describes commonly used arguments in projectdefinition.txt
files. Most users will only need these arguments.
Argument | Description |
---|---|
Platform | Defines the platforms for which this module shall be built, can take the values Win64 , OSX , and Linux . Platform=Win64;OSX;Linux |
Type | Defines the type of the module, can take the values DLL (usually used for plugins/modules) or Lib (usually used for framework). Type=DLL |
APIS | Defines the frameworks that are accessible for the source code of this module. APIS=cinema.framework;core.framework |
C4D | Must be set when the cinema and the core framework are both being included. Effectively sets the preprocessor define USE_API_MAXON . Can be either true or false . C4D=true
|
stylecheck.level | Defines the rigidity of style checks in the file, where 0 are no checks and 3 is the highest rigidity. Also re-enables style checks when they have been disabled before. stylecheck.level=3 |
ModuleId | Defines the ID with which a module attempts to register with Cinema 4D. Modules which fail to register will not be loaded and its plugins will therefore neither register nor load. ModuleId=com.mycompany.modules.foo
|
This file could be the projectdefinition.txt
of a 'foo' module in a project. The file would be located in foo.plugin/project
. The plugin would be compiled into a binary named after the module, i.e., foo.plugin.xdl64
for a Visual Studio MSVC project.
Describes settings with which files and folders outside of the module source
folder can be included and how files and folders inside source
can be excluded. CMake will automatically include all the files in the source
folder of the module.
Include.{OS}
can no longer be used to include header files. See also Migrating Configuration Files for details.Argument | Description |
---|---|
Include.{platform} | Manually includes files or folders from outside of the source directory to the Visual Studio, Xcode, or GCC project. Possible values for the {platform} are Win , OSX , and Linux . Include=c:/code/libs/someclass.cpp; c:/code/libs/otherClass.cpp; |
Exclude.{platform} | Manually excludes files or folders from the Visual Studio, Xcode, or GCC project. Possible values for the {platform} are Win , OSX , and Linux . Exclude.OSX=source/libs/win_impl.cpp; source/libs/win_impl.h; |
ExcludeFromBuild.{platform} | Manually excludes files or folders from the build process but not from the Visual Studio, or Xcode project. Does not support Linux . Possible values for the {platform} are Win and OSX . ExcludeFromBuild=c:/code/source/lnx_impl.h; c:/code/source/osx_impl.h; |
Describes settings which only apply to Visual Studio build systems.
Argument | Description |
---|---|
AdditionalLibraryDirectories.{target} | Defines search paths for additional library binaries. Possible targets are the empty string, Debug , and Release . AdditionalLibraryDirectories=c:/code/libs/bin |
AdditionalIncludeDirectories | Defines search paths for additional library header files. AdditionalIncludeDirectories=c:/code/libs/include |
AdditionalDependencies.{target} | Defines libraries found in the search paths to link against. Possible targets are the empty string, Debug , and Release . AdditionalDependencies=foo.lib; bar.lib |
AdditionalCompileOptions.Win64 | Defines additional compiler options. AdditionalCompileOptions.Win64=/w |
AdditionalLinkOptions | Defines additional linker options, internally exclusively used to ignore specific warnings. AdditionalLinkOptions=/ignore:4006,4221 |
AdditionalPreprocessorDefinitions.Win | Defines additional preprocessor definitions only exposed to Windows builds. AdditionalPreprocessorDefinitions.Win=MY_DEFINE;ANOTHER_DEFINE |
DisableSpecificWarnings.Win64 | Disables specific compiler warnings (which also means they cannot be elevated to errors anymore). DisableSpecificWarnings.Win64=4018;4068;4242 |
SUBSYSTEMCONSOLE | Sets the Windows subsystem to CONSOLE for developing a console/terminal app. Mostly useless in the context of the SDK. SUBSYSTEMCONSOLE=true |
IGNORESPECIFICDEFAULTLIBRARIES.{TARGET} | Sets the Visual Studio linker setting of the same name to ignore default libraries. IgnoreSpecificDefaultLibraries=LIBCMT |
CLANG_WARN_DOCUMENTATION_COMMENTS | Enables or disables warnings for missing or incorrect documentation comments in the source code. Only works when the compiler is Clang. CLANG_WARN_DOCUMENTATION_COMMENTS=NO
|
PreBuildEvent | Defines a pre-build event, usually a script that should be run. PreBuildEvent = call python c:/code/scripts/prebuild_event.py |
AdditionalSolutionFiles
has been deprecated since there are no solution projectdefinition.txt
files anymore.Describes settings which only apply to Xcode build systems.
Argument | Description |
---|---|
FRAMEWORKS.OSX | Adds the header files and library link targets of a macOS framework to the project. FRAMEWORKS.OSX=/System/Library/Frameworks/Metal.framework; |
HEADER_SEARCH_PATHS | Defines search paths for additional library header files to be included as #include <...> . HEADER_SEARCH_PATHS=/System/includes |
USER_HEADER_SEARCH_PATHS | Defines search paths for additional library header files to be included as #include "...". USER_HEADER_SEARCH_PATHS=c:/code/libs/include |
OTHER_LDFLAGS.{target} | Defines libraries to link against. This can also be used to set other linker options, but defining library targets is the main purpose. Other than under Windows and Linux, linking against libraries is not split into two options of defining search paths and then the link files. Possible targets are the empty string, DEBUG and RELEASE . OTHER_LDFLAGS = -lbz2;-liconv;-lz; |
AdditionalPreprocessorDefinitions.OSX | Defines additional preprocessor definitions only exposed to macOS builds. AdditionalPreprocessorDefinitions.OSX=MY_DEFINE;ANOTHER_DEFINE |
DisableSpecificWarnings.OSX | Disables specific compiler warnings (which also means they cannot be elevated to errors anymore). DisableSpecificWarnings.OSX=4018;4068;4242 |
SHELLSCRIPT.OSX | Defines the content (not the path) of a shell script executed before the build event. Conventionally used to invoke a Python script. SHELLSCRIPT.OSX = python3 c:/code/scripts/prebuilt_action.py |
CLANG_WARN_DOCUMENTATION_COMMENTS | Enables or disables warnings for missing or incorrect documentation comments in the source code. CLANG_WARN_DOCUMENTATION_COMMENTS=NO
|
Describes settings which only apply to Linux build systems.
Argument | Description |
---|---|
LibrarySearchPath | Defines search paths for additional library binaries. LibrarySearchPath=/usr/lib/x86_64-linux-gnu; /usr/lib/tinyxml |
SystemIncludePaths | Defines search paths for additional library header files. SystemIncludePaths=/usr/include/gtk-3.0/; /usr/include/tinyxml/ |
Libraries | Defines dynamic libraries found in the search paths to link against. Libraries=gtk-3; |
StaticLibraries.Linux | Defines static libraries found in the search paths to link against. StaticLibraries.Linux=tinyxml |
AdditionalPreprocessorDefinitions.Linux | Defines additional preprocessor definitions only exposed to Linux builds. AdditionalPreprocessorDefinitions.Linux=MY_DEFINE;ANOTHER_DEFINE |
Describes settings which apply to all build systems but are of more expert or niche nature.
Argument | Description |
---|---|
AdditionalPreprocessorDefinitions | Defines additional preprocessor definitions, which are exposed to all build systems. AdditionalPreprocessorDefinitions=MY_DEFINE;ANOTHER_DEFINE |
ExceptionHandling | Enables or disables the compiler specific exception handling. ExceptionHandling=true
|
maxon | Marks a module/framework as provided by Maxon Computer when set to true. maxon=true
|
OmitApiDefine | Enables or disables (when set to true) defining the MAXON_API preprocessor define for frameworks. Technically related to the C4D argument (which sets USE_API_MAXON ) but of very rare use. OmitApiDefine=true |
publicframework | Marks a framework as public and therefore shipped with the SDK when set to true. Conventionally only defined in public frameworks and completely omitted (and therefore implicitly false) on frameworks which are private. publicframework=true |
RuntimeTypeInfo | Enables or disables the compiler specific Run-Time Type Information (RTTI) support. RuntimeTypeInfo=true |
Describes settings which control style checks enforced at compilation time.
The settings described here are irrelevant for the build system - CMake will just ignore them - and instead read by the Source Processor and enforced when a module is being built. It is recommend to follow Maxon code style in projects and therefore leave these settings at their default and to use stylecheck.level=3
.
Certain checks can be disabled in code using these macros:
Argument | Description |
---|---|
stylecheck.level | Defines the rigidity of style checks in the file, where 0 are no checks and 3 is the highest rigidity. Also re-enables style checks when they have been disabled before. stylecheck.level = 3 |
stylecheck | Enables or disables style checks. stylecheck = false |
stylecheck.aswarnings | Turns style errors into warnings and by that allow compilation to continue. stylecheck.aswarnings = true |
stylecheck.domains | Checks identifiers in registration calls such as MAXON_COMPONENT_CLASS_REGISTER for having one of the provided prefixes. Prefixes must be separated with a semicolon. For the given example, the ID com.mycompany.baz.stuff would fail, but com.mycompany.bar.stuff would not. stylecheck.domains = com.mycompany.foo; com.mycompany.bar |
stylecheck.register-qualifiers | Registers custom qualifiers used in function declarations with the source processor, such as FOO and BAR in FOO bool Run() BAR; . Note that the symbols must still be declared and defined in normal C++ code, this feature only allows to the source processor to correctly parse such code. See Support for Custom Qualifiers for details. stylecheck.register-qualifiers = FOO; BAR |
These settings will be enabled when the style check level is set to one.
Argument | Description |
---|---|
stylecheck.whitespace | Checks for missing whitespaces in expressions, for example the missing whitespace after the if in if(condition) . stylecheck.whitespace = true |
stylecheck.indentation | Checks for correct indentation, as for example top-level members of a namespace scope being indented. stylecheck.indentation = true |
stylecheck.todo | Checks the formatting of TODO comments. A TODO must follow the form // TODO: (NAME) MESSAGE where NAME is a singular word, e.g., // TODO: (Alice) I like muffins, we need more muffins. stylecheck.todo = false |
stylecheck.case-break | Checks switch cases for having a break statement at their end (or MAXON_SWITCH_FALLTHROUGH ). stylecheck.case-break = true |
stylecheck.virtual | Checks framework modules for containing illegal virtual function declarations in frameworks. This option is not absolute, frameworks which start with private_ are not tested, and so are the core , kernel , cinema , cinema_legacy , and cinema_maxon framework. stylecheck.virtual = true |
stylecheck.static-within-type | Checks for declarations such as const static Int x = 0; which should be written as static const Int x = 0; . stylecheck.static-within-type = true |
stylecheck.supercall | Warns when the implementation of IsEqual , Compare , or GetHashCodeImpl of an ObjectInterface component does not use super when deferring to the base implementation. E.g., will trigger on MAXON_METHOD Bool IsEqual(const ObjectInterface* other) const { return IsEqual(other); } . stylecheck.supercall = true |
These settings will be enabled when the style check level is set to two.
Argument | Description |
---|---|
stylecheck.no-whitespace | Checks for forbidden whitespaces, as for example the extra whitespace after and before the parenthesis in if ( condition ) . stylecheck.no-whitespace = true |
stylecheck.consistent-blocks | Checks statements which can be explicitly scoped such as if and switch for being consistently scoped or not. Having for example an if with no explicit scope, but its else having one, would trigger this check; e.g.: if (foo) return 1; else { return 2; } stylecheck.consistent-blocks = true |
stylecheck.newline-for-substatement | Checks the sub-statements of if or loop expressions for being on a new line. E.g., if (foo) i++; would trigger this, as there is no line break between the condition and the statement. stylecheck.newline-for-substatement = true |
stylecheck.explicit | Checks that constructors which can be used as conversion constructors are marked by either explicit or MAXON_IMPLICIT . stylecheck.explicit = true |
These settings will be enabled when the style check level is set to three.
Argument | Description |
---|---|
stylecheck.typedef-struct | Checks for C-style struct declarations being used such as typedef struct { ... } S; . Using such declarations is not allowed. stylecheck.typedef-struct = true |
stylecheck.enum-class | Checks that scoped enums are used; use enum class instead of just enum . stylecheck.enum-class = true |
stylecheck.enum-registration | Checks that enums end with one of the enum macros (MAXON_ENUM_LIST etc.). stylecheck.enum-registration = true |
stylecheck.class-for-templateparam | Checks that a template type parameters are specified with typename instead of class . E.g., template <typename T> instead of template <class T> . stylecheck.class-for-templateparam = true |
stylecheck.void-paramlist | Checks for C-style function declarations with empty parameter list such as void Func(void); . stylecheck.void-paramlist = true |
stylecheck.max-linecount | Sets the maximum line count a function may have. The default value is 600 . stylecheck.max-linecount = 600
|
stylecheck.naming | Checks the name of entities, enforces camel-case for functions and types, and global variables starting with g_ . E.g., a function must be named void FooBar(); and a global variable must be named Int32 g_foo_bar; . See also Style Guide: Naming. stylecheck.naming = true |
The pure CMake workflow allows you to use CMakeLists.txt
files instead of projectdefinition.txt
to configure modules. It is however not sensibly possibly to write such CMakeLists.txt
per hand, instead one must copy files from a build system. The general workflow is:
projectdefinition.txt
files.CMakeLists.txt
files generated for the project into the project.CMakeLists.txt
files to take advantage of a pure CMake setup.projectdefinition.txt
files, there is no guarantee that variable and function names used in CMakeLists.txt
files will stay the same across multiple versions of Cinema 4D. We will not announce changes in our internal CMake setup. Using a pure CMake setup is therefore not recommended for most plugin developers, as such files must be maintained to stay compatible with the Cinema 4D SDK.projectdefinition.txt
configurations into CMakeLists.txt
files in the build system. Which can then be copied back into the project folder of a module to be modified and used in place of the projectdefinition.txt
file. Here we would have to copy the CMakeLists.txt
file from my_project\_build_v143\plugins\my_module\project
to my_project\plugins\my_module\project
. CMakeLists.txt
files although sourced from a specific build system, will be build system agnostic, just as the projectdefinition.txt
files they have been derived from.