How do I use generator expressions ($<...>) in CMake for C++?

CMake, Generator Expressions, C++, Build System
Learn how to use generator expressions in CMake to build C++ projects dynamically based on target properties.
# Example of using generator expressions in CMake cmake_minimum_required(VERSION 3.1) project(MyProject) add_library(MyLibrary src/mylibrary.cpp) target_compile_definitions(MyLibrary PRIVATE $,DEBUG_MODE,RELEASE_MODE> ) target_include_directories(MyLibrary PRIVATE $,include/otherlib,include/default> ) # In this example, we create compile definitions based on the configuration and target existence

CMake Generator Expressions C++ Build System