Skip to content

Commit 7018ac9

Browse files
committed
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.
1 parent 8b79f96 commit 7018ac9

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

CMakeLists.txt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -308,17 +308,17 @@ endif()
308308

309309
######################################################
310310
# Generate .clangd configuration file for standalone header checking
311-
file(WRITE ${CMAKE_SOURCE_DIR}/.clangd
311+
file(WRITE ${PROJECT_SOURCE_DIR}/.clangd
312312
"CompileFlags:
313313
Add:
314314
- -xc++
315315
- -std=c++17
316-
- -I${CMAKE_SOURCE_DIR}/include
317-
- -I${CMAKE_SOURCE_DIR}/3rdparty
318-
- -I${CMAKE_SOURCE_DIR}/3rdparty/minitrace
319-
- -I${CMAKE_SOURCE_DIR}/3rdparty/tinyxml2
320-
- -I${CMAKE_SOURCE_DIR}/3rdparty/minicoro
321-
- -I${CMAKE_SOURCE_DIR}/3rdparty/lexy/include
316+
- -I${PROJECT_SOURCE_DIR}/include
317+
- -I${PROJECT_SOURCE_DIR}/3rdparty
318+
- -I${PROJECT_SOURCE_DIR}/3rdparty/minitrace
319+
- -I${PROJECT_SOURCE_DIR}/3rdparty/tinyxml2
320+
- -I${PROJECT_SOURCE_DIR}/3rdparty/minicoro
321+
- -I${PROJECT_SOURCE_DIR}/3rdparty/lexy/include
322322
")
323323

324324
######################################################

0 commit comments

Comments
 (0)