branch: elpa/projectile commit 474cd42df58e748eb83d312ccb7ea75b1b3dda13 Author: John Eivind Helset <jehel...@gmail.com> Commit: Bozhidar Batsov <bozhi...@batsov.dev>
Add support for preset-based installs in CMake projects. --- CHANGELOG.md | 1 + projectile.el | 12 +++++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f93e3bc711..d1e2a61e59 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ * [#1699](https://github.com/bbatsov/projectile/pull/1699): `projectile-ripgrep` now supports [`rg.el`](https://github.com/dajva/rg.el). * [#1712](https://github.com/bbatsov/projectile/issues/1712): Make it possible to hide Projectile's menu. See `projectile-show-menu`. * [#1718](https://github.com/bbatsov/projectile/issues/1718): Add a project type definition for `GNUMakefile`. +* [#1747](https://github.com/bbatsov/projectile/pull/1747): Add support for preset-based install-commands for CMake projects. ### Bugs fixed diff --git a/projectile.el b/projectile.el index b8d2e278fd..0c02bbb80a 100644 --- a/projectile.el +++ b/projectile.el @@ -2916,7 +2916,8 @@ select a name of a command preset, or opt a manual command by selecting (defconst projectile--cmake-manual-command-alist '((:configure-command . "cmake -S . -B build") (:compile-command . "cmake --build build") - (:test-command . "cmake --build build --target test"))) + (:test-command . "cmake --build build --target test") + (:install-command . "cmake --build build --target install"))) (defun projectile--cmake-manual-command (command-type) "Create maunual CMake COMMAND-TYPE command." @@ -2925,7 +2926,8 @@ select a name of a command preset, or opt a manual command by selecting (defconst projectile--cmake-preset-command-alist '((:configure-command . "cmake . --preset %s") (:compile-command . "cmake --build --preset %s") - (:test-command . "ctest --preset %s"))) + (:test-command . "ctest --preset %s") + (:install-command . "cmake --build --preset %s --target install"))) (defun projectile--cmake-preset-command (command-type preset) "Create CMake COMMAND-TYPE command using PRESET." @@ -2959,6 +2961,10 @@ a manual COMMAND-TYPE command is created with "CMake test command." (projectile--cmake-command :test-command)) +(defun projectile--cmake-install-command () + "CMake install command." + (projectile--cmake-command :install-command)) + ;;; Project type registration ;; ;; Project type detection happens in a reverse order with respect to @@ -3032,7 +3038,7 @@ a manual COMMAND-TYPE command is created with :configure #'projectile--cmake-configure-command :compile #'projectile--cmake-compile-command :test #'projectile--cmake-test-command - :install "cmake --build build --target install" + :install #'projectile--cmake-install-command :package "cmake --build build --target package") ;; PHP (projectile-register-project-type 'php-symfony '("composer.json" "app" "src" "vendor")