aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Eivind Helset <jehelset@gmail.com>2022-02-03 21:53:17 +0100
committerBozhidar Batsov <bozhidar@batsov.dev>2022-02-08 14:26:03 +0200
commit474cd42df58e748eb83d312ccb7ea75b1b3dda13 (patch)
treea95b56f302e76afeff2feb5b08c688f3533f32e3
parent90da545aa86e0d0444c5f9a542bf15b9f20e4cbc (diff)
Add support for preset-based installs in CMake projects.
-rw-r--r--CHANGELOG.md1
-rw-r--r--projectile.el12
2 files changed, 10 insertions, 3 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index f93e3bc..d1e2a61 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 b8d2e27..0c02bbb 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")