C and C++ Code Deployment - Builtin Deployments

This section describes the built-in code deployment configurations available for generated C and C++ code in CATIA Software Producer. It helps you choose the deployment that best matches your expected file layout, naming conventions, and build-system integration.

If no deployment is selected explicitly, the generator uses Flat (also exposed as Default) for backward compatibility.

This page discusses:

Overview

The built-in <<CFamilyCodeDeployment>> configurations cover the following common situations:

  • Flat for simple or legacy projects with no folder hierarchy
  • FlatQualified for flat layouts that still need collision-safe file names
  • Hierarchical for projects that expect include/, internal/, and src/ separation following the package hierarchy
  • CMake (planned, not yet implemented) for projects that expect the hierarchical layout with a generated CMakeLists.txt
  • Makefile (planned, not yet implemented) for projects using the hierarchical layout with a generated Makefile
Note:

Note: The CMake and Makefile built-in deployments are described below for reference but are not yet available in the current release. Until they are delivered, use the Hierarchical deployment to obtain the same include/, internal/, and src/ layout, and add your own build file via a custom <<Resource>> if needed.

Flat Deployment

Name: Flat
Alias: Default
Description: Simple file names with no folder hierarchy. All files are placed directly in the library root directory.

Use Case: Small projects or legacy systems where flat file organization is preferred.

Configuration

Property Value
publicArea (empty)
internalArea (empty)
sourceArea (empty)

File Extensions

Property Value
cppHeaderExt .hpp
cppSourceExt .cpp
cHeaderExt .h
cSourceExt .c

File Path Patterns

Property Value
publicHeaderPath <file.name>
internalHeaderPath <file.name>
sourcePath <file.name>

File Name Patterns

Property Value
classFileName <element.name><file.ext>
stateMachineFileName <parent.name><element.name>StateMachine<file.ext>
activityFileName <parent.name><element.name>Activity<file.ext>
opaqueBehaviorFileName <parent.name><element.name>Behavior<file.ext>
constraintFileName <parent.name><element.name>Constraint<file.ext>
publicTypesFileName <package.name>Types<file.ext>
internalTypesFileName <package.name>InternalTypes<file.ext>

C Element Naming Configuration

Property Value
cPublicElementNamingPattern <element.relname>
cInternalElementNamingPattern <element.relname>

<element.relname> equals <element.name> for classes directly inside a package but produces a disambiguated name such as Button_Toggle for behaviors owned by a class.

File Header Configuration

Property Value
fileHeaderTemplate (see Common File Header Template)
bannerLength 80
doxygenCommentStyle javadoc

Additional Resources

None attached.

Example Output

For <<ModelLibrary>> ALibrary containing class MyClass:

ALibrary/
├── MyClass.hpp
├── MyClass.cpp
├── ALibraryTypes.hpp             (public types)
└── ALibraryInternalTypes.hpp     (internal types)

Warning

⚠️ Naming Conflict Risk: If two classes in different packages have the same simple name (for example, Sensors::Button and Controls::Button), the generation ends prematurely with an error listing conflicting files. Use FlatQualified, CMake, or Makefile deployments for projects with potential naming collisions.

FlatQualified Deployment

Name: FlatQualified
Description: Qualified file names with no folder hierarchy. Files use underscore-separated qualified names to avoid conflicts.

Use Case: Projects requiring flat structure but with multiple packages that may have naming conflicts.

Configuration

Property Value
publicArea (empty)
internalArea (empty)
sourceArea (empty)

File Extensions

Property Value
cppHeaderExt .hpp
cppSourceExt .cpp
cHeaderExt .h
cSourceExt .c

File Path Patterns

Property Value
publicHeaderPath <file.name>
internalHeaderPath <file.name>
sourcePath <file.name>

File Name Patterns

Property Value Notes
classFileName <element.qname><file.ext> Public headers use full qualification; sources use lib-relative
stateMachineFileName <element.qname>StateMachine<file.ext>
activityFileName <element.qname>Activity<file.ext>
opaqueBehaviorFileName <element.qname>Behavior<file.ext>
constraintFileName <element.qname>Constraint<file.ext>
publicTypesFileName <element.qname>Types<file.ext>
internalTypesFileName <lib.prefix><element.lib.qname>InternalTypes<file.ext>

File Header Configuration

