Introduction
A .cbp file is a project for Code::Blocks,
a free, open-source IDE for C and C++ that is popular in teaching. It lists the
project’s source files, its build targets (usually Debug and Release) and the compiler
and linker options for each. Several projects can be grouped in a workspace, saved as
.workspace.
CMake can also write .cbp files, so
CMake projects can be opened in Code::Blocks.
Structure
The file is XML with a CodeBlocks_project_file root. A
FileVersion element gives the format version, and a
Project element holds the rest: Option elements for the
title and compiler, a Build element with one Target per build
target, Compiler and Linker elements with options shared by
all targets, and a Unit element for each source file. Every element,
attribute and code value, and the .workspace format, are on the
elements page.
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<CodeBlocks_project_file>
<FileVersion major="1" minor="6" />
<Project>
<Option title="app" />
<Option compiler="gcc" />
<Build>
<Target title="Debug">
<Option output="bin/Debug/app" prefix_auto="1" extension_auto="1" />
<Option type="1" />
<Compiler>
<Add option="-g" />
</Compiler>
</Target>
</Build>
<Unit filename="main.cpp" />
</Project>
</CodeBlocks_project_file>
Not described
Known, not yet covered
- Reference: the meaning of
external_deps,weight,platforms,createDefFileandcheck_files, and the syntax of platform values, in the Code::Blocks source; see elements. - Viewer: there is no viewer for Code::Blocks projects yet.
Links
Software
- Code::Blocks – the free C and C++ IDE that uses them (Windows, macOS, Linux)
- CMake – build system generator whose CodeBlocks generator writes them (Windows, macOS, Linux)