kdsource 0.1.99__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (233) hide show
  1. kdsource-0.1.99/CMakeLists.txt +233 -0
  2. kdsource-0.1.99/LICENSE +674 -0
  3. kdsource-0.1.99/PKG-INFO +109 -0
  4. kdsource-0.1.99/README.md +78 -0
  5. kdsource-0.1.99/VERSION +1 -0
  6. kdsource-0.1.99/clib/include/kdsource/geom.h +99 -0
  7. kdsource-0.1.99/clib/include/kdsource/kdsource.h.in +88 -0
  8. kdsource-0.1.99/clib/include/kdsource/plist.h +43 -0
  9. kdsource-0.1.99/clib/include/kdsource/utils.h +40 -0
  10. kdsource-0.1.99/clib/src/geom.c +637 -0
  11. kdsource-0.1.99/clib/src/kdsource.c +467 -0
  12. kdsource-0.1.99/clib/src/plist.c +117 -0
  13. kdsource-0.1.99/clib/src/resamplemcpl.c +29 -0
  14. kdsource-0.1.99/clib/src/utils.c +225 -0
  15. kdsource-0.1.99/clib/src/writemcpl.c +69 -0
  16. kdsource-0.1.99/pyproject.toml +74 -0
  17. kdsource-0.1.99/python/kdsource/__init__.py.in +40 -0
  18. kdsource-0.1.99/python/kdsource/_chooks.py +101 -0
  19. kdsource-0.1.99/python/kdsource/_chooks_loadlib.py +34 -0
  20. kdsource-0.1.99/python/kdsource/_cli_config.py +55 -0
  21. kdsource-0.1.99/python/kdsource/_cli_resample.py +38 -0
  22. kdsource-0.1.99/python/kdsource/_fact_dos_data.py +194 -0
  23. kdsource-0.1.99/python/kdsource/api.py.in +50 -0
  24. kdsource-0.1.99/python/kdsource/config.py.in +121 -0
  25. kdsource-0.1.99/python/kdsource/geom.py +1163 -0
  26. kdsource-0.1.99/python/kdsource/kde.py +357 -0
  27. kdsource-0.1.99/python/kdsource/kdsource.py +923 -0
  28. kdsource-0.1.99/python/kdsource/plist.py +429 -0
  29. kdsource-0.1.99/python/kdsource/resample.py +49 -0
  30. kdsource-0.1.99/python/kdsource/stats.py +265 -0
  31. kdsource-0.1.99/python/kdsource/summary.py +174 -0
  32. kdsource-0.1.99/python/kdsource/surfsource.py +1223 -0
  33. kdsource-0.1.99/python/kdsource/tally.py +507 -0
  34. kdsource-0.1.99/python/kdsource/test.py +140 -0
  35. kdsource-0.1.99/python/kdsource/utils.py +156 -0
  36. kdsource-0.1.99/python/kdsource/writemcpl.py +74 -0
  37. kdsource-0.1.99/third_party/LICENSE_libxml2 +24 -0
  38. kdsource-0.1.99/third_party/libxml2/.editorconfig +11 -0
  39. kdsource-0.1.99/third_party/libxml2/.gitattributes +2 -0
  40. kdsource-0.1.99/third_party/libxml2/.gitignore +70 -0
  41. kdsource-0.1.99/third_party/libxml2/.gitlab-ci.yml +355 -0
  42. kdsource-0.1.99/third_party/libxml2/CMakeLists.txt +840 -0
  43. kdsource-0.1.99/third_party/libxml2/Copyright +24 -0
  44. kdsource-0.1.99/third_party/libxml2/HTMLparser.c +6004 -0
  45. kdsource-0.1.99/third_party/libxml2/HTMLtree.c +1314 -0
  46. kdsource-0.1.99/third_party/libxml2/MAINTAINERS.md +112 -0
  47. kdsource-0.1.99/third_party/libxml2/Makefile.am +234 -0
  48. kdsource-0.1.99/third_party/libxml2/README.md +200 -0
  49. kdsource-0.1.99/third_party/libxml2/README.zOS +212 -0
  50. kdsource-0.1.99/third_party/libxml2/SAX2.c +2842 -0
  51. kdsource-0.1.99/third_party/libxml2/VERSION +1 -0
  52. kdsource-0.1.99/third_party/libxml2/autogen.sh +97 -0
  53. kdsource-0.1.99/third_party/libxml2/buf.c +1156 -0
  54. kdsource-0.1.99/third_party/libxml2/c14n.c +2168 -0
  55. kdsource-0.1.99/third_party/libxml2/catalog.c +3880 -0
  56. kdsource-0.1.99/third_party/libxml2/chvalid.c +174 -0
  57. kdsource-0.1.99/third_party/libxml2/codegen/charset.inc +1223 -0
  58. kdsource-0.1.99/third_party/libxml2/codegen/escape.inc +66 -0
  59. kdsource-0.1.99/third_party/libxml2/codegen/genCharset.py +379 -0
  60. kdsource-0.1.99/third_party/libxml2/codegen/genEscape.py +69 -0
  61. kdsource-0.1.99/third_party/libxml2/codegen/genHtml5Ent.py +170 -0
  62. kdsource-0.1.99/third_party/libxml2/codegen/genHtml5LibTests.py +93 -0
  63. kdsource-0.1.99/third_party/libxml2/codegen/genRanges.py +222 -0
  64. kdsource-0.1.99/third_party/libxml2/codegen/genTestApi.py +285 -0
  65. kdsource-0.1.99/third_party/libxml2/codegen/genUnicode.py +252 -0
  66. kdsource-0.1.99/third_party/libxml2/codegen/html5ent.inc +1607 -0
  67. kdsource-0.1.99/third_party/libxml2/codegen/ranges.def +361 -0
  68. kdsource-0.1.99/third_party/libxml2/codegen/ranges.inc +131 -0
  69. kdsource-0.1.99/third_party/libxml2/codegen/rangetab.py +34 -0
  70. kdsource-0.1.99/third_party/libxml2/codegen/unicode.inc +1473 -0
  71. kdsource-0.1.99/third_party/libxml2/codegen/xmlmod.py +146 -0
  72. kdsource-0.1.99/third_party/libxml2/config.h.cmake.in +35 -0
  73. kdsource-0.1.99/third_party/libxml2/configure.ac +1030 -0
  74. kdsource-0.1.99/third_party/libxml2/debugXML.c +1523 -0
  75. kdsource-0.1.99/third_party/libxml2/dict.c +1026 -0
  76. kdsource-0.1.99/third_party/libxml2/encoding.c +3003 -0
  77. kdsource-0.1.99/third_party/libxml2/entities.c +728 -0
  78. kdsource-0.1.99/third_party/libxml2/error.c +1379 -0
  79. kdsource-0.1.99/third_party/libxml2/example/.gitignore +16 -0
  80. kdsource-0.1.99/third_party/libxml2/example/Makefile.am +44 -0
  81. kdsource-0.1.99/third_party/libxml2/example/gjobread.c +301 -0
  82. kdsource-0.1.99/third_party/libxml2/example/gjobs.xml +57 -0
  83. kdsource-0.1.99/third_party/libxml2/example/icu.c +241 -0
  84. kdsource-0.1.99/third_party/libxml2/example/io1.c +159 -0
  85. kdsource-0.1.99/third_party/libxml2/example/io2.c +58 -0
  86. kdsource-0.1.99/third_party/libxml2/example/meson.build +27 -0
  87. kdsource-0.1.99/third_party/libxml2/example/parse1.c +48 -0
  88. kdsource-0.1.99/third_party/libxml2/example/parse2.c +64 -0
  89. kdsource-0.1.99/third_party/libxml2/example/parse3.c +52 -0
  90. kdsource-0.1.99/third_party/libxml2/example/parse4.c +135 -0
  91. kdsource-0.1.99/third_party/libxml2/example/reader1.c +99 -0
  92. kdsource-0.1.99/third_party/libxml2/example/reader2.c +115 -0
  93. kdsource-0.1.99/third_party/libxml2/example/reader3.c +111 -0
  94. kdsource-0.1.99/third_party/libxml2/example/reader4.c +114 -0
  95. kdsource-0.1.99/third_party/libxml2/example/test1.xml +1 -0
  96. kdsource-0.1.99/third_party/libxml2/example/test2.xml +13 -0
  97. kdsource-0.1.99/third_party/libxml2/example/test3.xml +39 -0
  98. kdsource-0.1.99/third_party/libxml2/example/testWriter.c +1068 -0
  99. kdsource-0.1.99/third_party/libxml2/example/tree1.c +80 -0
  100. kdsource-0.1.99/third_party/libxml2/example/tree2.c +107 -0
  101. kdsource-0.1.99/third_party/libxml2/example/xpath1.c +243 -0
  102. kdsource-0.1.99/third_party/libxml2/example/xpath2.c +183 -0
  103. kdsource-0.1.99/third_party/libxml2/globals.c +1137 -0
  104. kdsource-0.1.99/third_party/libxml2/hash.c +1297 -0
  105. kdsource-0.1.99/third_party/libxml2/include/Makefile.am +5 -0
  106. kdsource-0.1.99/third_party/libxml2/include/libxml/HTMLparser.h +397 -0
  107. kdsource-0.1.99/third_party/libxml2/include/libxml/HTMLtree.h +123 -0
  108. kdsource-0.1.99/third_party/libxml2/include/libxml/Makefile.am +54 -0
  109. kdsource-0.1.99/third_party/libxml2/include/libxml/SAX.h +21 -0
  110. kdsource-0.1.99/third_party/libxml2/include/libxml/SAX2.h +173 -0
  111. kdsource-0.1.99/third_party/libxml2/include/libxml/c14n.h +116 -0
  112. kdsource-0.1.99/third_party/libxml2/include/libxml/catalog.h +210 -0
  113. kdsource-0.1.99/third_party/libxml2/include/libxml/chvalid.h +218 -0
  114. kdsource-0.1.99/third_party/libxml2/include/libxml/debugXML.h +82 -0
  115. kdsource-0.1.99/third_party/libxml2/include/libxml/dict.h +85 -0
  116. kdsource-0.1.99/third_party/libxml2/include/libxml/encoding.h +340 -0
  117. kdsource-0.1.99/third_party/libxml2/include/libxml/entities.h +167 -0
  118. kdsource-0.1.99/third_party/libxml2/include/libxml/globals.h +28 -0
  119. kdsource-0.1.99/third_party/libxml2/include/libxml/hash.h +248 -0
  120. kdsource-0.1.99/third_party/libxml2/include/libxml/list.h +145 -0
  121. kdsource-0.1.99/third_party/libxml2/include/libxml/meson.build +98 -0
  122. kdsource-0.1.99/third_party/libxml2/include/libxml/nanoftp.h +19 -0
  123. kdsource-0.1.99/third_party/libxml2/include/libxml/nanohttp.h +101 -0
  124. kdsource-0.1.99/third_party/libxml2/include/libxml/parser.h +2161 -0
  125. kdsource-0.1.99/third_party/libxml2/include/libxml/parserInternals.h +544 -0
  126. kdsource-0.1.99/third_party/libxml2/include/libxml/pattern.h +104 -0
  127. kdsource-0.1.99/third_party/libxml2/include/libxml/relaxng.h +229 -0
  128. kdsource-0.1.99/third_party/libxml2/include/libxml/schemasInternals.h +805 -0
  129. kdsource-0.1.99/third_party/libxml2/include/libxml/schematron.h +151 -0
  130. kdsource-0.1.99/third_party/libxml2/include/libxml/threads.h +80 -0
  131. kdsource-0.1.99/third_party/libxml2/include/libxml/tree.h +1576 -0
  132. kdsource-0.1.99/third_party/libxml2/include/libxml/uri.h +105 -0
  133. kdsource-0.1.99/third_party/libxml2/include/libxml/valid.h +452 -0
  134. kdsource-0.1.99/third_party/libxml2/include/libxml/xinclude.h +122 -0
  135. kdsource-0.1.99/third_party/libxml2/include/libxml/xlink.h +197 -0
  136. kdsource-0.1.99/third_party/libxml2/include/libxml/xmlIO.h +401 -0
  137. kdsource-0.1.99/third_party/libxml2/include/libxml/xmlautomata.h +164 -0
  138. kdsource-0.1.99/third_party/libxml2/include/libxml/xmlerror.h +1065 -0
  139. kdsource-0.1.99/third_party/libxml2/include/libxml/xmlexports.h +98 -0
  140. kdsource-0.1.99/third_party/libxml2/include/libxml/xmlmemory.h +203 -0
  141. kdsource-0.1.99/third_party/libxml2/include/libxml/xmlmodule.h +60 -0
  142. kdsource-0.1.99/third_party/libxml2/include/libxml/xmlreader.h +450 -0
  143. kdsource-0.1.99/third_party/libxml2/include/libxml/xmlregexp.h +113 -0
  144. kdsource-0.1.99/third_party/libxml2/include/libxml/xmlsave.h +156 -0
  145. kdsource-0.1.99/third_party/libxml2/include/libxml/xmlschemas.h +248 -0
  146. kdsource-0.1.99/third_party/libxml2/include/libxml/xmlschemastypes.h +158 -0
  147. kdsource-0.1.99/third_party/libxml2/include/libxml/xmlstring.h +139 -0
  148. kdsource-0.1.99/third_party/libxml2/include/libxml/xmlunicode.h +18 -0
  149. kdsource-0.1.99/third_party/libxml2/include/libxml/xmlversion.h.in +255 -0
  150. kdsource-0.1.99/third_party/libxml2/include/libxml/xmlwriter.h +489 -0
  151. kdsource-0.1.99/third_party/libxml2/include/libxml/xpath.h +572 -0
  152. kdsource-0.1.99/third_party/libxml2/include/libxml/xpathInternals.h +609 -0
  153. kdsource-0.1.99/third_party/libxml2/include/libxml/xpointer.h +52 -0
  154. kdsource-0.1.99/third_party/libxml2/include/meson.build +2 -0
  155. kdsource-0.1.99/third_party/libxml2/include/private/Makefile.am +20 -0
  156. kdsource-0.1.99/third_party/libxml2/include/private/buf.h +45 -0
  157. kdsource-0.1.99/third_party/libxml2/include/private/cata.h +13 -0
  158. kdsource-0.1.99/third_party/libxml2/include/private/dict.h +74 -0
  159. kdsource-0.1.99/third_party/libxml2/include/private/enc.h +19 -0
  160. kdsource-0.1.99/third_party/libxml2/include/private/entities.h +24 -0
  161. kdsource-0.1.99/third_party/libxml2/include/private/error.h +46 -0
  162. kdsource-0.1.99/third_party/libxml2/include/private/globals.h +15 -0
  163. kdsource-0.1.99/third_party/libxml2/include/private/html.h +38 -0
  164. kdsource-0.1.99/third_party/libxml2/include/private/io.h +61 -0
  165. kdsource-0.1.99/third_party/libxml2/include/private/lint.h +15 -0
  166. kdsource-0.1.99/third_party/libxml2/include/private/memory.h +57 -0
  167. kdsource-0.1.99/third_party/libxml2/include/private/parser.h +182 -0
  168. kdsource-0.1.99/third_party/libxml2/include/private/regexp.h +26 -0
  169. kdsource-0.1.99/third_party/libxml2/include/private/save.h +24 -0
  170. kdsource-0.1.99/third_party/libxml2/include/private/string.h +13 -0
  171. kdsource-0.1.99/third_party/libxml2/include/private/threads.h +83 -0
  172. kdsource-0.1.99/third_party/libxml2/include/private/tree.h +26 -0
  173. kdsource-0.1.99/third_party/libxml2/include/private/xinclude.h +9 -0
  174. kdsource-0.1.99/third_party/libxml2/include/private/xpath.h +16 -0
  175. kdsource-0.1.99/third_party/libxml2/libxml-2.0.pc.in +12 -0
  176. kdsource-0.1.99/third_party/libxml2/libxml.h +107 -0
  177. kdsource-0.1.99/third_party/libxml2/libxml.m4 +16 -0
  178. kdsource-0.1.99/third_party/libxml2/libxml2-config.cmake.cmake.in +155 -0
  179. kdsource-0.1.99/third_party/libxml2/libxml2-config.cmake.in +134 -0
  180. kdsource-0.1.99/third_party/libxml2/libxml2.doap +40 -0
  181. kdsource-0.1.99/third_party/libxml2/lintmain.c +14 -0
  182. kdsource-0.1.99/third_party/libxml2/list.c +710 -0
  183. kdsource-0.1.99/third_party/libxml2/m4/ax_gcc_func_attribute.m4 +242 -0
  184. kdsource-0.1.99/third_party/libxml2/m4/ax_recursive_eval.m4 +56 -0
  185. kdsource-0.1.99/third_party/libxml2/meson.build +663 -0
  186. kdsource-0.1.99/third_party/libxml2/meson_options.txt +170 -0
  187. kdsource-0.1.99/third_party/libxml2/nanohttp.c +307 -0
  188. kdsource-0.1.99/third_party/libxml2/parser.c +13719 -0
  189. kdsource-0.1.99/third_party/libxml2/parserInternals.c +3748 -0
  190. kdsource-0.1.99/third_party/libxml2/pattern.c +2359 -0
  191. kdsource-0.1.99/third_party/libxml2/relaxng.c +10760 -0
  192. kdsource-0.1.99/third_party/libxml2/run_and_diff.cmake +44 -0
  193. kdsource-0.1.99/third_party/libxml2/runsuite.c +1353 -0
  194. kdsource-0.1.99/third_party/libxml2/runtest.c +5775 -0
  195. kdsource-0.1.99/third_party/libxml2/runxmlconf.c +613 -0
  196. kdsource-0.1.99/third_party/libxml2/schematron.c +2014 -0
  197. kdsource-0.1.99/third_party/libxml2/shell.c +1598 -0
  198. kdsource-0.1.99/third_party/libxml2/testModule.c +84 -0
  199. kdsource-0.1.99/third_party/libxml2/test_xmlcatalog_add_del.cmake +35 -0
  200. kdsource-0.1.99/third_party/libxml2/testapi.c +1404 -0
  201. kdsource-0.1.99/third_party/libxml2/testcatalog.c +96 -0
  202. kdsource-0.1.99/third_party/libxml2/testchar.c +1017 -0
  203. kdsource-0.1.99/third_party/libxml2/testdict.c +817 -0
  204. kdsource-0.1.99/third_party/libxml2/testdso.c +12 -0
  205. kdsource-0.1.99/third_party/libxml2/testlimits.c +1285 -0
  206. kdsource-0.1.99/third_party/libxml2/testparser.c +1864 -0
  207. kdsource-0.1.99/third_party/libxml2/testrecurse.c +930 -0
  208. kdsource-0.1.99/third_party/libxml2/threads.c +518 -0
  209. kdsource-0.1.99/third_party/libxml2/timsort.h +603 -0
  210. kdsource-0.1.99/third_party/libxml2/tree.c +8901 -0
  211. kdsource-0.1.99/third_party/libxml2/uri.c +2781 -0
  212. kdsource-0.1.99/third_party/libxml2/valid.c +6563 -0
  213. kdsource-0.1.99/third_party/libxml2/win32/libxml2.rc +36 -0
  214. kdsource-0.1.99/third_party/libxml2/xinclude.c +2190 -0
  215. kdsource-0.1.99/third_party/libxml2/xlink.c +165 -0
  216. kdsource-0.1.99/third_party/libxml2/xml2-config-meson +56 -0
  217. kdsource-0.1.99/third_party/libxml2/xml2-config.in +108 -0
  218. kdsource-0.1.99/third_party/libxml2/xmlIO.c +2908 -0
  219. kdsource-0.1.99/third_party/libxml2/xmlcatalog.c +669 -0
  220. kdsource-0.1.99/third_party/libxml2/xmllint.c +3412 -0
  221. kdsource-0.1.99/third_party/libxml2/xmlmemory.c +516 -0
  222. kdsource-0.1.99/third_party/libxml2/xmlmodule.c +295 -0
  223. kdsource-0.1.99/third_party/libxml2/xmlreader.c +5405 -0
  224. kdsource-0.1.99/third_party/libxml2/xmlregexp.c +6394 -0
  225. kdsource-0.1.99/third_party/libxml2/xmlsave.c +2681 -0
  226. kdsource-0.1.99/third_party/libxml2/xmlschemas.c +28492 -0
  227. kdsource-0.1.99/third_party/libxml2/xmlschemastypes.c +6129 -0
  228. kdsource-0.1.99/third_party/libxml2/xmlstring.c +1144 -0
  229. kdsource-0.1.99/third_party/libxml2/xmlwriter.c +4576 -0
  230. kdsource-0.1.99/third_party/libxml2/xpath.c +12153 -0
  231. kdsource-0.1.99/third_party/libxml2/xpointer.c +666 -0
  232. kdsource-0.1.99/third_party/libxml2/xstc/fetch-xstc.sh +32 -0
  233. kdsource-0.1.99/third_party/libxml2/xstc/fixup-tests.py +99 -0
