Set CMAKE_EXPORT_COMPILE_COMMANDS.

This creates compile_commands.json files which can be used by
code completion frameworks.

Ignore more files in .gitigore for this.
diff --git a/.gitignore b/.gitignore
index d0fb089..9807462 100644
--- a/.gitignore
+++ b/.gitignore
@@ -5,3 +5,5 @@
 *~
 *.tar.gz
 *.tar.xz
+/.clangd
+/compile_commands.json
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3c19157..17c34d6 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -299,6 +299,9 @@
 	SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
 ENDIF()
 
+# for code completion frameworks
+SET(CMAKE_EXPORT_COMPILE_COMMANDS ON)
+
 # Testing
 ENABLE_TESTING()