工程工具

内容表

关于

The 工程工具 creates project files for Microsoft Visual Studio or Apple Xcode. The tool automatically detects new files and resources and correctly handles - depending on the platform - all the required dependencies. It creates project files for solutions, frameworks and plugins.

The Project Tool can be obtained from developers.maxon.net .

注意
The Project Tool can only be used to create project files for the corresponding Cinema 4D 版本。
For general information on how to create new plugins, frameworks and solutions see SDK 概述 .
警告
Changing the generated project files (editing compiler or linker settings etc.) may result in compile errors or incompatible plugins.

运行工程工具

The Project Tool application is configured using a command line argument:

  • g_updateproject : Defines the folder the tool should work on. Currently the tool only accepts absolute paths. This is typically the location of the SDK including frameworks and plugins. See SDK 概述 .
// This example shows how to run the Project Tool using command line arguments.

// Windows kernel_app_64bit.exe g_updateproject=C:\development\sdk

// MacOS kernel_app.app/Contents/MacOS/kernel_app g_updateproject=/Volumes/development/sdk

注意
The output window of the Project Tool can be hidden using the command line argument g_disableConsoleOutput=true .
警告
On MacOS Catalina, the Project Tool needs a few further steps - they might require an elevated prompt - to run due to the security measures introduced by Apple Notarization.
  1. Remove the quaratine xattr $ xattr -d "com.apple.quarantine" <ProjectTool ZIP file>.zip
  2. Set the executable permission $ chmod 744 <ProjectTool Path>/kernel_app.app/Contents/MacOS/kernel_app

projectdefinition.txt

A projectdefinition.txt file defines the basic settings of a solution, framework or plugin. The Project Tool creates project files based on theses settings.

General formatting rules for projectdefinition.txt files are:

Additional, the file also defines how the 源处理器 analyses the code. See 样式检查 .

一般设置

These settings are relevant for all framework and plugin projects:

注意
The ID of a framework must include the ".framework" suffix; the ID of a module must NOT include ".module".

A typical example looks like this:

// Configuration of a custom plugin in the projectdefinition.txt file

// support Windows and macOS Platform=Win64; OSX

// this is a plugin Type=DLL

// this plugin depends on these frameworks: APIS=\ cinema.framework; \ misc.framework; \ image.framework; \ core.framework

// defines the level of rigour of the source processor's style check stylecheck.level=3

// plugin/module ID ModuleId=com.examplecompany.myplugin

A projectdefinition.txt file that support code in a custom style can look like this:

// plugin for win and macOS Platform=Win64; OSX Type=DLL

// uses the "classic" API and the new core APIS=cinema.framework;core.framework

// turns on additional legacy support C4D = true

// to turn off stylechecks on can set the level to 0 or just set "stylecheck" to false stylecheck.level=0 // stylecheck=false

// is the level is not 0, errors can be turned into warnings //stylecheck.aswarnings=true

// custom module id ModuleId=net.maxonexample.someplugin

Further generic project settings are:

样式检查

The "stylecheck" setting defines how rigid the source processor checks the source code (see 源处理器 ):

Checks enabled in level 1 are:

Additional checks enabled in level 2 are:

Additional checks enabled in level 3 are:

注意
By default all checks are enabled. The style check level is used to disable certain checks.
The settings are processed from top to bottom. A later setting can overwrite a previous one.
// set the style check level to 2 // this will disable all settings enabled with level 3 stylecheck.level=2 // set line length settings manually stylecheck.max-linecount=300

Certain checks can be disabled in code using these macros:

包括

The Project Tool automatically includes source code files found in the project folder.

警告
The 源处理器 will only handle source code files stored in the "source" folder. It is advised to store all source code files in a "source" folder.
Exclude and ExcludeFromBuild do not use file paths. They define filters that are used to remove files that contain the given filter in the file path.
// the following files should be added to the Visual Studio project Include.Win=../../files/someclass.h;\ ../../files/someclass.cpp;