@@ -0,0 +1,233 @@
1
+ ##################################################################################
2
+ # #
3
+ # CMake file to be used to install KDSource distribution. #
4
+ # #
5
+ # See README.md file for installation instructions. #
6
+ # #
7
+ # Written 2021 by O. I. Abbate. #
8
+ # Major rewrite 2026 by T. Kittelmann. #
9
+ # #
10
+ ##################################################################################
11
+
12
+ cmake_minimum_required(VERSION 3.26.1...3.31)
13
+
14
+ file(READ "${CMAKE_SOURCE_DIR}/VERSION" PROJECT_VERSION)
15
+ string(STRIP "${PROJECT_VERSION}" PROJECT_VERSION)
16
+
17
+ project(KDSource VERSION "${PROJECT_VERSION}" LANGUAGES C )
18
+
19
+ option( KDS_EMBED_LIBXML2 "Download and embed libxml2 statically" OFF)
20
+ option( KDS_STRICT "Stricter compilation " OFF)
21
+
22
+ ###################################################################
23
+ #Detect sdist generation mode:
24
+ ###################################################################
25
+
26
+ #NB: When generating the sdist, all we want to do is essentially download the
27
+ # libxml2 sources for inclusion.
28
+
29
+ set( KDS_GENERATING_SDIST OFF )
30
+ if ( DEFINED SKBUILD_PROJECT_NAME AND "${SKBUILD_STATE}" STREQUAL "sdist" )
31
+ set( KDS_GENERATING_SDIST ON )
32
+ endif()
33
+
34
+ ###################################################################
35
+ #Find dependencies:
36
+ ###################################################################
37
+
38
+ if ( NOT KDS_EMBED_LIBXML2 )
39
+ if ( NOT KDS_GENERATING_SDIST )
40
+ find_package(LibXml2 REQUIRED)
41
+ endif()
42
+ else()
43
+ # Configure FetchContent for libxml2 and ensure it is a static lib. If running
44
+ # from an sdist, it might already have been fetched into third_party/libxml2.
45
+ set( KDS_LIBXML2SRC "${CMAKE_CURRENT_BINARY_DIR}/kds_third_party_libxml2_src" )
46
+ if ( DEFINED SKBUILD_PROJECT_NAME )
47
+ set( KDS_LIBXML2SRC "${CMAKE_CURRENT_SOURCE_DIR}/third_party/libxml2" )
48
+ endif()
49
+ if ( NOT EXISTS "${KDS_LIBXML2SRC}/CMakeLists.txt" )
50
+ include(FetchContent)
51
+ FetchContent_Populate(
52
+ libxml2
53
+ #Use our own patched version, for a leaner build and to avoid installing
54
+ #system libxml2 binaries into the wheel.
55
+ URL https://github.com/KDSource/libxml2/archive/refs/tags/v2.15.3_kdsource_patch1.tar.gz
56
+ URL_HASH SHA256=f422b40be3b99356bf9d397c9657a1a05ce223dc6c898af8857e827297ff036f
57
+ SOURCE_DIR "${KDS_LIBXML2SRC}"
58
+ )
59
+ endif()
60
+ if ( NOT KDS_GENERATING_SDIST )
61
+ set(KDS_OLD_BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS})
62
+ set(BUILD_SHARED_LIBS OFF)
63
+ add_subdirectory("${KDS_LIBXML2SRC}")
64
+ set(BUILD_SHARED_LIBS ${KDS_OLD_BUILD_SHARED_LIBS})
65
+ endif()
66
+ endif()
67
+
68
+ if ( KDS_GENERATING_SDIST )
69
+ #sdist generation does not need anything else
70
+ return()
71
+ endif()
72
+
73
+ if( NOT DEFINED "MCPL_DIR" )
74
+ #Need to invoke "mcpl-config --show cmakedir" if we want to be able to
75
+ #work with mcpl-core installed via python wheels:
76
+ execute_process(
77
+ COMMAND mcpl-config --show cmakedir
78
+ OUTPUT_VARIABLE "MCPL_DIR" OUTPUT_STRIP_TRAILING_WHITESPACE
79
+ )
80
+ endif()
81
+ find_package(MCPL REQUIRED)
82
+
83
+ ###################################################################
84
+ #Prepare autogen dir for processed files (possibly in-source if building via
85
+ #python tools)
86
+ ###################################################################
87
+
88
+ set( kdsc_autogendir "${CMAKE_CURRENT_BINARY_DIR}/kdsc_autogen" )
89
+
90
+ #Always cleanup autogendir
91
+ if ( IS_DIRECTORY "${kdsc_autogendir}" )
92
+ message( STATUS "Cleaning out existing ${kdsc_autogendir}" )
93
+ file( REMOVE_RECURSE "${kdsc_autogendir}" )
94
+ endif()
95
+ file( MAKE_DIRECTORY "${kdsc_autogendir}" )
96
+
97
+ ###################################################################
98
+ #Find source files and prepare in autogen dir, including
99
+ #processed .in files:
100
+ ###################################################################
101
+
102
+ #On windows DLL's must be in %PATH% so we put them in bin (same as seems to be
103
+ #the way most packages do it on conda-forge). For wheels we will place the
104
+ #mcpl.dll into the scripts folder, since that seems to be the only way to get
105
+ #the dll onto the PATH. The following variable decides if ultimately placing
106
+ #.dll in wheel scripts (boolean value should here be "1" or "" due to
107
+ #configure_file usage):
108
+ set( kds_skbuild_shlib_in_wheel_scripts "" )
109
+ if ( WIN32 AND DEFINED SKBUILD_PROJECT_NAME )
110
+ set( kds_skbuild_shlib_in_wheel_scripts "1" )
111
+ endif()
112
+
113
+ set( KDS_PYMODNAME "kdsource" )
114
+
115
+ file(GLOB KDS_C CONFIGURE_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/clib/src/*.c")
116
+ file(GLOB KDS_H CONFIGURE_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/clib/include/kdsource/*.h")
117
+ file(GLOB KDS_HIN CONFIGURE_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/clib/include/kdsource/*.h.in")
118
+ file(GLOB KDS_PY CONFIGURE_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/python/${KDS_PYMODNAME}/*.py")
119
+ file(GLOB KDS_PYIN CONFIGURE_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/python/${KDS_PYMODNAME}/*.py.in")
120
+
121
+ set( t1 "1000000 * ${PROJECT_VERSION_MAJOR}" )
122
+ set( t2 "1000 * ${PROJECT_VERSION_MINOR}" )
123
+ set( t3 "${PROJECT_VERSION_PATCH}" )
124
+ math(EXPR "${PROJECT_NAME}_version_int" "(${t1})+(${t2})+(${t3})" )
125
+
126
+ file( COPY ${KDS_PY} DESTINATION "${kdsc_autogendir}/python/kdsource/" )
127
+ foreach( infile ${KDS_PYIN} )
128
+ get_filename_component(infilebn "${infile}" NAME_WE)
129
+ configure_file(
130
+ "${infile}"
131
+ "${kdsc_autogendir}/python/kdsource/${infilebn}.py"
132
+ @ONLY
133
+ )
134
+ endforeach()
135
+
136
+ file( COPY ${KDS_C} DESTINATION "${kdsc_autogendir}/clib/src" )
137
+ file( COPY ${KDS_H} DESTINATION "${kdsc_autogendir}/clib/include/kdsource" )
138
+ foreach( infile ${KDS_HIN} )
139
+ get_filename_component( infilebn "${infile}" NAME_WE )
140
+ configure_file(
141
+ "${infile}"
142
+ "${kdsc_autogendir}/clib/include/kdsource/${infilebn}.h"
143
+ @ONLY
144
+ )
145
+ endforeach()
146
+
147
+ ###################################################################
148
+ # Installation destinations:
149
+ ###################################################################
150
+
151
+ include(GNUInstallDirs)
152
+ if ( DEFINED SKBUILD_PROJECT_NAME )
153
+ message( STATUS "scikit-build mode detected: clib will be placed in python module." )
154
+ set( KDS_INSTALL_LIBDIR "${KDS_PYMODNAME}/data/lib" )
155
+ set( KDS_INSTALL_INCLUDEDIR "${KDS_PYMODNAME}/data/include" )
156
+ else()
157
+ set( KDS_INSTALL_LIBDIR "${CMAKE_INSTALL_LIBDIR}" )
158
+ set( KDS_INSTALL_INCLUDEDIR "${CMAKE_INSTALL_INCLUDEDIR}" )
159
+ endif()
160
+
161
+ if ( kds_skbuild_shlib_in_wheel_scripts )
162
+ set( KDS_INSTALL_SHLIBDIR "${SKBUILD_SCRIPTS_DIR}" )
163
+ else()
164
+ #sane standard world
165
+ set( KDS_INSTALL_SHLIBDIR "${KDS_INSTALL_LIBDIR}" )
166
+ endif()
167
+
168
+ ###################################################################
169
+ # Build library (entirely from autogendir)
170
+ ###################################################################
171
+
172
+ file(GLOB KDS_SOURCES CONFIGURE_DEPENDS "${kdsc_autogendir}/clib/src/*.c")
173
+ file(GLOB KDS_HEADERS CONFIGURE_DEPENDS "${kdsc_autogendir}/clib/include/kdsource/*.h")
174
+
175
+ add_library(kdsource SHARED ${KDS_SOURCES} )
176
+
177
+ set_target_properties(
178
+ kdsource
179
+ PROPERTIES C_STANDARD 99
180
+ C_STANDARD_REQUIRED ON C_EXTENSIONS OFF
181
+ )
182
+
183
+ target_include_directories(
184
+ kdsource
185
+ PRIVATE "${kdsc_autogendir}/clib/src"
186
+ PUBLIC
187
+ $<BUILD_INTERFACE:${kdsc_autogendir}/clib/include>
188
+ $<INSTALL_INTERFACE:${KDS_INCLUDEDIR}>
189
+ )
190
+
191
+ target_link_libraries(
192
+ kdsource
193
+ PUBLIC LibXml2::LibXml2 MCPL::MCPL
194
+ )
195
+
196
+ if ( WIN32 )
197
+ set_target_properties( kdsource PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS TRUE )
198
+ endif()
199
+
200
+ install(
201
+ FILES ${KDS_HEADERS}
202
+ DESTINATION "${KDS_INSTALL_INCLUDEDIR}/kdsource/"
203
+ )
204
+
205
+ if ( KDS_STRICT )
206
+ if ( MSVC )
207
+ #/disable warning 4996 for now, since it will require rewriting the sscanf
208
+ #usage.
209
+ target_compile_options( kdsource PRIVATE /WX /W4 /wd4996 )
210
+ else()
211
+ target_compile_options(
212
+ kdsource PRIVATE -Wall -Wextra -Wpedantic -Wshadow -Wformat=2
213
+ -Wconversion -Wsign-conversion -Wnull-dereference -Werror
214
+ )
215
+ endif()
216
+ endif()
217
+
218
+ install(
219
+ TARGETS kdsource
220
+ RUNTIME DESTINATION "${KDS_INSTALL_SHLIBDIR}"
221
+ ARCHIVE DESTINATION "${KDS_INSTALL_LIBDIR}"
222
+ LIBRARY DESTINATION "${KDS_INSTALL_LIBDIR}"
223
+ )
224
+
225
+
226
+ ###################################################################
227
+ # Install python modules (only if building a wheel)
228
+ ###################################################################
229
+
230
+ if ( DEFINED SKBUILD_PROJECT_NAME )
231
+ file( GLOB KDS_PYWHL CONFIGURE_DEPENDS "${kdsc_autogendir}/python/${KDS_PYMODNAME}/*.py" )
232
+ install( FILES ${KDS_PYWHL} DESTINATION "${SKBUILD_PLATLIB_DIR}/${KDS_PYMODNAME}" )
233
+ endif()