我在多个地方看到了在定义包含目录时使用生成器表达式的参考,因此您可以在编译和安装期间为包含定义不同的位置。例如: # Define headers for this library. PUBLIC headers are used for # compiling the library, and will be added to consumers' build # paths. target_include_directories(lib PUBLIC $<BUILD_...