From 7534a3c8154c3a0653aed44075e6a87c4ce8037d Mon Sep 17 00:00:00 2001 From: Nathan Brei Date: Wed, 17 Jul 2024 01:24:04 -0400 Subject: [PATCH] Enable CMAKE_EXPORT_COMPILE_COMMANDS --- .gitignore | 1 + CMakeLists.txt | 2 ++ 2 files changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index 09a7b4bb5..ae9369ab0 100644 --- a/.gitignore +++ b/.gitignore @@ -62,6 +62,7 @@ docs/latex/* cmake-build*/ .idea/* .cache +compile_commands.json # PODIO generated artifacts src/examples/PodioExample/datamodel/* diff --git a/CMakeLists.txt b/CMakeLists.txt index 908dfb121..9be02064e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -37,6 +37,8 @@ set( CMAKE_BUILD_WITH_INSTALL_RPATH FALSE ) set( CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib" ) set( CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE ) +# Generate a compilation database, e.g. for IDE autocompletion +set( CMAKE_EXPORT_COMPILE_COMMANDS TRUE ) # Useful for debugging. Copied from: # https://stackoverflow.com/questions/9298278/cmake-print-out-all-accessible-variables-in-a-script