Configure-time and Build-time Operations

In this chapter, we will cover the following recipes:

  • Using platform-independent file operations
  • Running a custom command at configure time
  • Running a custom command at build time: I. Using add_custom_command
  • Running a custom command at build time: II. Using add_custom_target
  • Running custom commands for specific targets at build time
  • Probing compilation and linking
  • Probing compiler flags
  • Probing execution
  • Fine-tuning configuration and compilation with generator expressions

Get CMake Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.