本文将详细解释三个常用的内置变量:CMAKE_SOURCE_DIR, EXECUTABLE_OUTPUT_PATH和CMAKE_EXPORT_COMPILE_COMMANDS。 1. CMAKE_SOURCE_DIR CMAKE_SOURCE_DIR是一个指向CMake配置开始时的项目源代码根目录的路径。这个变量通常用于定位项目源代码中的文件和目录。例如,如果你想在构建过程中复制一些文件到构建目录,你可以...
Brief Issue Summary I got another vscode extension (sonarlint) that needs the path to compile_commands.json as a configuration setting. Therefor, I need the path to the build directory. It changes when I change presets, so I cannot hard ...