CMake Targets Reference¶
This page documents all available CMake targets in the EmbSec Kit build system.
Global Targets¶
Core Build Targets¶
all¶
Default target that builds all configured components.
embsec-sdk¶
Builds the EmbSec SDK library only.
labs¶
Builds all lab exercises.
clean¶
Removes all built files.
Packaging Targets¶
package-labs¶
Creates zip packages for all labs. Places packages in build/packages/.
package-<lab-name>¶
Creates a zip package for a specific lab.
package¶
Creates distribution packages using CPack.
Installation Targets¶
install¶
Installs SDK headers and libraries to the specified prefix.
Lab-Specific Targets¶
For each lab (e.g., 01-buffer-overflow), the following targets are available:
Build Targets¶
<lab-name>¶
Builds the lab executable and generates binary formats (.bin, .hex).
Flash Targets¶
flash-<lab-name>¶
Flashes the lab to hardware using lm4flash (if available).
QEMU Targets¶
These targets are only available when building with the QEMU toolchain:
qemu-<lab-name>¶
Runs the lab in QEMU emulator.
debug-<lab-name>¶
Starts the lab in QEMU with GDB server enabled.
exploit-<lab-name>¶
Starts the lab in QEMU with exploit development helpers.
Test Targets¶
test¶
Runs all tests using CTest.
test-labs¶
Runs all lab tests in QEMU (if QEMU build is configured).
Configuration Presets¶
The project uses CMake presets for common configurations:
Hardware Presets¶
embedded¶
Base preset for TM4C123GH6PM hardware.
tm4c-debug¶
Debug build for TM4C123GH6PM.
tm4c-release¶
Optimized release build for TM4C123GH6PM.
QEMU Presets¶
qemu¶
Build for QEMU LM3S6965 emulation.
Host Presets¶
host-debug¶
Native host build for testing (SDK only, no labs).
docs¶
Documentation-only build.
Build Options¶
CMake Variables¶
Configure these with -D flags:
EMBSEC_BUILD_LABS- Build lab exercises (default: ON)EMBSEC_BUILD_TESTS- Build unit tests (default: OFF)EMBSEC_BUILD_DOCS- Build documentation (default: OFF)EMBSEC_VERBOSE- Enable verbose output (default: OFF)CMAKE_BUILD_TYPE- Build type: Debug or Release
Example:
Target Dependencies¶
Lab Build Dependencies¶
Each lab target has the following dependency chain:
embsec-sdk- SDK library must be built first- Lab source files compilation
- Linking with SDK and TivaWare (if available)
- Binary format generation (.bin, .hex)
- Size report generation
Package Dependencies¶
package-<lab>depends on<lab>targetpackage-labsdepends on allpackage-<lab>targets- Packages include the binary and README files
Advanced Usage¶
Building Multiple Targets¶
Build multiple targets in one command:
Parallel Builds¶
Use parallel jobs for faster builds:
Verbose Output¶
Enable verbose build output:
Custom Build Directory¶
Use a different build directory:
See Also¶
- Makefile Targets - Make wrapper commands
- Project Structure - Directory layout
- Configuration - Build configuration options