Property Value
fileHeaderTemplate (see Common File Header Template)
bannerLength 80
doxygenCommentStyle javadoc

Additional Resources

None attached.

Example Output

For <<ModelLibrary>> Root::Sub::ALibrary containing: - Public class Continue::Nesting::MyClass - Private class Internal::Helper

ALibrary/
├── Root_Sub_ALibrary_Continue_Nesting_MyClass.hpp      (public header)
├── ALibrary_Continue_Nesting_MyClass.cpp                (source)
├── ALibrary_Continue_Nesting_Helper.hpp                 (internal header)
├── ALibrary_Continue_Nesting_Helper.cpp                 (source)
├── Root_Sub_ALibrary_Continue_NestingTypes.hpp          (public types)
└── ALibrary_Continue_NestingInternalTypes.hpp           (internal types)

Hierarchical Deployment

Name: Hierarchical
Description: Organized file structure with public, internal, and source separation following the package hierarchy. Uses the default property values defined by the <<CFamilyCodeDeployment>> profile.

Use Case: Projects that need a clean separation between public headers, internal headers, and source files, organized along the UML package hierarchy, without any generated build file.

Configuration

Property Value
publicArea include
internalArea internal
sourceArea src

File Extensions

Property Value
cppHeaderExt .hpp
cppSourceExt .cpp
cHeaderExt .h
cSourceExt .c

File Path Patterns

Property Value
publicHeaderPath <area.public>/<lib.dir><package.lib.path>/<file.name>
internalHeaderPath <area.internal>/<lib.dir><package.lib.path>/<file.name>
sourcePath <area.source>/<lib.dir><package.lib.path>/<file.name>

File Name Patterns

Property Value
classFileName <element.name><file.ext>
stateMachineFileName <parent.name><element.name>StateMachine<file.ext>
activityFileName <parent.name><element.name>Activity<file.ext>
opaqueBehaviorFileName <parent.name><element.name>Behavior<file.ext>
constraintFileName <parent.name><element.name>Constraint<file.ext>
publicTypesFileName <package.name>Types<file.ext>
internalTypesFileName <package.name>InternalTypes<file.ext>

File Header Configuration

Property Value
fileHeaderTemplate (see Common File Header Template)
bannerLength 80
doxygenCommentStyle javadoc

Additional Resources

None attached. If a build file is required, attach a custom <<Resource>> via the inherited additionalResources property.

Example Output

For <<ModelLibrary>> Root::Sub::ALibrary containing: - Public class Continue::Nesting::MyClass - Internal class Internal::Helper - Public enum ButtonState in Continue::Nesting

Root/Sub/ALibrary/
├── include/
│   └── Root/
│       └── Sub/
│           └── ALibrary/
│               └── Continue/
│                   └── Nesting/
│                       ├── MyClass.hpp
│                       └── NestingTypes.hpp       (public types)
├── internal/
│   └── ALibrary/
│       └── Internal/
│           ├── Helper.hpp
│           └── InternalInternalTypes.hpp  (internal types)
└── src/
    └── ALibrary/
        ├── Continue/
        │   └── Nesting/
        │       └── MyClass.cpp
        └── Internal/
            └── Helper.cpp

CMake Deployment

Note:

⚠️ Not yet implemented: This built-in deployment is planned but is not available in the current release. The configuration below describes the expected behavior. In the meantime, use the Hierarchical Deployment and attach a custom CMakeLists.txt <<Resource>> to obtain an equivalent result.

Name: CMake
Description: Organized file structure with public/internal/source separation and CMakeLists.txt generation.

Use Case: Projects using CMake build a system with proper encapsulation of public and internal interfaces.

Configuration

Property Value
publicArea include
internalArea internal
sourceArea src

File Extensions

Property Value
cppHeaderExt .hpp
cppSourceExt .cpp
cHeaderExt .h
cSourceExt .c

File Path Patterns

Property Value
publicHeaderPath <area.public>/<lib.dir><package.lib.path>/<file.name>
internalHeaderPath <area.internal>/<lib.dir><package.lib.path>/<file.name>
sourcePath <area.source>/<lib.dir><package.lib.path>/<file.name>

File Name Patterns

