From: Matthias Maier Date: Thu, 24 Nov 2022 12:02:21 +0000 (-0600) Subject: CMake: always export compile_commands.json in deal.II and user projects X-Git-Tag: v9.5.0-rc1~818^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F14465%2Fhead;p=dealii.git CMake: always export compile_commands.json in deal.II and user projects --- 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})