2018-12-04 02:47:48 +00:00
|
|
|
;;; packages.el --- CMake layer packages file for Spacemacs.
|
2018-01-20 16:08:51 +00:00
|
|
|
;;
|
2021-03-22 20:11:29 +00:00
|
|
|
;; Copyright (c) 2012-2021 Sylvain Benner & Contributors
|
2018-01-20 16:08:51 +00:00
|
|
|
;;
|
|
|
|
;; Author: Alexander Dalshov <dalshov@gmail.com>
|
|
|
|
;; URL: https://github.com/syl20bnr/spacemacs
|
|
|
|
;;
|
|
|
|
;; This file is not part of GNU Emacs.
|
|
|
|
;;
|
2021-03-24 03:31:44 +00:00
|
|
|
;; This program is free software; you can redistribute it and/or modify
|
|
|
|
;; it under the terms of the GNU General Public License as published by
|
|
|
|
;; the Free Software Foundation, either version 3 of the License, or
|
|
|
|
;; (at your option) any later version.
|
|
|
|
;;
|
|
|
|
;; This program is distributed in the hope that it will be useful,
|
|
|
|
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
;; GNU General Public License for more details.
|
|
|
|
;;
|
|
|
|
;; You should have received a copy of the GNU General Public License
|
|
|
|
;; along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
2020-08-13 21:22:11 +00:00
|
|
|
(defconst cmake-packages
|
|
|
|
'(
|
|
|
|
(cmake-ide :toggle cmake-enable-cmake-ide-support)
|
|
|
|
cmake-mode
|
|
|
|
company
|
|
|
|
(helm-ctest :requires helm)))
|
2018-01-20 16:08:51 +00:00
|
|
|
|
|
|
|
(defun cmake/init-cmake-ide ()
|
|
|
|
(use-package cmake-ide
|
|
|
|
:if cmake-enable-cmake-ide-support
|
2018-05-01 21:02:31 +00:00
|
|
|
:commands (cmake-ide-delete-file cide--mode-hook)
|
2018-02-28 04:31:36 +00:00
|
|
|
:init
|
2018-01-20 16:08:51 +00:00
|
|
|
(progn
|
2018-02-28 04:31:36 +00:00
|
|
|
(dolist (hook '(c-mode-hook c++-mode-hook))
|
2018-05-01 21:02:31 +00:00
|
|
|
;; append the `cide--mode-hook' in order to load it last
|
|
|
|
(add-hook hook 'cide--mode-hook 'append))
|
2018-01-20 16:08:51 +00:00
|
|
|
(dolist (mode cmake-modes)
|
|
|
|
(spacemacs/declare-prefix-for-mode mode "mc" "compile")
|
|
|
|
(spacemacs/declare-prefix-for-mode mode "mp" "project")
|
|
|
|
(spacemacs/set-leader-keys-for-major-mode mode
|
|
|
|
"cc" 'cmake-ide-compile
|
|
|
|
"pc" 'cmake-ide-run-cmake
|
|
|
|
"pC" 'cmake-ide-maybe-run-cmake
|
2018-02-28 04:31:36 +00:00
|
|
|
"pd" 'cmake-ide-delete-file)))
|
|
|
|
:config (cmake-ide-setup)))
|
2018-01-20 16:08:51 +00:00
|
|
|
|
|
|
|
(defun cmake/init-cmake-mode ()
|
|
|
|
(use-package cmake-mode
|
2018-03-04 04:37:53 +00:00
|
|
|
:defer t
|
2020-08-13 21:22:11 +00:00
|
|
|
:mode (("CMakeLists\\.txt\\'" . cmake-mode) ("\\.cmake\\'" . cmake-mode))
|
|
|
|
:init (add-hook 'cmake-mode-hook #'spacemacs//cmake-setup-backend)))
|
2018-01-20 16:08:51 +00:00
|
|
|
|
2018-02-17 15:31:36 +00:00
|
|
|
(defun cmake/post-init-company ()
|
2020-08-13 21:22:11 +00:00
|
|
|
(spacemacs//cmake-setup-company))
|
2018-02-17 15:31:36 +00:00
|
|
|
|
2018-01-20 16:08:51 +00:00
|
|
|
(defun cmake/init-helm-ctest ()
|
|
|
|
(use-package helm-ctest
|
2018-06-11 05:49:19 +00:00
|
|
|
:defer t
|
2018-03-04 04:37:53 +00:00
|
|
|
:init (dolist (mode cmake-modes)
|
|
|
|
(spacemacs/set-leader-keys-for-major-mode mode
|
|
|
|
"pt" 'helm-ctest))))
|