emacscc-mode

Controlling the indent/offset for CMake in emacs


I am using cmake-mode which I thought came out of cc-mode (ed: comments below indicate this was incorrect). For some reason my indents (e.g. in an if() block) are coming out as 2 spaces, even though my c-basic-offset is set to 4. Does anybody know what/how to control this?

For example:

if( foo )
  set( a "bar" )
endif()

Solution

  • Indentation for cmake-mode seems to be controlled by the variable cmake-tab-width. You can adjust it like this:

    (setq cmake-tab-width 4)