View on GitHub

FreeCAD Developers Handbook

A handbook about FreeCAD development

[ Copyright Headers ] [ Snippets ]

Copyright : SPDX #

SPDX annotations declare metadata about the file they are placed in, like the license of the content contained within, the copyright holders or where the content originates from.

Generally every file whose format allows adding comments should contain SPDX annotations.


Placement #

SPDX annotations should be placed in inline comments at the top of the file.

// SPDX-License-Identifier: LGPL-2.1-or-later

Some file formats or file content may prevent this, for example shebang declarations may already occupy the first line in a script file, in that case simply add the annotations in the following lines.

#!/usr/bin/env bash
# SPDX-License-Identifier: LGPL-2.1-or-later


License #

To declare what license a file falls under, specify the appropriate License Id in the following way:

SPDX-License-Identifier: ‹License Id›
C++ #
// SPDX-License-Identifier: ‹License Id›
Python #
# SPDX-License-Identifier: ‹License Id›


To declare who holds the copyright to a file, add one annotation for every person / organization:

SPDX-FileCopyrightText: ‹Year› ‹Entity›

‹Year› is the year the code was published in.

‹Entity› is either a person or an organization.

Person #
SPDX-FileCopyrightText: 1999 Robert Robertson
Organization #
SPDX-FileCopyrightText: 2000 Crazy CAD Technologies


Examples #

1. Internal C++ Source File #

You just wrote a new .cpp file from scratch and want to license it under the standard license FreeCAD uses ( LGPL-2.1-or-later )

// SPDX-License-Identifier: LGPL-2.1-or-later
// SPDX-FileCopyrightText: 2026 Mike Mc Mickers
// SPDX-FileNotice: Part of the FreeCAD project.

...


2. External C++ Source File #

You want to include some pre-existing code licensed under a compatible but different license to what FreeCAD uses by default.

// SPDX-License-Identifier: MIT
// SPDX-FileCopyrightText: 1939 The Wizard of Oz
// SPDX-FileNotice: Part of the FreeCAD project.

...


3. Mixed Python Licensing #

You have some existing code licensed under one license but also want to add some code under a different license.

# SPDX-License-Identifier: LGPL-2.1-or-later AND MIT
# SPDX-FileCopyrightText: 2010 Technology Inc
# SPDX-FileCopyrightText: 2026 Jane Jay Jensen
# SPDX-FileNotice: Part of the FreeCAD project.

...


4. Executable Python Script #

You have a Python script with a Shebang declaration.

#!/usr/bin/env python3
# SPDX-License-Identifier: LGPL-2.1-or-later
# SPDX-FileCopyrightText: 2011 Nyan Cat
# SPDX-FileNotice: Part of the FreeCAD project.

...


5. Icons #

Icons should have whatever license the author intended, for example CC-BY-SA-4.0.

In svg files this is declared via metadata, not as a SPDX comment.


6. Documentation #

Besides the wiki, currently we don’t license documentation, however you might want to consider putting it under the Unlicense or CC-BY-SA-4.0.