1 " =============================================================================
3 " Program: CMake - Cross-Platform Makefile Generator
4 " Module: $RCSfile: cmake.vim,v $
6 " Date: $Date: 2006/04/21 22:08:13 $
7 " Version: $Revision: 1.2 $
9 " =============================================================================
13 " Author: Andy Cedilnik <andy.cedilnik@kitware.com>
14 " Maintainer: Andy Cedilnik <andy.cedilnik@kitware.com>
15 " Last Change: $Date: 2006/04/21 22:08:13 $
16 " Version: $Revision: 1.2 $
18 " Licence: The CMake license applies to this file. See
19 " http://www.cmake.org/HTML/Copyright.html
20 " This implies that distribution with Vim is allowed
22 " For version 5.x: Clear all syntax items
23 " For version 6.x: Quit when a syntax file was already loaded
26 elseif exists("b:current_syntax")
31 syn match cmakeComment /#.*$/
32 syn region cmakeRegistry start=/\[/ end=/\]/ skip=/\\[\[\]]/
34 syn match cmakeArgument /[^()"]+/
36 syn match cmakeVariableValue /\${[^}]*}/
38 syn match cmakeEnvironment /\$ENV{.*}/
40 syn keyword cmakeSystemVariables
41 \ WIN32 UNIX APPLE CYGWIN BORLAND MINGW MSVC MSVC_IDE MSVC60 MSVC70 MSVC71 MSVC80
42 syn keyword cmakeOperators
43 \ AND BOOL CACHE COMMAND DEFINED DOC EQUAL EXISTS FALSE GREATER INTERNAL LESS MATCHES NAME NAMES NAME_WE NOT OFF ON OR PATH PATHS PROGRAM STREQUAL STRGREATER STRING STRLESS TRUE
45 syn region cmakeString start=/"/ end=/"/ skip=/\\"/
46 \ contains=ALLBUT,cmakeString
47 syn region cmakeArguments start=/\s*(/ end=/)/
48 \ contains=ALLBUT,cmakeArguments
49 syn keyword cmakeDeprecated ABSTRACT_FILES BUILD_NAME SOURCE_FILES SOURCE_FILES_REMOVE VTK_MAKE_INSTANTIATOR VTK_WRAP_JAVA VTK_WRAP_PYTHON VTK_WRAP_TCL WRAP_EXCLUDE_FILES
50 \ nextgroup=cmakeArgument
51 syn keyword cmakeStatement
52 \ ADD_CUSTOM_COMMAND ADD_CUSTOM_TARGET ADD_DEFINITIONS ADD_DEPENDENCIES ADD_EXECUTABLE ADD_LIBRARY ADD_SUBDIRECTORY ADD_TEST AUX_SOURCE_DIRECTORY BUILD_COMMAND BUILD_NAME CMAKE_MINIMUM_REQUIRED CONFIGURE_FILE CREATE_TEST_SOURCELIST ELSE ENABLE_LANGUAGE ENABLE_TESTING ENDFOREACH ENDIF ENDWHILE EXEC_PROGRAM EXECUTE_PROCESS EXPORT_LIBRARY_DEPENDENCIES FILE FIND_FILE FIND_LIBRARY FIND_PACKAGE FIND_PATH FIND_PROGRAM FLTK_WRAP_UI FOREACH GET_CMAKE_PROPERTY GET_DIRECTORY_PROPERTY GET_FILENAME_COMPONENT GET_SOURCE_FILE_PROPERTY GET_TARGET_PROPERTY GET_TEST_PROPERTY IF INCLUDE INCLUDE_DIRECTORIES INCLUDE_EXTERNAL_MSPROJECT INCLUDE_REGULAR_EXPRESSION INSTALL INSTALL_FILES INSTALL_PROGRAMS INSTALL_TARGETS LINK_DIRECTORIES LINK_LIBRARIES LIST LOAD_CACHE LOAD_COMMAND MACRO MAKE_DIRECTORY MARK_AS_ADVANCED MATH MESSAGE OPTION OUTPUT_REQUIRED_FILES PROJECT QT_WRAP_CPP QT_WRAP_UI REMOVE REMOVE_DEFINITIONS SEPARATE_ARGUMENTS SET SET_DIRECTORY_PROPERTIES SET_SOURCE_FILES_PROPERTIES SET_TARGET_PROPERTIES SET_TESTS_PROPERTIES SITE_NAME SOURCE_GROUP STRING SUBDIR_DEPENDS SUBDIRS TARGET_LINK_LIBRARIES TRY_COMPILE TRY_RUN USE_MANGLED_MESA UTILITY_SOURCE VARIABLE_REQUIRES VTK_MAKE_INSTANTIATOR VTK_WRAP_JAVA VTK_WRAP_PYTHON VTK_WRAP_TCL WHILE WRITE_FILE ENDMACRO
53 \ nextgroup=cmakeArgumnts
55 "syn match cmakeMacro /^\s*[A-Z_]\+/ nextgroup=cmakeArgumnts
57 " Define the default highlighting.
58 " For version 5.7 and earlier: only when not done already
59 " For version 5.8 and later: only when an item doesn't have highlighting yet
60 if version >= 508 || !exists("did_cmake_syntax_inits")
62 let did_cmake_syntax_inits = 1
63 command -nargs=+ HiLink hi link <args>
65 command -nargs=+ HiLink hi def link <args>
68 HiLink cmakeStatement Statement
69 HiLink cmakeComment Comment
70 HiLink cmakeString String
71 HiLink cmakeVariableValue Type
72 HiLink cmakeRegistry Underlined
73 HiLink cmakeArguments Identifier
74 HiLink cmakeArgument Constant
75 HiLink cmakeEnvironment Special
76 HiLink cmakeOperators Operator
77 HiLink cmakeMacro PreProc
78 HiLink cmakeError Error
83 let b:current_syntax = "cmake"