cmake.js 3.2 KB

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