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.
- kdsource-0.1.99/CMakeLists.txt +233 -0
- kdsource-0.1.99/LICENSE +674 -0
- kdsource-0.1.99/PKG-INFO +109 -0
- kdsource-0.1.99/README.md +78 -0
- kdsource-0.1.99/VERSION +1 -0
- kdsource-0.1.99/clib/include/kdsource/geom.h +99 -0
- kdsource-0.1.99/clib/include/kdsource/kdsource.h.in +88 -0
- kdsource-0.1.99/clib/include/kdsource/plist.h +43 -0
- kdsource-0.1.99/clib/include/kdsource/utils.h +40 -0
- kdsource-0.1.99/clib/src/geom.c +637 -0
- kdsource-0.1.99/clib/src/kdsource.c +467 -0
- kdsource-0.1.99/clib/src/plist.c +117 -0
- kdsource-0.1.99/clib/src/resamplemcpl.c +29 -0
- kdsource-0.1.99/clib/src/utils.c +225 -0
- kdsource-0.1.99/clib/src/writemcpl.c +69 -0
- kdsource-0.1.99/pyproject.toml +74 -0
- kdsource-0.1.99/python/kdsource/__init__.py.in +40 -0
- kdsource-0.1.99/python/kdsource/_chooks.py +101 -0
- kdsource-0.1.99/python/kdsource/_chooks_loadlib.py +34 -0
- kdsource-0.1.99/python/kdsource/_cli_config.py +55 -0
- kdsource-0.1.99/python/kdsource/_cli_resample.py +38 -0
- kdsource-0.1.99/python/kdsource/_fact_dos_data.py +194 -0
- kdsource-0.1.99/python/kdsource/api.py.in +50 -0
- kdsource-0.1.99/python/kdsource/config.py.in +121 -0
- kdsource-0.1.99/python/kdsource/geom.py +1163 -0
- kdsource-0.1.99/python/kdsource/kde.py +357 -0
- kdsource-0.1.99/python/kdsource/kdsource.py +923 -0
- kdsource-0.1.99/python/kdsource/plist.py +429 -0
- kdsource-0.1.99/python/kdsource/resample.py +49 -0
- kdsource-0.1.99/python/kdsource/stats.py +265 -0
- kdsource-0.1.99/python/kdsource/summary.py +174 -0
- kdsource-0.1.99/python/kdsource/surfsource.py +1223 -0
- kdsource-0.1.99/python/kdsource/tally.py +507 -0
- kdsource-0.1.99/python/kdsource/test.py +140 -0
- kdsource-0.1.99/python/kdsource/utils.py +156 -0
- kdsource-0.1.99/python/kdsource/writemcpl.py +74 -0
- kdsource-0.1.99/third_party/LICENSE_libxml2 +24 -0
- kdsource-0.1.99/third_party/libxml2/.editorconfig +11 -0
- kdsource-0.1.99/third_party/libxml2/.gitattributes +2 -0
- kdsource-0.1.99/third_party/libxml2/.gitignore +70 -0
- kdsource-0.1.99/third_party/libxml2/.gitlab-ci.yml +355 -0
- kdsource-0.1.99/third_party/libxml2/CMakeLists.txt +840 -0
- kdsource-0.1.99/third_party/libxml2/Copyright +24 -0
- kdsource-0.1.99/third_party/libxml2/HTMLparser.c +6004 -0
- kdsource-0.1.99/third_party/libxml2/HTMLtree.c +1314 -0
- kdsource-0.1.99/third_party/libxml2/MAINTAINERS.md +112 -0
- kdsource-0.1.99/third_party/libxml2/Makefile.am +234 -0
- kdsource-0.1.99/third_party/libxml2/README.md +200 -0
- kdsource-0.1.99/third_party/libxml2/README.zOS +212 -0
- kdsource-0.1.99/third_party/libxml2/SAX2.c +2842 -0
- kdsource-0.1.99/third_party/libxml2/VERSION +1 -0
- kdsource-0.1.99/third_party/libxml2/autogen.sh +97 -0
- kdsource-0.1.99/third_party/libxml2/buf.c +1156 -0
- kdsource-0.1.99/third_party/libxml2/c14n.c +2168 -0
- kdsource-0.1.99/third_party/libxml2/catalog.c +3880 -0
- kdsource-0.1.99/third_party/libxml2/chvalid.c +174 -0
- kdsource-0.1.99/third_party/libxml2/codegen/charset.inc +1223 -0
- kdsource-0.1.99/third_party/libxml2/codegen/escape.inc +66 -0
- kdsource-0.1.99/third_party/libxml2/codegen/genCharset.py +379 -0
- kdsource-0.1.99/third_party/libxml2/codegen/genEscape.py +69 -0
- kdsource-0.1.99/third_party/libxml2/codegen/genHtml5Ent.py +170 -0
- kdsource-0.1.99/third_party/libxml2/codegen/genHtml5LibTests.py +93 -0
- kdsource-0.1.99/third_party/libxml2/codegen/genRanges.py +222 -0
- kdsource-0.1.99/third_party/libxml2/codegen/genTestApi.py +285 -0
- kdsource-0.1.99/third_party/libxml2/codegen/genUnicode.py +252 -0
- kdsource-0.1.99/third_party/libxml2/codegen/html5ent.inc +1607 -0
- kdsource-0.1.99/third_party/libxml2/codegen/ranges.def +361 -0
- kdsource-0.1.99/third_party/libxml2/codegen/ranges.inc +131 -0
- kdsource-0.1.99/third_party/libxml2/codegen/rangetab.py +34 -0
- kdsource-0.1.99/third_party/libxml2/codegen/unicode.inc +1473 -0
- kdsource-0.1.99/third_party/libxml2/codegen/xmlmod.py +146 -0
- kdsource-0.1.99/third_party/libxml2/config.h.cmake.in +35 -0
- kdsource-0.1.99/third_party/libxml2/configure.ac +1030 -0
- kdsource-0.1.99/third_party/libxml2/debugXML.c +1523 -0
- kdsource-0.1.99/third_party/libxml2/dict.c +1026 -0
- kdsource-0.1.99/third_party/libxml2/encoding.c +3003 -0
- kdsource-0.1.99/third_party/libxml2/entities.c +728 -0
- kdsource-0.1.99/third_party/libxml2/error.c +1379 -0
- kdsource-0.1.99/third_party/libxml2/example/.gitignore +16 -0
- kdsource-0.1.99/third_party/libxml2/example/Makefile.am +44 -0
- kdsource-0.1.99/third_party/libxml2/example/gjobread.c +301 -0
- kdsource-0.1.99/third_party/libxml2/example/gjobs.xml +57 -0
- kdsource-0.1.99/third_party/libxml2/example/icu.c +241 -0
- kdsource-0.1.99/third_party/libxml2/example/io1.c +159 -0
- kdsource-0.1.99/third_party/libxml2/example/io2.c +58 -0
- kdsource-0.1.99/third_party/libxml2/example/meson.build +27 -0
- kdsource-0.1.99/third_party/libxml2/example/parse1.c +48 -0
- kdsource-0.1.99/third_party/libxml2/example/parse2.c +64 -0
- kdsource-0.1.99/third_party/libxml2/example/parse3.c +52 -0
- kdsource-0.1.99/third_party/libxml2/example/parse4.c +135 -0
- kdsource-0.1.99/third_party/libxml2/example/reader1.c +99 -0
- kdsource-0.1.99/third_party/libxml2/example/reader2.c +115 -0
- kdsource-0.1.99/third_party/libxml2/example/reader3.c +111 -0
- kdsource-0.1.99/third_party/libxml2/example/reader4.c +114 -0
- kdsource-0.1.99/third_party/libxml2/example/test1.xml +1 -0
- kdsource-0.1.99/third_party/libxml2/example/test2.xml +13 -0
- kdsource-0.1.99/third_party/libxml2/example/test3.xml +39 -0
- kdsource-0.1.99/third_party/libxml2/example/testWriter.c +1068 -0
- kdsource-0.1.99/third_party/libxml2/example/tree1.c +80 -0
- kdsource-0.1.99/third_party/libxml2/example/tree2.c +107 -0
- kdsource-0.1.99/third_party/libxml2/example/xpath1.c +243 -0
- kdsource-0.1.99/third_party/libxml2/example/xpath2.c +183 -0
- kdsource-0.1.99/third_party/libxml2/globals.c +1137 -0
- kdsource-0.1.99/third_party/libxml2/hash.c +1297 -0
- kdsource-0.1.99/third_party/libxml2/include/Makefile.am +5 -0
- kdsource-0.1.99/third_party/libxml2/include/libxml/HTMLparser.h +397 -0
- kdsource-0.1.99/third_party/libxml2/include/libxml/HTMLtree.h +123 -0
- kdsource-0.1.99/third_party/libxml2/include/libxml/Makefile.am +54 -0
- kdsource-0.1.99/third_party/libxml2/include/libxml/SAX.h +21 -0
- kdsource-0.1.99/third_party/libxml2/include/libxml/SAX2.h +173 -0
- kdsource-0.1.99/third_party/libxml2/include/libxml/c14n.h +116 -0
- kdsource-0.1.99/third_party/libxml2/include/libxml/catalog.h +210 -0
- kdsource-0.1.99/third_party/libxml2/include/libxml/chvalid.h +218 -0
- kdsource-0.1.99/third_party/libxml2/include/libxml/debugXML.h +82 -0
- kdsource-0.1.99/third_party/libxml2/include/libxml/dict.h +85 -0
- kdsource-0.1.99/third_party/libxml2/include/libxml/encoding.h +340 -0
- kdsource-0.1.99/third_party/libxml2/include/libxml/entities.h +167 -0
- kdsource-0.1.99/third_party/libxml2/include/libxml/globals.h +28 -0
- kdsource-0.1.99/third_party/libxml2/include/libxml/hash.h +248 -0
- kdsource-0.1.99/third_party/libxml2/include/libxml/list.h +145 -0
- kdsource-0.1.99/third_party/libxml2/include/libxml/meson.build +98 -0
- kdsource-0.1.99/third_party/libxml2/include/libxml/nanoftp.h +19 -0
- kdsource-0.1.99/third_party/libxml2/include/libxml/nanohttp.h +101 -0
- kdsource-0.1.99/third_party/libxml2/include/libxml/parser.h +2161 -0
- kdsource-0.1.99/third_party/libxml2/include/libxml/parserInternals.h +544 -0
- kdsource-0.1.99/third_party/libxml2/include/libxml/pattern.h +104 -0
- kdsource-0.1.99/third_party/libxml2/include/libxml/relaxng.h +229 -0
- kdsource-0.1.99/third_party/libxml2/include/libxml/schemasInternals.h +805 -0
- kdsource-0.1.99/third_party/libxml2/include/libxml/schematron.h +151 -0
- kdsource-0.1.99/third_party/libxml2/include/libxml/threads.h +80 -0
- kdsource-0.1.99/third_party/libxml2/include/libxml/tree.h +1576 -0
- kdsource-0.1.99/third_party/libxml2/include/libxml/uri.h +105 -0
- kdsource-0.1.99/third_party/libxml2/include/libxml/valid.h +452 -0
- kdsource-0.1.99/third_party/libxml2/include/libxml/xinclude.h +122 -0
- kdsource-0.1.99/third_party/libxml2/include/libxml/xlink.h +197 -0
- kdsource-0.1.99/third_party/libxml2/include/libxml/xmlIO.h +401 -0
- kdsource-0.1.99/third_party/libxml2/include/libxml/xmlautomata.h +164 -0
- kdsource-0.1.99/third_party/libxml2/include/libxml/xmlerror.h +1065 -0
- kdsource-0.1.99/third_party/libxml2/include/libxml/xmlexports.h +98 -0
- kdsource-0.1.99/third_party/libxml2/include/libxml/xmlmemory.h +203 -0
- kdsource-0.1.99/third_party/libxml2/include/libxml/xmlmodule.h +60 -0
- kdsource-0.1.99/third_party/libxml2/include/libxml/xmlreader.h +450 -0
- kdsource-0.1.99/third_party/libxml2/include/libxml/xmlregexp.h +113 -0
- kdsource-0.1.99/third_party/libxml2/include/libxml/xmlsave.h +156 -0
- kdsource-0.1.99/third_party/libxml2/include/libxml/xmlschemas.h +248 -0
- kdsource-0.1.99/third_party/libxml2/include/libxml/xmlschemastypes.h +158 -0
- kdsource-0.1.99/third_party/libxml2/include/libxml/xmlstring.h +139 -0
- kdsource-0.1.99/third_party/libxml2/include/libxml/xmlunicode.h +18 -0
- kdsource-0.1.99/third_party/libxml2/include/libxml/xmlversion.h.in +255 -0
- kdsource-0.1.99/third_party/libxml2/include/libxml/xmlwriter.h +489 -0
- kdsource-0.1.99/third_party/libxml2/include/libxml/xpath.h +572 -0
- kdsource-0.1.99/third_party/libxml2/include/libxml/xpathInternals.h +609 -0
- kdsource-0.1.99/third_party/libxml2/include/libxml/xpointer.h +52 -0
- kdsource-0.1.99/third_party/libxml2/include/meson.build +2 -0
- kdsource-0.1.99/third_party/libxml2/include/private/Makefile.am +20 -0
- kdsource-0.1.99/third_party/libxml2/include/private/buf.h +45 -0
- kdsource-0.1.99/third_party/libxml2/include/private/cata.h +13 -0
- kdsource-0.1.99/third_party/libxml2/include/private/dict.h +74 -0
- kdsource-0.1.99/third_party/libxml2/include/private/enc.h +19 -0
- kdsource-0.1.99/third_party/libxml2/include/private/entities.h +24 -0
- kdsource-0.1.99/third_party/libxml2/include/private/error.h +46 -0
- kdsource-0.1.99/third_party/libxml2/include/private/globals.h +15 -0
- kdsource-0.1.99/third_party/libxml2/include/private/html.h +38 -0
- kdsource-0.1.99/third_party/libxml2/include/private/io.h +61 -0
- kdsource-0.1.99/third_party/libxml2/include/private/lint.h +15 -0
- kdsource-0.1.99/third_party/libxml2/include/private/memory.h +57 -0
- kdsource-0.1.99/third_party/libxml2/include/private/parser.h +182 -0
- kdsource-0.1.99/third_party/libxml2/include/private/regexp.h +26 -0
- kdsource-0.1.99/third_party/libxml2/include/private/save.h +24 -0
- kdsource-0.1.99/third_party/libxml2/include/private/string.h +13 -0
- kdsource-0.1.99/third_party/libxml2/include/private/threads.h +83 -0
- kdsource-0.1.99/third_party/libxml2/include/private/tree.h +26 -0
- kdsource-0.1.99/third_party/libxml2/include/private/xinclude.h +9 -0
- kdsource-0.1.99/third_party/libxml2/include/private/xpath.h +16 -0
- kdsource-0.1.99/third_party/libxml2/libxml-2.0.pc.in +12 -0
- kdsource-0.1.99/third_party/libxml2/libxml.h +107 -0
- kdsource-0.1.99/third_party/libxml2/libxml.m4 +16 -0
- kdsource-0.1.99/third_party/libxml2/libxml2-config.cmake.cmake.in +155 -0
- kdsource-0.1.99/third_party/libxml2/libxml2-config.cmake.in +134 -0
- kdsource-0.1.99/third_party/libxml2/libxml2.doap +40 -0
- kdsource-0.1.99/third_party/libxml2/lintmain.c +14 -0
- kdsource-0.1.99/third_party/libxml2/list.c +710 -0
- kdsource-0.1.99/third_party/libxml2/m4/ax_gcc_func_attribute.m4 +242 -0
- kdsource-0.1.99/third_party/libxml2/m4/ax_recursive_eval.m4 +56 -0
- kdsource-0.1.99/third_party/libxml2/meson.build +663 -0
- kdsource-0.1.99/third_party/libxml2/meson_options.txt +170 -0
- kdsource-0.1.99/third_party/libxml2/nanohttp.c +307 -0
- kdsource-0.1.99/third_party/libxml2/parser.c +13719 -0
- kdsource-0.1.99/third_party/libxml2/parserInternals.c +3748 -0
- kdsource-0.1.99/third_party/libxml2/pattern.c +2359 -0
- kdsource-0.1.99/third_party/libxml2/relaxng.c +10760 -0
- kdsource-0.1.99/third_party/libxml2/run_and_diff.cmake +44 -0
- kdsource-0.1.99/third_party/libxml2/runsuite.c +1353 -0
- kdsource-0.1.99/third_party/libxml2/runtest.c +5775 -0
- kdsource-0.1.99/third_party/libxml2/runxmlconf.c +613 -0
- kdsource-0.1.99/third_party/libxml2/schematron.c +2014 -0
- kdsource-0.1.99/third_party/libxml2/shell.c +1598 -0
- kdsource-0.1.99/third_party/libxml2/testModule.c +84 -0
- kdsource-0.1.99/third_party/libxml2/test_xmlcatalog_add_del.cmake +35 -0
- kdsource-0.1.99/third_party/libxml2/testapi.c +1404 -0
- kdsource-0.1.99/third_party/libxml2/testcatalog.c +96 -0
- kdsource-0.1.99/third_party/libxml2/testchar.c +1017 -0
- kdsource-0.1.99/third_party/libxml2/testdict.c +817 -0
- kdsource-0.1.99/third_party/libxml2/testdso.c +12 -0
- kdsource-0.1.99/third_party/libxml2/testlimits.c +1285 -0
- kdsource-0.1.99/third_party/libxml2/testparser.c +1864 -0
- kdsource-0.1.99/third_party/libxml2/testrecurse.c +930 -0
- kdsource-0.1.99/third_party/libxml2/threads.c +518 -0
- kdsource-0.1.99/third_party/libxml2/timsort.h +603 -0
- kdsource-0.1.99/third_party/libxml2/tree.c +8901 -0
- kdsource-0.1.99/third_party/libxml2/uri.c +2781 -0
- kdsource-0.1.99/third_party/libxml2/valid.c +6563 -0
- kdsource-0.1.99/third_party/libxml2/win32/libxml2.rc +36 -0
- kdsource-0.1.99/third_party/libxml2/xinclude.c +2190 -0
- kdsource-0.1.99/third_party/libxml2/xlink.c +165 -0
- kdsource-0.1.99/third_party/libxml2/xml2-config-meson +56 -0
- kdsource-0.1.99/third_party/libxml2/xml2-config.in +108 -0
- kdsource-0.1.99/third_party/libxml2/xmlIO.c +2908 -0
- kdsource-0.1.99/third_party/libxml2/xmlcatalog.c +669 -0
- kdsource-0.1.99/third_party/libxml2/xmllint.c +3412 -0
- kdsource-0.1.99/third_party/libxml2/xmlmemory.c +516 -0
- kdsource-0.1.99/third_party/libxml2/xmlmodule.c +295 -0
- kdsource-0.1.99/third_party/libxml2/xmlreader.c +5405 -0
- kdsource-0.1.99/third_party/libxml2/xmlregexp.c +6394 -0
- kdsource-0.1.99/third_party/libxml2/xmlsave.c +2681 -0
- kdsource-0.1.99/third_party/libxml2/xmlschemas.c +28492 -0
- kdsource-0.1.99/third_party/libxml2/xmlschemastypes.c +6129 -0
- kdsource-0.1.99/third_party/libxml2/xmlstring.c +1144 -0
- kdsource-0.1.99/third_party/libxml2/xmlwriter.c +4576 -0
- kdsource-0.1.99/third_party/libxml2/xpath.c +12153 -0
- kdsource-0.1.99/third_party/libxml2/xpointer.c +666 -0
- kdsource-0.1.99/third_party/libxml2/xstc/fetch-xstc.sh +32 -0
- 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()
|