Defined my/cmake-config-command and aliased other variables to it.

This commit is contained in:
tastytea 2019-04-16 19:17:54 +02:00
parent 49cf2af594
commit fdfab6c719
2 changed files with 13 additions and 11 deletions

22
init.el
View File

@ -1,5 +1,5 @@
;;; init.el --- tastytea's Emacs init file.
;; Time-stamp: <2019-04-15T21:52:45+00:00>
;; Time-stamp: <2019-04-16T17:15:54+00:00>
;;; Commentary:
;; I am using this file with Emacs 26, but most of it will probably work with
@ -224,6 +224,15 @@ With argument, do this that many times."
:hook
(prog-mode . dtrt-indent-mode))
;; Define default cmake configuration command. Other variables are aliases to
;; this one.
(defvar my/cmake-config-command nil)
(setq my/cmake-config-command
"cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-G Unix\ Makefiles ..")
;; Mark variable as safe. This prevents prompts when using .dir-locals.el.
(put 'my/cmake-config-command 'safe-local-variable #'stringp)
;; Automatic project management.
(unless slow-computer
(use-package projectile
@ -240,16 +249,12 @@ With argument, do this that many times."
(substring (shell-command-to-string "nproc --ignore=1") 0 -1)))
:custom
(projectile-project-compilation-dir "build")
(projectile-project-configure-cmd
"cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-G 'Unix Makefiles' ..")
(projectile-switch-project-action 'neotree-projectile-action)
:config
(defvaralias 'projectile-project-configure-cmd 'my/cmake-config-command)
(setq projectile-project-compilation-cmd (concat my/cmake-compile-command
" && ctest -Q"))
(projectile-mode +1)
;; Mark variables as safe. This prevents prompts when using .dir-locals.el.
(put 'projectile-project-configure-cmd 'safe-local-variable #'stringp)
(put 'projectile-project-compilation-cmd 'safe-local-variable #'stringp)
:bind
("C-c p" . 'projectile-command-map)
@ -366,11 +371,8 @@ With argument, do this that many times."
:after irony
:custom
(cmake-ide-build-dir "build")
(cmake-ide-cmake-opts
"-DCMAKE_BUILD_TYPE=Debug -DCMAKE_EXPORT_COMPILE_COMMANDS=ON")
;; Mark variables as safe. This prevents prompts when using .dir-locals.el.
(put 'cmake-ide-cmake-opts 'safe-local-variable #'stringp)
:config
(defvaralias 'cmake-ide-cmake-opts 'my/cmake-config-command)
(cmake-ide-setup))
) ; unless slow-computer

View File

@ -1,2 +1,2 @@
127.0.0.1:51313 19706
127.0.0.1:51313 23816
phahw2ohVoh0oopheish7IVie9desh8aequeenei3uo8wahShe%thuadaeNa4ieh