mirror of
https://github.com/NGSolve/netgen.git
synced 2025-01-27 05:10:34 +05:00
Merge branch 'generate_stub_files' into 'master'
auto generate stub files using pybind11_stubgen See merge request jschoeberl/netgen!172
This commit is contained in:
commit
933c93da3a
@ -28,6 +28,7 @@ option( ENABLE_CPP_CORE_GUIDELINES_CHECK "Enable cpp core guideline checks on ng
|
|||||||
option( USE_SPDLOG "Enable spd log logging" OFF)
|
option( USE_SPDLOG "Enable spd log logging" OFF)
|
||||||
option( DEBUG_LOG "Enable more debug output (may increase computation time) - only works with USE_SPDLOG=ON" OFF)
|
option( DEBUG_LOG "Enable more debug output (may increase computation time) - only works with USE_SPDLOG=ON" OFF)
|
||||||
option( CHECK_RANGE "Check array range access, automatically enabled if built in debug mode" OFF)
|
option( CHECK_RANGE "Check array range access, automatically enabled if built in debug mode" OFF)
|
||||||
|
option( BUILD_STUB_FILES "Build stub files for better autocompletion" ON)
|
||||||
|
|
||||||
option( USE_SUPERBUILD "use ccache" ON)
|
option( USE_SUPERBUILD "use ccache" ON)
|
||||||
|
|
||||||
@ -382,13 +383,13 @@ endif(ENABLE_CPP_CORE_GUIDELINES_CHECK)
|
|||||||
add_subdirectory(libsrc)
|
add_subdirectory(libsrc)
|
||||||
add_subdirectory(ng)
|
add_subdirectory(ng)
|
||||||
add_subdirectory(tutorials)
|
add_subdirectory(tutorials)
|
||||||
if (USE_PYTHON)
|
|
||||||
add_subdirectory(python)
|
|
||||||
endif (USE_PYTHON)
|
|
||||||
add_subdirectory(py_tutorials)
|
add_subdirectory(py_tutorials)
|
||||||
add_subdirectory(doc)
|
add_subdirectory(doc)
|
||||||
add_subdirectory(windows)
|
add_subdirectory(windows)
|
||||||
add_subdirectory(nglib)
|
add_subdirectory(nglib)
|
||||||
|
if (USE_PYTHON)
|
||||||
|
add_subdirectory(python)
|
||||||
|
endif (USE_PYTHON)
|
||||||
add_subdirectory(tests)
|
add_subdirectory(tests)
|
||||||
|
|
||||||
|
|
||||||
|
@ -145,6 +145,7 @@ set_vars( NETGEN_CMAKE_ARGS
|
|||||||
USE_SPDLOG
|
USE_SPDLOG
|
||||||
DEBUG_LOG
|
DEBUG_LOG
|
||||||
CHECK_RANGE
|
CHECK_RANGE
|
||||||
|
BUILD_STUB_FILES
|
||||||
)
|
)
|
||||||
|
|
||||||
# propagate all variables set on the command line using cmake -DFOO=BAR
|
# propagate all variables set on the command line using cmake -DFOO=BAR
|
||||||
|
@ -11,3 +11,16 @@ install(FILES
|
|||||||
DESTINATION ${NG_INSTALL_DIR_PYTHON}/${NG_INSTALL_SUFFIX}
|
DESTINATION ${NG_INSTALL_DIR_PYTHON}/${NG_INSTALL_SUFFIX}
|
||||||
COMPONENT netgen
|
COMPONENT netgen
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# build stub files for pybind11 packages
|
||||||
|
if(BUILD_STUB_FILES)
|
||||||
|
find_program(PYBIND11_STUBS NAMES pybind11-stubgen)
|
||||||
|
if(PYBIND11_STUBS)
|
||||||
|
message("-- Found pybind11-stubgen: ${PYBIND11_STUBS}")
|
||||||
|
install(CODE "execute_process(COMMAND ${PYBIND11_STUBS} --no-setup-py netgen)")
|
||||||
|
install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/../stubs/netgen-stubs/ DESTINATION ${NG_INSTALL_DIR_PYTHON}/netgen/)
|
||||||
|
else(PYBIND11_STUBS)
|
||||||
|
message(WARNING "pybind11-stubgen not found, if you want to create stub files
|
||||||
|
for better autocompletion support install it with pip.")
|
||||||
|
endif(PYBIND11_STUBS)
|
||||||
|
endif(BUILD_STUB_FILES)
|
||||||
|
Loading…
Reference in New Issue
Block a user