.cmake-format.py 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. with section('parse'):
  2. # Specify structure for custom cmake functions
  3. additional_commands = {
  4. 'draco_add_emscripten_executable': {
  5. 'kwargs': {
  6. 'NAME': '*',
  7. 'SOURCES': '*',
  8. 'OUTPUT_NAME': '*',
  9. 'DEFINES': '*',
  10. 'INCLUDES': '*',
  11. 'COMPILE_FLAGS': '*',
  12. 'LINK_FLAGS': '*',
  13. 'OBJLIB_DEPS': '*',
  14. 'LIB_DEPS': '*',
  15. 'GLUE_PATH': '*',
  16. 'PRE_LINK_JS_SOURCES': '*',
  17. 'POST_LINK_JS_SOURCES': '*',
  18. 'FEATURES': '*',
  19. },
  20. 'pargs': 0,
  21. },
  22. 'draco_add_executable': {
  23. 'kwargs': {
  24. 'NAME': '*',
  25. 'SOURCES': '*',
  26. 'OUTPUT_NAME': '*',
  27. 'TEST': 0,
  28. 'DEFINES': '*',
  29. 'INCLUDES': '*',
  30. 'COMPILE_FLAGS': '*',
  31. 'LINK_FLAGS': '*',
  32. 'OBJLIB_DEPS': '*',
  33. 'LIB_DEPS': '*',
  34. },
  35. 'pargs': 0,
  36. },
  37. 'draco_add_library': {
  38. 'kwargs': {
  39. 'NAME': '*',
  40. 'TYPE': '*',
  41. 'SOURCES': '*',
  42. 'TEST': 0,
  43. 'OUTPUT_NAME': '*',
  44. 'DEFINES': '*',
  45. 'INCLUDES': '*',
  46. 'COMPILE_FLAGS': '*',
  47. 'LINK_FLAGS': '*',
  48. 'OBJLIB_DEPS': '*',
  49. 'LIB_DEPS': '*',
  50. 'PUBLIC_INCLUDES': '*',
  51. },
  52. 'pargs': 0,
  53. },
  54. 'draco_generate_emscripten_glue': {
  55. 'kwargs': {
  56. 'INPUT_IDL': '*',
  57. 'OUTPUT_PATH': '*',
  58. },
  59. 'pargs': 0,
  60. },
  61. 'draco_get_required_emscripten_flags': {
  62. 'kwargs': {
  63. 'FLAG_LIST_VAR_COMPILER': '*',
  64. 'FLAG_LIST_VAR_LINKER': '*',
  65. },
  66. 'pargs': 0,
  67. },
  68. 'draco_option': {
  69. 'kwargs': {
  70. 'NAME': '*',
  71. 'HELPSTRING': '*',
  72. 'VALUE': '*',
  73. },
  74. 'pargs': 0,
  75. },
  76. # Rules for built in CMake commands and those from dependencies.
  77. 'list': {
  78. 'kwargs': {
  79. 'APPEND': '*',
  80. 'FILTER': '*',
  81. 'FIND': '*',
  82. 'GET': '*',
  83. 'INSERT': '*',
  84. 'JOIN': '*',
  85. 'LENGTH': '*',
  86. 'POP_BACK': '*',
  87. 'POP_FRONT': '*',
  88. 'PREPEND': '*',
  89. 'REMOVE_DUPLICATES': '*',
  90. 'REMOVE_ITEM': '*',
  91. 'REVERSE': '*',
  92. 'SORT': '*',
  93. 'SUBLIST': '*',
  94. 'TRANSFORM': '*',
  95. },
  96. },
  97. 'protobuf_generate': {
  98. 'kwargs': {
  99. 'IMPORT_DIRS': '*',
  100. 'LANGUAGE': '*',
  101. 'OUT_VAR': '*',
  102. 'PROTOC_OUT_DIR': '*',
  103. 'PROTOS': '*',
  104. },
  105. },
  106. }
  107. with section('format'):
  108. # Formatting options.
  109. # How wide to allow formatted cmake files
  110. line_width = 80
  111. # How many spaces to tab for indent
  112. tab_size = 2
  113. # If true, separate flow control names from their parentheses with a space
  114. separate_ctrl_name_with_space = False
  115. # If true, separate function names from parentheses with a space
  116. separate_fn_name_with_space = False
  117. # If a statement is wrapped to more than one line, than dangle the closing
  118. # parenthesis on its own line.
  119. dangle_parens = False
  120. # Do not sort argument lists.
  121. enable_sort = False
  122. # What style line endings to use in the output.
  123. line_ending = 'unix'
  124. # Format command names consistently as 'lower' or 'upper' case
  125. command_case = 'canonical'
  126. # Format keywords consistently as 'lower' or 'upper' case
  127. keyword_case = 'upper'