Property Value
classFileName <element.name><file.ext>
stateMachineFileName <parent.name><element.name>StateMachine<file.ext>
activityFileName <parent.name><element.name>Activity<file.ext>
opaqueBehaviorFileName <parent.name><element.name>Behavior<file.ext>
constraintFileName <parent.name><element.name>Constraint<file.ext>
publicTypesFileName <package.name>Types<file.ext>
internalTypesFileName <package.name>InternalTypes<file.ext>

File Header Configuration

Property Value
fileHeaderTemplate (see Common File Header Template)
bannerLength 80
doxygenCommentStyle javadoc

Additional Resources

Attached Resource: CMakeLists.txt with <<Resource>> (filePath = "CMakeLists.txt", scope = Library)

Content via <<TextTemplate>>:

# Generated by CATIA Magic Software Producer
# Library: ${lib_name}

add_library(${lib_name}
##ALL_SOURCES {
    ${area_source}/${rel_path}
##}
)

target_include_directories(${lib_name}
    PUBLIC ${area_public}
    PRIVATE ${area_internal}
)

Example Output

For <<ModelLibrary>> Root::Sub::ALibrary containing: - Public class Continue::Nesting::MyClass - Internal class Internal::Helper - Public enum ButtonState in Continue::Nesting - Package-visibility datatype InternalCoords in Internal

Root/Sub/ALibrary/
├── include/
│   └── Root/
│       └── Sub/
│           └── ALibrary/
│               └── Continue/
│                   └── Nesting/
│                       ├── MyClass.hpp
│                       └── NestingTypes.hpp       (public types)
├── internal/
│   ├── ALibrary/
│   │   ├── Internal/
│   │   │   ├── Helper.hpp
│   │   │   └── InternalInternalTypes.hpp  (internal types)
│   │   └── Continue/
│   │       └── Nesting/
│   │           └── NestingInternalTypes.hpp   (internal types, if any)
├── src/
│   └── ALibrary/
│       ├── Continue/
│       │   └── Nesting/
│       │       └── MyClass.cpp
│       └── Internal/
│           └── Helper.cpp
└── CMakeLists.txt

Generated CMakeLists.txt:

# Generated by CATIA Magic Software Producer
# Library: ALibrary

add_library(ALibrary
    src/ALibrary/Continue/Nesting/MyClass.cpp
    src/ALibrary/Internal/Helper.cpp
)

target_include_directories(ALibrary
    PUBLIC include
    PRIVATE internal
)

Makefile Deployment

Note:

⚠️ Not yet implemented: This built-in deployment is planned but is not available in the current release. The configuration below describes the expected behavior. In the meantime, use the Hierarchical Deployment and attach a custom Makefile <<Resource>> to obtain an equivalent result.

Name: Makefile
Description: Organized file structure with public/internal/source separation and Makefile generation.

Use Case: Projects using Make build system with proper encapsulation of public and internal interfaces.

Configuration

Property Value
publicArea include
internalArea internal
sourceArea src

File Extensions

Property Value
cppHeaderExt .hpp
cppSourceExt .cpp
cHeaderExt .h
cSourceExt .c

File Path Patterns

Property Value
publicHeaderPath <area.public>/<lib.dir><package.lib.path>/<file.name>
internalHeaderPath <area.internal>/<lib.dir><package.lib.path>/<file.name>
sourcePath <area.source>/<lib.dir><package.lib.path>/<file.name>

File Name Patterns

Property Value
classFileName <element.name><file.ext>
stateMachineFileName <parent.name><element.name>StateMachine<file.ext>
activityFileName <parent.name><element.name>Activity<file.ext>
opaqueBehaviorFileName <parent.name><element.name>Behavior<file.ext>
constraintFileName <parent.name><element.name>Constraint<file.ext>
publicTypesFileName <package.name>Types<file.ext>
internalTypesFileName <package.name>InternalTypes<file.ext>

File Header Configuration

Property Value
fileHeaderTemplate (see Common File Header Template)
bannerLength 80
doxygenCommentStyle javadoc

Additional Resources

Attached Resource: Makefile with <<Resource>> (filePath = "Makefile", scope = Library)

Content via <<TextTemplate>>:

# Generated by CATIA Magic Software Producer
# Library: ${lib_name}

TARGET = lib${lib_name}.a
BUILD_DIR = build
OBJ_DIR = $$(BUILD_DIR)/obj

# Source files
SRCS = \
##ALL_SOURCES {
    ${area_source}/${rel_path} \
##}

