diff --git a/cpputils-cmake.el b/cpputils-cmake.el index 5140739..af7522d 100644 --- a/cpputils-cmake.el +++ b/cpputils-cmake.el @@ -414,16 +414,21 @@ White space here is any of: space, tab, emacs newline (line feed, ASCII 10)." ) )) +(defun cppcm-create-compilation-command (target-path) + "Create command for compilation. By default returns 'make -C .' +You can replace the function to use another command." + (concat "make -C " target-path)) + (defun cppcm-compile-in-current-exe-dir () "compile the executable/library in current directory." (interactive) - (setq compile-command (concat "make -C " (cppcm-get-exe-dir-path-current-buffer))) + (setq compile-command (cppcm-create-compilation-command (cppcm-get-exe-dir-path-current-buffer))) (call-interactively 'compile)) (defun cppcm-compile-in-root-build-dir () "compile in build directory" (interactive) - (setq compile-command (concat "make -C " cppcm-build-dir)) + (setq compile-command (cppcm-create-compilation-command cppcm-build-dir)) (call-interactively 'compile)) ;;;###autoload @@ -499,7 +504,7 @@ by customize `cppcm-compile-list'." (dolist (x inc-dirs) (add-to-list 'cc-search-directories x)) )))) (when (and cppcm-build-dir (file-exists-p (concat cppcm-build-dir "CMakeCache.txt"))) - (setq compile-command (concat "make -C " cppcm-build-dir)) + (setq compile-command (cppcm-create-compilation-command cppcm-build-dir)) ) (run-hook-with-args 'cppcm-reload-all-hook) )