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.
<?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>
Links
Software
- Code::Blocks (Windows, macOS, Linux)
- CMake, whose CodeBlocks generator writes them (Windows, macOS, Linux)