pyngcore as package (staying backward compatible)

This commit is contained in:
Matthias Hochsteger 2022-02-07 19:04:26 +01:00
parent 6f4cc7c528
commit d2378d9781
4 changed files with 10 additions and 1 deletions

View File

@ -87,6 +87,6 @@ if(USE_PYTHON)
pybind11_add_module(pyngcore SHARED python_ngcore_export.cpp) pybind11_add_module(pyngcore SHARED python_ngcore_export.cpp)
target_link_libraries(pyngcore PUBLIC ngcore netgen_python) target_link_libraries(pyngcore PUBLIC ngcore netgen_python)
set_target_properties(pyngcore PROPERTIES INSTALL_RPATH "${NG_RPATH_TOKEN}/${NETGEN_PYTHON_RPATH}") set_target_properties(pyngcore PROPERTIES INSTALL_RPATH "${NG_RPATH_TOKEN}/${NETGEN_PYTHON_RPATH}")
install(TARGETS pyngcore DESTINATION ${NG_INSTALL_DIR_PYTHON} COMPONENT netgen) install(TARGETS pyngcore DESTINATION ${NG_INSTALL_DIR_PYTHON}/pyngcore COMPONENT netgen)
endif(USE_PYTHON) endif(USE_PYTHON)

View File

@ -18,6 +18,12 @@ install(FILES
COMPONENT netgen COMPONENT netgen
) )
install(FILES
pyngcore/__init__.py
DESTINATION ${NG_INSTALL_DIR_PYTHON}/pyngcore
COMPONENT netgen
)
# build stub files for pybind11 packages # build stub files for pybind11 packages
if(BUILD_STUB_FILES) if(BUILD_STUB_FILES)
execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "import pybind11_stubgen; print(pybind11_stubgen.__file__)" OUTPUT_VARIABLE stubgen_path RESULT_VARIABLE pybind11_stubgen) execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "import pybind11_stubgen; print(pybind11_stubgen.__file__)" OUTPUT_VARIABLE stubgen_path RESULT_VARIABLE pybind11_stubgen)

View File

@ -0,0 +1 @@
from .pyngcore import *

View File

@ -73,6 +73,8 @@ elif 'linux' in sys.platform:
] ]
packages = [] packages = []
packages.append("pyngcore")
cmake_args += [ cmake_args += [
'-DUSE_SUPERBUILD:BOOL=ON', '-DUSE_SUPERBUILD:BOOL=ON',
'-DUSE_CCACHE:BOOL=ON', '-DUSE_CCACHE:BOOL=ON',