cmake.js 3.0 KB

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