Fixes for non-GUI builds

This commit is contained in:
Matthias Hochsteger 2017-01-31 15:35:56 +01:00
parent 0cf1cfea5c
commit 685981d463
4 changed files with 30 additions and 20 deletions

View File

@ -32,13 +32,15 @@ if(USE_PYTHON)
install(TARGETS ngpy ${ng_install_dir})
endif(USE_PYTHON)
install(FILES
if(USE_GUI)
install(FILES
dialog.tcl menustat.tcl ngicon.tcl ng.tcl
ngvisual.tcl sockets.tcl nghelp.tcl ngshell.tcl
ngtesting.tcl parameters.tcl variables.tcl csgeom.tcl stlgeom.tcl
occgeom.tcl acisgeom.tcl netgen.ocf
DESTINATION ${ng_install_dir_bin} COMPONENT netgen)
add_subdirectory(Togl2.1)
install(FILES drawing.tcl DESTINATION ${ng_install_dir_bin} COMPONENT netgen)
add_subdirectory(Togl2.1)
install(FILES drawing.tcl DESTINATION ${ng_install_dir_bin} COMPONENT netgen)
endif(USE_GUI)

View File

@ -23,18 +23,20 @@ PYBIND11_PLUGIN(libngpy)
py::module ngpy("libngpy", "pybind netgen module");
py::module meshing = ngpy.def_submodule("_meshing", "pybind meshing module");
ExportNetgenMeshing(meshing);
py::module meshvis = ngpy.def_submodule("meshvis", "pybind meshvis module");
ExportMeshVis(meshvis);
py::module csg = ngpy.def_submodule("_csg", "pybind csg module");
ExportCSG(csg);
py::module csgvis = ngpy.def_submodule("csgvis", "pybind csgvis module");
ExportCSGVis(csgvis);
py::module geom2d = ngpy.def_submodule("_geom2d", "pybind geom2d module");
ExportGeom2d(geom2d);
py::module stl = ngpy.def_submodule("_stl", "pybind stl module");
ExportSTL(stl);
#ifdef OPENGL
py::module meshvis = ngpy.def_submodule("meshvis", "pybind meshvis module");
ExportMeshVis(meshvis);
py::module csgvis = ngpy.def_submodule("csgvis", "pybind csgvis module");
ExportCSGVis(csgvis);
py::module stlvis = ngpy.def_submodule("stlvis", "pybind stlvis module");
ExportSTLVis(stlvis);
#endif // OPENGL
return ngpy.ptr();
}

View File

@ -22,7 +22,10 @@ endif(WIN32)
add_library(nglib SHARED nglib.cpp ${nglib_objects})
if(NOT WIN32)
target_link_libraries( nglib mesh stlvis stl geom2dvis interface geom2d csg stl visual csgvis )
target_link_libraries( nglib mesh stl interface geom2d csg stl visual)
if(USE_GUI)
target_link_libraries( nglib stlvis geom2dvis csgvis )
endif(USE_GUI)
endif(NOT WIN32)
target_link_libraries( nglib ${OCC_LIBRARIES} ${MPI_CXX_LIBRARIES} ${OPENGL_LIBRARIES} ${TK_LIBRARY} ${TCL_LIBRARY} ${CMAKE_THREAD_LIBS_INIT} ${X11_Xmu_LIB} ${JPEG_LIBRARIES} ${MKL_LIBRARIES} ${ZLIB_LIBRARIES} ${OCC_LIBRARIES} )

View File

@ -1,19 +1,22 @@
import libngpy
from libngpy._csg import *
import libngpy.csgvis as csgvis
from libngpy.csgvis import MouseMove
from libngpy._meshing import MeshingParameters
from libngpy._meshing import Pnt
from libngpy._meshing import Vec
CSGeometry.VS = csgvis.VS
SetBackGroundColor = csgvis.SetBackGroundColor
del csgvis
try:
import libngpy.csgvis as csgvis
from libngpy.csgvis import MouseMove
CSGeometry.VS = csgvis.VS
SetBackGroundColor = csgvis.SetBackGroundColor
del csgvis
def VS (obj):
def VS (obj):
return obj.VS()
except:
pass
def csg_meshing_func (geom, **args):