CMake Editors Support: Difference between revisions

From KitwarePublic
Jump to navigationJump to search
Line 25: Line 25:
* [http://kate.kde.org Kate], KWrite, [http://www.kdevelop.org KDevelop] and all other [http://www.kde.org KDE] applictions, which use the kate text-editing component support cmake syntax highlighting. Currently you have to open the settings dialog and choose download (Settings -> Configure Kate -> Editor -> Highlighting -> Download) and there select CMake in the listbox. Then the cmake syntax highlighting definition file for kate will be downloaded and installed. From KDE 3.4 and later cmake syntax highlighting will come with standard KDE.
* [http://kate.kde.org Kate], KWrite, [http://www.kdevelop.org KDevelop] and all other [http://www.kde.org KDE] applictions, which use the kate text-editing component support cmake syntax highlighting. Currently you have to open the settings dialog and choose download (Settings -> Configure Kate -> Editor -> Highlighting -> Download) and there select CMake in the listbox. Then the cmake syntax highlighting definition file for kate will be downloaded and installed. From KDE 3.4 and later cmake syntax highlighting will come with standard KDE.


* UltraEdit (an approach)
* UltraEdit (an approach) save the jpg as text: [[Image:wordfile.jpg]]
save the jpg as text: [[Image:wordfile.jpg]]


==Creating New Editor Mode==
==Creating New Editor Mode==

Revision as of 08:32, 6 October 2004

CMake Editor Modes

There are CMake syntax highlighting and indentation supports for several editors:

; Add cmake listfile names to the mode list.
(setq auto-mode-alist
	  (append
	   '(("CMakeLists\\.txt\\'" . cmake-mode))
	   '(("\\.cmake\\'" . cmake-mode))
	   auto-mode-alist))

(autoload 'cmake-mode "~/CMake/Docs/cmake-mode.el" t)
  • VIM syntax highlighting and indentation mode. To enable indentation, copy indentation file to your .vim/indent directory, syntax highlighting file to your .vim/syntax directory and add the following to your .vimrc:
:autocmd BufRead,BufNewFile *.cmake,CMakeLists.txt,*.cmake.in runtime! indent/cmake.vim 
:autocmd BufRead,BufNewFile *.cmake,CMakeLists.txt,*.cmake.in setf cmake
  • Kate, KWrite, KDevelop and all other KDE applictions, which use the kate text-editing component support cmake syntax highlighting. Currently you have to open the settings dialog and choose download (Settings -> Configure Kate -> Editor -> Highlighting -> Download) and there select CMake in the listbox. Then the cmake syntax highlighting definition file for kate will be downloaded and installed. From KDE 3.4 and later cmake syntax highlighting will come with standard KDE.

Creating New Editor Mode

The best way to start is to check the logic in existing ones. Make sure to enable indentation for files that match the following file names:

  • CMakeLists.txt
  • *.cmake
  • *.cmake.in
  • *.ctest
  • *.ctest.in