This repository has been archived on 2024-10-22. You can view files and clone it, but cannot push or open issues or pull requests.
spacemacs/layers/+tools/cmake/packages.el

52 lines
1.6 KiB
EmacsLisp
Raw Normal View History

;;; packages.el --- CMake layer packages file for Spacemacs.
;;
2020-08-13 21:22:11 +00:00
;; Copyright (c) 2012-2020 Sylvain Benner & Contributors
;;
;; Author: Alexander Dalshov <dalshov@gmail.com>
;; URL: https://github.com/syl20bnr/spacemacs
;;
;; This file is not part of GNU Emacs.
;;
;;; License: GPLv3
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)))
(defun cmake/init-cmake-ide ()
(use-package cmake-ide
:if cmake-enable-cmake-ide-support
:commands (cmake-ide-delete-file cide--mode-hook)
:init
(progn
(dolist (hook '(c-mode-hook c++-mode-hook))
;; append the `cide--mode-hook' in order to load it last
(add-hook hook 'cide--mode-hook 'append))
(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
"pd" 'cmake-ide-delete-file)))
:config (cmake-ide-setup)))
(defun cmake/init-cmake-mode ()
(use-package cmake-mode
: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-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
(defun cmake/init-helm-ctest ()
(use-package helm-ctest
2018-06-11 05:49:19 +00:00
:defer t
:init (dolist (mode cmake-modes)
(spacemacs/set-leader-keys-for-major-mode mode
"pt" 'helm-ctest))))