I have a project I build using cmake. To build this project, I need to define several options like -DPRODUCT=amd64 -DXML_DIR=/opt/xml_database Normally, I either pass these as -D or configure them in IDEs like qtcreator and vscode. How would I define them in package cmake-ide? I feel like I need to add these to .dir-local.el but could not find an example.


Skimming the source of cmake-ide reveals

(defcustom cmake-ide-cmake-opts
  "The options passed to cmake when calling it.  DEPRECATED, use `cmake-ide-cmake-args' instead."
  :group 'cmake-ide
  :safe #'stringp)

(defcustom cmake-ide-cmake-args
  "The options passed to cmake when calling it."
  :group 'cmake-ide
  :type '(repeat string))

So, set cmake-ide-cmake-args via customize, a setq, as a file variable or a directory local variable.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.