From c89f0d595b948488d72f00e3bcaa0503ec22b636 Mon Sep 17 00:00:00 2001
From: Johannes Schmitz <johannes.schmitz1@gmail.com>
Date: Fri, 26 Apr 2019 21:52:23 +0200
Subject: cmake: Enable CMAKE_EXPORT_COMPILE_COMMANDS

When CMAKE_EXPORT_COMPILE_COMMANDS is ON, a file compile_commands.json
will be created in the build directory that enables code completion
engines to find all include directories and provide a very comprehensive
auto completion experience without any manual IDE configuration.

A nice example for this is the VS Code extension cpptools that is
developed by Microsoft. Of course this is not limited to VS Code and
works with other engines such as YouCompleteMe as well.
---
 gr-utils/python/modtool/templates/gr-newmod/CMakeLists.txt | 3 +++
 1 file changed, 3 insertions(+)

(limited to 'gr-utils/python')

diff --git a/gr-utils/python/modtool/templates/gr-newmod/CMakeLists.txt b/gr-utils/python/modtool/templates/gr-newmod/CMakeLists.txt
index ea8eb3fb8e..0f603b48bf 100644
--- a/gr-utils/python/modtool/templates/gr-newmod/CMakeLists.txt
+++ b/gr-utils/python/modtool/templates/gr-newmod/CMakeLists.txt
@@ -49,6 +49,9 @@ set(VERSION_INFO_MAINT_VERSION git)
 
 cmake_policy(SET CMP0011 NEW)
 
+# Enable generation of compile_commands.json for code completion engines
+set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
+
 ########################################################################
 # Compiler specific setup
 ########################################################################
-- 
cgit v1.2.3