Please provide the CMake version use since the UseSWIG
builtin module has got some rework in 3.19 IIRC
Did you set some property on the example.i
file ?
It should be:
set_property(SOURCE example.i PROPERTY CPLUSPLUS ON)
swig_add_library(pyIntegration LANGUAGE python SOURCES example.i)
ref: https://cmake.org/cmake/help/latest/module/UseSWIG.html
ps: you can find a working sample here: https://github.com/Mizux/python-native