# Include directories
INCLUDES = -I${area_public} -I${area_internal}

# Compiler settings
CXX = g++
CXXFLAGS = -std=c++17 -Wall -Wextra $$(INCLUDES)
AR = ar
ARFLAGS = rcs

# Object files
OBJS = $$(SRCS:%.cpp=$$(OBJ_DIR)/%.o)

# Default target
all: $$(BUILD_DIR)/$$(TARGET)

# Create library
$$(BUILD_DIR)/$$(TARGET): $$(OBJS)
    @mkdir -p $$(@D)
    $$(AR) $$(ARFLAGS) $$@ $$^

# Compile source files
$$(OBJ_DIR)/%.o: %.cpp
    @mkdir -p $$(@D)
    $$(CXX) $$(CXXFLAGS) -c $$< -o $$@

# Clean
clean:
    rm -rf $$(BUILD_DIR)

.PHONY: all clean
Note:

Note: Makefile variables use $$ escape syntax in the template body (for example $$(BUILD_DIR)) to produce literal $(BUILD_DIR) in the generated output. The escape-character rules are described in the code deployment profile definition reference.

Example Output

For <<ModelLibrary>> Root::Sub::ALibrary containing: - Public class Continue::Nesting::MyClass - Internal class Internal::Helper

Root/Sub/ALibrary/
├── include/
│   └── Root/
│       └── Sub/
│           └── ALibrary/
│               └── Continue/
│                   └── Nesting/
│                       ├── MyClass.hpp
│                       └── NestingTypes.hpp
├── internal/
│   └── ALibrary/
│       └── Internal/
│           └── Helper.hpp
├── src/
│   └── ALibrary/
│       ├── Continue/
│       │   └── Nesting/
│       │       └── MyClass.cpp
│       └── Internal/
│           └── Helper.cpp
└── Makefile

Generated Makefile:

# Generated by CATIA Magic Software Producer
# Library: ALibrary

TARGET = libALibrary.a
BUILD_DIR = build
OBJ_DIR = $(BUILD_DIR)/obj

# Source files
SRCS = \
    src/ALibrary/Continue/Nesting/MyClass.cpp \
    src/ALibrary/Internal/Helper.cpp \

# Include directories
INCLUDES = -Iinclude -Iinternal

# ... (rest of Makefile)

Common File Header Template

All built-in deployments use the same default file header <<TextTemplate>>:

@@/* Generated on ${generation_date} */

##COMMENT {
${comment_banner}
@file ${file_name}

Automatically generated by Software Producer Engineer
UML Classes Code Generator @version v${generator_version}
##ORIGINS {
@generated_from ${element_id}
##}
${comment_banner}
##}

Generated Output (with doxygenCommentStyle: javadoc):

/* Generated on 2026-02-11 */

/**
 * ********************************************************************************
 * @file MyClass.hpp
 *
 * Automatically generated by Software Producer Engineer
 * UML Classes Code Generator @version v2.5.0
 * @generated_from 12345678-abcd-ef01-2345-6789abcdef01
 * ********************************************************************************
 */

Note: The @@ prefix on the first line marks it as excluded from file comparison, preventing regeneration when only the date changes.

Deployment Comparison

Feature Flat FlatQualified Hierarchical CMake (planned) Makefile (planned)
Available ✅ Yes ✅ Yes ✅ Yes ❌ Not yet ❌ Not yet
Directory Structure None None include/internal/src include/internal/src include/internal/src
File Names Simple (<element.name>), C symbols use <element.relname> Qualified (<element.qname>) Simple (<element.name>) Simple (<element.name>) Simple (<element.name>)
Naming Conflict Safe ❌ No ✅ Yes ✅ Yes (via paths) ✅ Yes (via paths) ✅ Yes (via paths)
Build File Generated None None None CMakeLists.txt Makefile
Public/Internal Separation ❌ No ❌ No ✅ Yes ✅ Yes ✅ Yes
Backward Compatible ✅ Default

Creating a Custom Deployment

Users can create their own deployment based on one of these built-in configurations by:

  1. Creating a new <<CFamilyCodeDeployment>> in the CATIA Software Producer configuration diagram
  2. Copying property values from a built-in deployment
  3. Modifying properties as required
  4. Optionally attaching custom <<Resource>> Classes (via inherited additionalResources property)

For the complete property reference, use the code deployment profile definition document.