From 09d676e061a7053a7afb7181c01ce6be257256dc Mon Sep 17 00:00:00 2001 From: Matthias Maier Date: Thu, 24 Nov 2022 06:02:21 -0600 Subject: [PATCH] CMake: always export compile_commands.json in deal.II and user projects --- CMakeLists.txt | 2 ++ cmake/macros/macro_deal_ii_invoke_autopilot.cmake | 2 ++ 2 files changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 51d577c7fe..4319cbae34 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -35,6 +35,8 @@ MESSAGE(STATUS "") CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) +set(CMAKE_EXPORT_COMPILE_COMMANDS TRUE) + # # We support all policy changes up to version 3.3. Thus, explicitly set all # policies CMP0001 - CMP0054 to new for version 3.3 (and later) to avoid diff --git a/cmake/macros/macro_deal_ii_invoke_autopilot.cmake b/cmake/macros/macro_deal_ii_invoke_autopilot.cmake index 3ccfdfcbbc..e2b99f6912 100644 --- a/cmake/macros/macro_deal_ii_invoke_autopilot.cmake +++ b/cmake/macros/macro_deal_ii_invoke_autopilot.cmake @@ -44,6 +44,8 @@ MACRO(DEAL_II_INVOKE_AUTOPILOT) SET(_make_command " $ make") ENDIF() + set(CMAKE_EXPORT_COMPILE_COMMANDS TRUE) + # Define and setup a compilation target: ADD_EXECUTABLE(${TARGET} ${TARGET_SRC}) DEAL_II_SETUP_TARGET(${TARGET}) -- 2.39.5