Merge branch 'nogui_fixes' into 'master'

Fixes for non-GUI builds

Currently, Netgen is not building/linking correctly with USE_GUI=OFF.

See merge request !32
This commit is contained in:
Matthias Hochsteger 2017-01-31 17:30:24 +01:00
commit b94c409435
4 changed files with 30 additions and 20 deletions

View File

@ -32,13 +32,15 @@ if(USE_PYTHON)
install(TARGETS ngpy ${ng_install_dir}) install(TARGETS ngpy ${ng_install_dir})
endif(USE_PYTHON) endif(USE_PYTHON)
install(FILES if(USE_GUI)
dialog.tcl menustat.tcl ngicon.tcl ng.tcl install(FILES
ngvisual.tcl sockets.tcl nghelp.tcl ngshell.tcl dialog.tcl menustat.tcl ngicon.tcl ng.tcl
ngtesting.tcl parameters.tcl variables.tcl csgeom.tcl stlgeom.tcl ngvisual.tcl sockets.tcl nghelp.tcl ngshell.tcl
occgeom.tcl acisgeom.tcl netgen.ocf ngtesting.tcl parameters.tcl variables.tcl csgeom.tcl stlgeom.tcl
DESTINATION ${ng_install_dir_bin} COMPONENT netgen) occgeom.tcl acisgeom.tcl netgen.ocf
DESTINATION ${ng_install_dir_bin} COMPONENT netgen)
add_subdirectory(Togl2.1) add_subdirectory(Togl2.1)
install(FILES drawing.tcl DESTINATION ${ng_install_dir_bin} COMPONENT netgen) 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 ngpy("libngpy", "pybind netgen module");
py::module meshing = ngpy.def_submodule("_meshing", "pybind meshing module"); py::module meshing = ngpy.def_submodule("_meshing", "pybind meshing module");
ExportNetgenMeshing(meshing); ExportNetgenMeshing(meshing);
py::module meshvis = ngpy.def_submodule("meshvis", "pybind meshvis module");
ExportMeshVis(meshvis);
py::module csg = ngpy.def_submodule("_csg", "pybind csg module"); py::module csg = ngpy.def_submodule("_csg", "pybind csg module");
ExportCSG(csg); ExportCSG(csg);
py::module csgvis = ngpy.def_submodule("csgvis", "pybind csgvis module");
ExportCSGVis(csgvis);
py::module geom2d = ngpy.def_submodule("_geom2d", "pybind geom2d module"); py::module geom2d = ngpy.def_submodule("_geom2d", "pybind geom2d module");
ExportGeom2d(geom2d); ExportGeom2d(geom2d);
py::module stl = ngpy.def_submodule("_stl", "pybind stl module"); py::module stl = ngpy.def_submodule("_stl", "pybind stl module");
ExportSTL(stl); 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"); py::module stlvis = ngpy.def_submodule("stlvis", "pybind stlvis module");
ExportSTLVis(stlvis); ExportSTLVis(stlvis);
#endif // OPENGL
return ngpy.ptr(); return ngpy.ptr();
} }

View File

@ -22,7 +22,10 @@ endif(WIN32)
add_library(nglib SHARED nglib.cpp ${nglib_objects}) add_library(nglib SHARED nglib.cpp ${nglib_objects})
if(NOT WIN32) 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) 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} ) 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 import libngpy
from libngpy._csg import * from libngpy._csg import *
import libngpy.csgvis as csgvis
from libngpy.csgvis import MouseMove
from libngpy._meshing import MeshingParameters from libngpy._meshing import MeshingParameters
from libngpy._meshing import Pnt from libngpy._meshing import Pnt
from libngpy._meshing import Vec from libngpy._meshing import Vec
CSGeometry.VS = csgvis.VS try:
SetBackGroundColor = csgvis.SetBackGroundColor import libngpy.csgvis as csgvis
del csgvis from libngpy.csgvis import MouseMove
CSGeometry.VS = csgvis.VS
SetBackGroundColor = csgvis.SetBackGroundColor
del csgvis
def VS (obj): def VS (obj):
return obj.VS() return obj.VS()
except:
pass
def csg_meshing_func (geom, **args): def csg_meshing_func (geom, **args):