From 7018ac94fa9b92b5621dc418b8ff820601fceac4 Mon Sep 17 00:00:00 2001 From: Vincent PALANCHER Date: Mon, 19 Jan 2026 17:05:12 +0100 Subject: [PATCH] Generate .clangd in PROJECT_SOURCE_DIR This allows the project to be used as a submodule or subdirectory of another CMake project without rewriting their `.clangd` file. This includes using BT.CPP through CMake FetchContent or CPM. --- CMakeLists.txt | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e5b181127..86aeaf743 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -308,17 +308,17 @@ endif() ###################################################### # Generate .clangd configuration file for standalone header checking -file(WRITE ${CMAKE_SOURCE_DIR}/.clangd +file(WRITE ${PROJECT_SOURCE_DIR}/.clangd "CompileFlags: Add: - -xc++ - -std=c++17 - - -I${CMAKE_SOURCE_DIR}/include - - -I${CMAKE_SOURCE_DIR}/3rdparty - - -I${CMAKE_SOURCE_DIR}/3rdparty/minitrace - - -I${CMAKE_SOURCE_DIR}/3rdparty/tinyxml2 - - -I${CMAKE_SOURCE_DIR}/3rdparty/minicoro - - -I${CMAKE_SOURCE_DIR}/3rdparty/lexy/include + - -I${PROJECT_SOURCE_DIR}/include + - -I${PROJECT_SOURCE_DIR}/3rdparty + - -I${PROJECT_SOURCE_DIR}/3rdparty/minitrace + - -I${PROJECT_SOURCE_DIR}/3rdparty/tinyxml2 + - -I${PROJECT_SOURCE_DIR}/3rdparty/minicoro + - -I${PROJECT_SOURCE_DIR}/3rdparty/lexy/include ") ######################################################