HAS_ITEM.cmake.in 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  1. include ("${RunCMake_SOURCE_DIR}/check_errors.cmake")
  2. unset (errors)
  3. set(output "$<PATH:HAS_ROOT_NAME,/a/b>")
  4. if (output)
  5. list (APPEND errors "ROOT_NAME: '/a/b' has root name")
  6. endif()
  7. set(output "$<PATH:HAS_ROOT_DIRECTORY,/a/b>")
  8. if (NOT output)
  9. list (APPEND errors "ROOT_DIRECTORY: '/a/b' does not have root directory")
  10. endif()
  11. set(output "$<PATH:HAS_ROOT_PATH,/a/b>")
  12. if (NOT output)
  13. list (APPEND errors "ROOT_PATH: '/a/b' does not have root path")
  14. endif()
  15. set(output "$<PATH:HAS_ROOT_PATH,a/b>")
  16. if (output)
  17. list (APPEND errors "ROOT_PATH: 'a/b' has root path")
  18. endif()
  19. set(output "$<PATH:HAS_FILENAME,/a/b>")
  20. if (NOT output)
  21. list (APPEND errors "FILENAME: '/a/b' does not have filename")
  22. endif()
  23. set(output "$<PATH:HAS_FILENAME,a.b>")
  24. if (NOT output)
  25. list (APPEND errors "FILENAME: 'a.b' does not have filename")
  26. endif()
  27. set(output "$<PATH:HAS_FILENAME,/a/b/>")
  28. if (output)
  29. list (APPEND errors "FILENAME: '/a/b/' has filename")
  30. endif()
  31. set(output "$<PATH:HAS_FILENAME,/>")
  32. if (output)
  33. list (APPEND errors "FILENAME: '/' has filename")
  34. endif()
  35. set(output "$<PATH:HAS_STEM,/a/b>")
  36. if (NOT output)
  37. list (APPEND errors "STEM: '/a/b' does not have stem")
  38. endif()
  39. set(output "$<PATH:HAS_STEM,a.b>")
  40. if (NOT output)
  41. list (APPEND errors "STEM: 'a.b' does not have stem")
  42. endif()
  43. set(output "$<PATH:HAS_STEM,.a>")
  44. if (NOT output)
  45. list (APPEND errors "STEM: '.a'} does not have stem")
  46. endif()
  47. set(output "$<PATH:HAS_STEM,/a/>")
  48. if (output)
  49. list (APPEND errors "STEM: '/a/' has stem")
  50. endif()
  51. set(output "$<PATH:HAS_STEM,/>")
  52. if (output)
  53. list (APPEND errors "STEM: '/' has stem")
  54. endif()
  55. set(output "$<PATH:HAS_EXTENSION,/a/b.c>")
  56. if (NOT output)
  57. list (APPEND errors "EXTENSION: '/a/b.c' does not have extension")
  58. endif()
  59. set(output "$<PATH:HAS_EXTENSION,b.c>")
  60. if (NOT output)
  61. list (APPEND errors "EXTENSION: 'b.c' does not have extension")
  62. endif()
  63. set(output "$<PATH:HAS_EXTENSION,/.a>")
  64. if (output)
  65. list (APPEND errors "EXTENSION: '/.a' has extension")
  66. endif()
  67. set(output "$<PATH:HAS_EXTENSION,/a/>")
  68. if (output)
  69. list (APPEND errors "EXTENSION: '/a/' has extension")
  70. endif()
  71. set(output "$<PATH:HAS_EXTENSION,/>")
  72. if (output)
  73. list (APPEND errors "EXTENSION: '/' has extension")
  74. endif()
  75. set(output "$<PATH:HAS_RELATIVE_PART,/a/b>")
  76. if (NOT output)
  77. list (APPEND errors "RELATIVE_PART: '/a/b' does not have relative part")
  78. endif()
  79. set(output "$<PATH:HAS_RELATIVE_PART,/>")
  80. if (output)
  81. list (APPEND errors "RELATIVE_PART: '/' has relative part")
  82. endif()
  83. set(output "$<PATH:HAS_PARENT_PATH,/a/b>")
  84. if (NOT output)
  85. list (APPEND errors "PARENT_PATH: '/a/b' does not have parent path")
  86. endif()
  87. set(output "$<PATH:HAS_PARENT_PATH,/>")
  88. if (NOT output)
  89. list (APPEND errors "PARENT_PATH: '/' does not have parent path")
  90. endif()
  91. set(output "$<PATH:HAS_PARENT_PATH,a>")
  92. if (output)
  93. list (APPEND errors "PARENT_PATH: 'a' has parent path")
  94. endif()
  95. if (WIN32)
  96. set(output "$<PATH:HAS_ROOT_NAME,c:/a/b>")
  97. if (NOT output)
  98. list (APPEND errors "ROOT_NAME: 'c:/a/b' does not have root name")
  99. endif()
  100. set(output "$<PATH:HAS_ROOT_DIRECTORY,c:/a/b>")
  101. if (NOT output)
  102. list (APPEND errors "ROOT_DIRECTORY: 'c:/a/b' does not have root directory")
  103. endif()
  104. set(output "$<PATH:HAS_ROOT_PATH,c:/a/b>")
  105. if (NOT output)
  106. list (APPEND errors "ROOT_PATH: 'c:/a/b' does not have root path")
  107. endif()
  108. set(output "$<PATH:HAS_ROOT_NAME,c:a/b>")
  109. if (NOT output)
  110. list (APPEND errors "ROOT_NAME: 'c:a/b' does not have root name")
  111. endif()
  112. set(output "$<PATH:HAS_ROOT_DIRECTORY,c:a/b>")
  113. if (output)
  114. list (APPEND errors "ROOT_DIRECTORY: 'c:a/b' has root directory")
  115. endif()
  116. set(output "$<PATH:HAS_ROOT_PATH,c:a/b>")
  117. if (NOT output)
  118. list (APPEND errors "ROOT_PATH: 'c:a/b' does not have root path")
  119. endif()
  120. set(output "$<PATH:HAS_ROOT_NAME,//host/b>")
  121. if (NOT output)
  122. list (APPEND errors "ROOT_NAME: '//host/b' does not have root name")
  123. endif()
  124. set(output "$<PATH:HAS_ROOT_DIRECTORY,//host/b>")
  125. if (NOT output)
  126. list (APPEND errors "ROOT_DIRECTORY: '//host/b' does not have root directory")
  127. endif()
  128. set(output "$<PATH:HAS_ROOT_PATH,//host/b>")
  129. if (NOT output)
  130. list (APPEND errors "ROOT_PATH: '//host/b' does not have root path")
  131. endif()
  132. set(output "$<PATH:HAS_ROOT_NAME,//host>")
  133. if (NOT output)
  134. list (APPEND errors "ROOT_NAME: '//host' does not have root name")
  135. endif()
  136. set(output "$<PATH:HAS_ROOT_DIRECTORY,//host>")
  137. if (output)
  138. list (APPEND errors "ROOT_DIRECTORY: '//host' has root directory")
  139. endif()
  140. set(output "$<PATH:HAS_ROOT_PATH,//host>")
  141. if (NOT output)
  142. list (APPEND errors "ROOT_PATH: '//host' does not have root path")
  143. endif()
  144. set(output "$<PATH:HAS_RELATIVE_PART,c:/a/b>")
  145. if (NOT output)
  146. list (APPEND errors "RELATIVE_PART: 'c:/a/b' does not have relative part")
  147. endif()
  148. set(output "$<PATH:HAS_RELATIVE_PART,c:a/b>")
  149. if (NOT output)
  150. list (APPEND errors "RELATIVE_PART: 'c:a/b' does not have relative part")
  151. endif()
  152. set(output "$<PATH:HAS_RELATIVE_PART,//host/b>")
  153. if (NOT output)
  154. list (APPEND errors "RELATIVE_PART: '//host/b' does not have relative part")
  155. endif()
  156. set(output "$<PATH:HAS_PARENT_PATH,c:/a/b>")
  157. if (NOT output)
  158. list (APPEND errors "PARENT_PATH: 'c:/a/b' does not have parent path")
  159. endif()
  160. set(output "$<PATH:HAS_PARENT_PATH,c:/>")
  161. if (NOT output)
  162. list (APPEND errors "PARENT_PATH: 'c:/' does not have parent path")
  163. endif()
  164. set(output "$<PATH:HAS_PARENT_PATH,c:>")
  165. if (NOT output)
  166. list (APPEND errors "PARENT_PATH: 'c:' does not have parent path")
  167. endif()
  168. set(output "$<PATH:HAS_PARENT_PATH,//host/>")
  169. if (NOT output)
  170. list (APPEND errors "PARENT_PATH: '//host/' does not have parent path")
  171. endif()
  172. set(output "$<PATH:HAS_PARENT_PATH,//host>")
  173. if (NOT output)
  174. list (APPEND errors "PARENT_PATH: '//host' does not have parent path")
  175. endif()
  176. endif()
  177. check_errors ("PATH:HAS..." ${errors})