1 | /*
|
---|
2 | Language: CMake
|
---|
3 | Description: CMake is an open-source cross-platform system for build automation.
|
---|
4 | Author: Igor Kalnitsky <igor@kalnitsky.org>
|
---|
5 | Website: https://cmake.org
|
---|
6 | */
|
---|
7 |
|
---|
8 | /** @type LanguageFn */
|
---|
9 | function cmake(hljs) {
|
---|
10 | return {
|
---|
11 | name: 'CMake',
|
---|
12 | aliases: ['cmake.in'],
|
---|
13 | case_insensitive: true,
|
---|
14 | keywords: {
|
---|
15 | keyword:
|
---|
16 | // scripting commands
|
---|
17 | 'break cmake_host_system_information cmake_minimum_required cmake_parse_arguments ' +
|
---|
18 | 'cmake_policy configure_file continue elseif else endforeach endfunction endif endmacro ' +
|
---|
19 | 'endwhile execute_process file find_file find_library find_package find_path ' +
|
---|
20 | 'find_program foreach function get_cmake_property get_directory_property ' +
|
---|
21 | 'get_filename_component get_property if include include_guard list macro ' +
|
---|
22 | 'mark_as_advanced math message option return separate_arguments ' +
|
---|
23 | 'set_directory_properties set_property set site_name string unset variable_watch while ' +
|
---|
24 | // project commands
|
---|
25 | 'add_compile_definitions add_compile_options add_custom_command add_custom_target ' +
|
---|
26 | 'add_definitions add_dependencies add_executable add_library add_link_options ' +
|
---|
27 | 'add_subdirectory add_test aux_source_directory build_command create_test_sourcelist ' +
|
---|
28 | 'define_property enable_language enable_testing export fltk_wrap_ui ' +
|
---|
29 | 'get_source_file_property get_target_property get_test_property include_directories ' +
|
---|
30 | 'include_external_msproject include_regular_expression install link_directories ' +
|
---|
31 | 'link_libraries load_cache project qt_wrap_cpp qt_wrap_ui remove_definitions ' +
|
---|
32 | 'set_source_files_properties set_target_properties set_tests_properties source_group ' +
|
---|
33 | 'target_compile_definitions target_compile_features target_compile_options ' +
|
---|
34 | 'target_include_directories target_link_directories target_link_libraries ' +
|
---|
35 | 'target_link_options target_sources try_compile try_run ' +
|
---|
36 | // CTest commands
|
---|
37 | 'ctest_build ctest_configure ctest_coverage ctest_empty_binary_directory ctest_memcheck ' +
|
---|
38 | 'ctest_read_custom_files ctest_run_script ctest_sleep ctest_start ctest_submit ' +
|
---|
39 | 'ctest_test ctest_update ctest_upload ' +
|
---|
40 | // deprecated commands
|
---|
41 | 'build_name exec_program export_library_dependencies install_files install_programs ' +
|
---|
42 | 'install_targets load_command make_directory output_required_files remove ' +
|
---|
43 | 'subdir_depends subdirs use_mangled_mesa utility_source variable_requires write_file ' +
|
---|
44 | 'qt5_use_modules qt5_use_package qt5_wrap_cpp ' +
|
---|
45 | // core keywords
|
---|
46 | 'on off true false and or not command policy target test exists is_newer_than ' +
|
---|
47 | 'is_directory is_symlink is_absolute matches less greater equal less_equal ' +
|
---|
48 | 'greater_equal strless strgreater strequal strless_equal strgreater_equal version_less ' +
|
---|
49 | 'version_greater version_equal version_less_equal version_greater_equal in_list defined'
|
---|
50 | },
|
---|
51 | contains: [
|
---|
52 | {
|
---|
53 | className: 'variable',
|
---|
54 | begin: /\$\{/,
|
---|
55 | end: /\}/
|
---|
56 | },
|
---|
57 | hljs.HASH_COMMENT_MODE,
|
---|
58 | hljs.QUOTE_STRING_MODE,
|
---|
59 | hljs.NUMBER_MODE
|
---|
60 | ]
|
---|
61 | };
|
---|
62 | }
|
---|
63 |
|
---|
64 | module.exports = cmake;
|
---|