// the following files should be added to the Xcode project Include.OSX=../../files/someclass.h;\ ../../files/someclass.cpp;

// exclude OS specific code Exclude.Win=/source/mac/ Exclude.OSX=/source/win/

It also possible to exclude files from being checked by the Source Processor using the a specific syntax.

// This example excludes all files which have /fist_6_4/src/ in their path. DontUncrustify= "/fist_6_4/src/" ;

特定于 Visual Studio

Specific settings for Visual Studio projects. The settings can be specified for different build targets e.g. "Win64", "Debug" etc.

// additional lib folder for all targets not defined otherwise AdditionalLibraryDirectories=... // explicit lib foder for all debug versions AdditionalLibraryDirectories.Debug=... // explicit lib folder for 64bit release version AdditionalLibraryDirectories.Win64.Release=... AdditionalDependencies=... AdditionalDependencies.Debug=... AdditionalDependencies.Win64.Release=... AdditionalDependencies.Win64.Debug=... AdditionalIncludeDirectories=... AdditionalIncludeDirectories.Debug=... AdditionalIncludeDirectories.Win64=...

// the typical way to include a lib AdditionalLibraryDirectories.Win64.Debug=../../mylib/bin/ AdditionalDependencies=mylib_debug_64.lib AdditionalIncludeDirectories=../../mylib/include DisableSpecificWarnings=... DisableSpecificWarnings.Win64=...

注意
If you want to include inherit include paths you have to add "AdditionalIncludeDirectories".
AdditionalIncludeDirectories=../../mylib/include;\ %(AdditionalIncludeDirectories)

特定于 Xcode

Specific settings for Xcode projects. The settings can be specified for different targets e.g. "64" and "Release".

// additional paths for all targets not defined otherwise OTHER_LDFLAGS=... // explicit paths for all debug versions OTHER_LDFLAGS.Debug=... // explicit paths for 64bit release version OTHER_LDFLAGS.64.Release=... FRAMEWORK_SEARCH_PATHS=... HEADER_SEARCH_PATHS=... USER_HEADER_SEARCH_PATHS=... Frameworks.OSX=System/Library/Frameworks/CoreFoundation.framework;

插件

A simple plugin's projectdefinition.txt 可以看起来像这样:

// Configuration of a custom plugin in the projectdefinition.txt file

// support Windows and macOS Platform=Win64; OSX

// this is a plugin Type=DLL

// this plugin depends on these frameworks: APIS=\ cinema.framework; \ misc.framework; \ image.framework; \ core.framework

// defines the level of rigour of the source processor's style check stylecheck.level=3

// plugin/module ID ModuleId=com.examplecompany.myplugin

框架

框架的 projectdefinition.txt 可以看起来像这样:

// Configuration of a custom framework in the projectdefinition.txt file

// support Windows and macOS Platform=Win64; OSX

// this is a framework Type=Lib

// this framework depends on the listed frameworks: APIS=core.framework

// framework ID ModuleId=com.examplecompany.myplugin.framework

解决方案

A solution's projectdefinition.txt 可以看起来像这样:

// Configuration of a custom solution in the projectdefinition.txt file

// support Windows and macOS Platform=Win64; OSX

// this is a solution Type=Solution

// included plugin projects Solution=\ plugins/pluginA;\ plugins/pluginB

// include natvis files in Visual Studio solution file AdditionalSolutionFiles=\ ..\..\frameworks\core.framework\project\typeviewer\msvc\maxon.natvis;\ ..\..\frameworks\cinema.framework\project\typeviewer\msvc\c4dapi.natvis

延伸阅读

C4D
C4D
定义: lib_net.h:673
ZIP
ZIP
定义: network_smtpmail.h:23
OSX
OSX
OS X.
定义: ge_prepass.h:3324

Copyright  © 2014-2025 乐数软件    

工业和信息化部: 粤ICP备14079481号-1