feat(sdk): scaffold KCSDK library + kcsdk pybind11 module #350

Closed
opened 2026-02-27 19:30:05 +00:00 by forbes · 0 comments
Owner

Goal

Empty module compiles, links, installs, and import kcsdk succeeds.

New files

  • src/Gui/SDK/KCSDKGlobal.h — DLL export macros (pattern from KCSolveGlobal.h)
  • src/Gui/SDK/SDKRegistry.h — Empty singleton with instance(), mutex, API_VERSION_MAJOR = 1
  • src/Gui/SDK/SDKRegistry.cpp — Singleton implementation
  • src/Gui/SDK/CMakeLists.txt — Builds KCSDK shared library, links FreeCADGui, FreeCADBase
  • src/Gui/SDK/bindings/kcsdk_py.cppPYBIND11_MODULE(kcsdk, m) exposing API_VERSION_MAJOR
  • src/Gui/SDK/bindings/CMakeLists.txt — Builds kcsdk pybind11 module

Modified files

  • src/Gui/CMakeLists.txt — Add add_subdirectory(SDK)
  • src/Mod/Create/CMakeLists.txt — Add kcsdk install rule

Verification

pixi run configure && pixi run build && python -c "import kcsdk; print(kcsdk.API_VERSION_MAJOR)"

Part of the KCSDK epic (#346). Phase 1 of 8.

## Goal Empty module compiles, links, installs, and `import kcsdk` succeeds. ## New files - `src/Gui/SDK/KCSDKGlobal.h` — DLL export macros (pattern from `KCSolveGlobal.h`) - `src/Gui/SDK/SDKRegistry.h` — Empty singleton with `instance()`, mutex, `API_VERSION_MAJOR = 1` - `src/Gui/SDK/SDKRegistry.cpp` — Singleton implementation - `src/Gui/SDK/CMakeLists.txt` — Builds `KCSDK` shared library, links `FreeCADGui`, `FreeCADBase` - `src/Gui/SDK/bindings/kcsdk_py.cpp` — `PYBIND11_MODULE(kcsdk, m)` exposing `API_VERSION_MAJOR` - `src/Gui/SDK/bindings/CMakeLists.txt` — Builds `kcsdk` pybind11 module ## Modified files - `src/Gui/CMakeLists.txt` — Add `add_subdirectory(SDK)` - `src/Mod/Create/CMakeLists.txt` — Add kcsdk install rule ## Verification `pixi run configure && pixi run build && python -c "import kcsdk; print(kcsdk.API_VERSION_MAJOR)"` Part of the KCSDK epic (#346). Phase 1 of 8.
forbes added the enhancement label 2026-02-27 19:30:05 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: kindred/create#350