1 " =============================================================================
3 " Program: CMake - Cross-Platform Makefile Generator
4 " Module: $RCSfile: cmake-syntax.vim,v $
6 " Date: $Date: 2003-07-07 17:36:04 $
7 " Version: $Revision: 1.1 $
9 " Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
10 " See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
12 " This software is distributed WITHOUT ANY WARRANTY" without even
13 " the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14 " PURPOSE. See the above copyright notices for more information.
16 " =============================================================================
20 " Maintainer: Andy Cedilnik <andy.cedilnik@kitware.com>
21 " Last Change: Fri Mar 21 22:33:55 EST 2003
23 " For version 5.x: Clear all syntax items
24 " For version 6.x: Quit when a syntax file was already loaded
27 elseif exists("b:current_syntax")
34 syn match cmakeComment /#.*$/
35 syn region cmakeRegistry start=/\[/ end=/\]/ skip=/\\[\[\]]/
37 syn match cmakeArgument /[^()"]+/
39 syn match cmakeVariableValue /\${[^}]*}/
41 syn match cmakeEnvironment /\$ENV{.*}/
43 syn keyword cmakeSystemVariables WIN32 UNIX APPLE
44 syn keyword cmakeOperators MATCHES AND OR EXISTS CACHE STRING BOOL PROGRAM NAMES INTERNAL PATHS DOC PATH NOT NAME NAME_WE FALSE TRUE ON OFF
46 syn region cmakeString start=/"/ end=/"/ skip=/\\"/
47 \ contains=cmakeVariableValue,cmakeRegistry keepend oneline
48 syn region cmakeArguments start=/\s*(/ end=/)/
49 \ contains=cmakeEnvironment,cmakeRegistry,cmakeVariableValue,cmakeString,cmakeArgument,cmakeOperators keepend
50 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
51 \ nextgroup=cmakeArgument
52 syn keyword cmakeStatement
53 \ ADD_CUSTOM_COMMAND ADD_CUSTOM_TARGET ADD_DEFINITIONS ADD_DEPENDENCIES ADD_EXECUTABLE ADD_LIBRARY ADD_TEST AUX_SOURCE_DIRECTORY BUILD_COMMAND CMAKE_MINIMUM_REQUIRED CONFIGURE_FILE CREATE_TEST_SOURCELIST ENABLE_TESTING FOREACH ENDFOREACH IF ELSE ENDIF EXPORT_LIBRARY_DEPENDENCIES FIND_FILE FIND_LIBRARY FIND_PACKAGE FIND_PATH FIND_PROGRAM FLTK_WRAP_UI GET_CMAKE_PROPERTY GET_FILENAME_COMPONENT GET_SOURCE_FILE_PROPERTY GET_TARGET_PROPERTY INCLUDE INCLUDE_DIRECTORIES INCLUDE_EXTERNAL_MSPROJECT INCLUDE_REGULAR_EXPRESSION INSTALL_FILES INSTALL_PROGRAMS INSTALL_TARGETS ITK_WRAP_TCL LINK_DIRECTORIES LINK_LIBRARIES LOAD_CACHE LOAD_COMMAND MACRO ENDMACRO MAKE_DIRECTORY MARK_AS_ADVANCED MESSAGE OPTION OUTPUT_REQUIRED_FILES PROJECT QT_WRAP_CPP QT_WRAP_UI SEPARATE_ARGUMENTS REMOVE SET SET_SOURCE_FILES_PROPERTIES SET_TARGET_PROPERTIES SITE_NAME SOURCE_GROUP STRING SUBDIRS SUBDIR_DEPENDS TARGET_LINK_LIBRARIES TRY_COMPILE TRY_RUN USE_MANGLED_MESA UTILITY_SOURCE VARIABLE_REQUIRES WRITE_FILE
54 \ nextgroup=cmakeArgumnts
56 syn match cmakeMacro /[A-Z_]+/ nextgroup=cmakeArgumnts
58 " Define the default highlighting.
59 " For version 5.7 and earlier: only when not done already
60 " For version 5.8 and later: only when an item doesn't have highlighting yet
61 if version >= 508 || !exists("did_cmake_syntax_inits")
63 let did_cmake_syntax_inits = 1
64 command -nargs=+ HiLink hi link <args>
66 command -nargs=+ HiLink hi def link <args>
70 HiLink cmakeStatement Statement
71 HiLink cmakeComment Comment
72 HiLink cmakeString String
73 HiLink cmakeVariableValue Type
74 HiLink cmakeRegistry Underlined
75 HiLink cmakeArguments Identifier
76 HiLink cmakeArgument Constant
77 HiLink cmakeEnvironment Special
78 HiLink cmakeOperators Operator
79 HiLink cmakeMacro PreProc
84 let b:current_syntax = "cmake"