spacemacs/layers/+tools/cmake/packages.el
syl20bnr ebe4c60264 Revert "Defer packages by default using use-package-always-defer"
This reverts commit 29c78ce841 and all other fixes
that have been made afterwards.

The motivation is that use-package is seen by many as a replacement for
`require`. Is use-package always defer the loading of packages then is breaks
this use case, this does not respect POLA so even if it was making Spacemacs
loading faster (up to 3s faster on some startup on my machine) we just cannot
use it, it would be irresponsible. Spacemacs should be easy to use, loading
performance will come with time but it is not a priority.
2018-03-03 23:40:10 -05:00

52 lines
1.6 KiB
EmacsLisp

;;; packages.el --- CMake layer packages fuke for Spacemacs
;;
;; Copyright (c) 2012-2018 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
(setq cmake-packages
'(
cmake-ide
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 cmake-ide--mode-hook)
:init
(progn
(dolist (hook '(c-mode-hook c++-mode-hook))
;; append the `cmake-ide--mode-hook' in order to load it last
(add-hook hook 'cmake-ide--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
:mode (("CMakeLists\\.txt\\'" . cmake-mode) ("\\.cmake\\'" . cmake-mode))))
(defun cmake/post-init-company ()
(when (configuration-layer/package-used-p 'cmake-mode)
(spacemacs|add-company-backends :backends company-cmake :modes cmake-mode)))
(defun cmake/init-helm-ctest ()
(use-package helm-ctest
:init (dolist (mode cmake-modes)
(spacemacs/set-leader-keys-for-major-mode mode
"pt" 'helm-ctest))))