Useful Links
Computer Science
Other Tools and Technologies
CMake Build System
1. Introduction to Build Systems and CMake
2. Getting Started with CMake
3. CMake Language Fundamentals
4. Projects, Targets, and Properties
5. Managing Dependencies
6. Build Configuration and Toolchains
7. Advanced CMake Topics
8. Testing with CTest
9. Packaging with CPack
10. CMake Best Practices and Patterns
Advanced CMake Topics
Generator Expressions
Syntax and Evaluation
Basic Syntax
Evaluation Context
Nesting Expressions
Informational Expressions
CONFIG Expression
PLATFORM_ID Expression
C_COMPILER_ID Expression
CXX_COMPILER_ID Expression
Logical Expressions
BOOL Expression
AND Expression
OR Expression
NOT Expression
String Expressions
LOWER_CASE Expression
UPPER_CASE Expression
MAKE_C_IDENTIFIER Expression
Target Expressions
TARGET_EXISTS Expression
TARGET_FILE Expression
TARGET_LINKER_FILE Expression
TARGET_SONAME_FILE Expression
Compile Language Expressions
COMPILE_LANGUAGE Expression
Language-Specific Logic
Use Cases for Generator Expressions
Conditional Compilation
Platform-Specific Settings
Configuration-Dependent Values
File System Operations
file Command Overview
Command Categories
File Path Handling
Reading and Writing Files
READ Operation
WRITE Operation
APPEND Operation
File Encoding Considerations
File Globbing
GLOB Operation
GLOB_RECURSE Operation
Globbing Caveats
CONFIGURE_DEPENDS Option
File and Directory Operations
COPY Operation
INSTALL Operation
REMOVE Operation
REMOVE_RECURSE Operation
MAKE_DIRECTORY Operation
RENAME Operation
Path Manipulation
get_filename_component Command
RELATIVE_PATH Operation
REAL_PATH Operation
Path Normalization
File Properties
File Timestamps
File Permissions
File Size Information
Custom Commands and Targets
add_custom_command Command
Output-Based Custom Commands
Target-Based Custom Commands
Command Syntax
Dependencies and Ordering
add_custom_target Command
Creating Custom Targets
Target Dependencies
Build Integration
Custom Command Properties
WORKING_DIRECTORY Property
COMMENT Property
VERBATIM Property
Use Cases
Code Generation
File Processing
External Tool Integration
Installing Projects
install Command Overview
Installation Components
Installation Destinations
Installing Targets
TARGETS Mode
Destination Specification
Component-Based Installation
Permissions
Installing Files and Directories
FILES Mode
DIRECTORY Mode
Pattern Matching
File Permissions
Installing Programs
PROGRAMS Mode
Executable Permissions
Export Installation
EXPORT Mode
Creating Export Files
Namespace Specification
Installation Paths
CMAKE_INSTALL_PREFIX Variable
GNUInstallDirs Module
Standard Installation Directories
Runtime Dependencies
install(RUNTIME_DEPENDENCIES) Command
Dependency Resolution
Scripting with CMake
Script Mode
Running CMake in Script Mode
Script vs. Project Mode
Command-Line Arguments
Script Variables
CMAKE_ARGC Variable
CMAKE_ARGV Variables
CMAKE_CURRENT_LIST_FILE Variable
Use Cases
File Manipulation Scripts
System Introspection
Build Automation
Deployment Scripts
Script Best Practices
Error Handling
Portability Considerations
Documentation
Previous
6. Build Configuration and Toolchains
Go to top
Next
8. Testing with CTest