feat: extract compile command handling from CMakeLists.txt
This commit is contained in:
parent
0d43936a61
commit
fc5ad7f137
@ -5,12 +5,9 @@ project(
|
|||||||
VERSION 0.1.0
|
VERSION 0.1.0
|
||||||
LANGUAGES CXX)
|
LANGUAGES CXX)
|
||||||
|
|
||||||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake")
|
||||||
|
|
||||||
if(CMAKE_EXPORT_COMPILE_COMMANDS)
|
include(ExportCompileCommands)
|
||||||
set(CMAKE_CXX_STANDARD_INCLUDE_DIRECTORIES
|
|
||||||
${CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES})
|
|
||||||
endif()
|
|
||||||
|
|
||||||
configure_file("${PROJECT_SOURCE_DIR}/include/version.h.in"
|
configure_file("${PROJECT_SOURCE_DIR}/include/version.h.in"
|
||||||
"${PROJECT_BINARY_DIR}/include/version.h")
|
"${PROJECT_BINARY_DIR}/include/version.h")
|
||||||
|
6
cmake/ExportCompileCommands.cmake
Normal file
6
cmake/ExportCompileCommands.cmake
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||||
|
|
||||||
|
if(CMAKE_EXPORT_COMPILE_COMMANDS)
|
||||||
|
set(CMAKE_CXX_STANDARD_INCLUDE_DIRECTORIES
|
||||||
|
${CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES})
|
||||||
|
endif()
|
Reference in New Issue
Block a user