mirror of
https://github.com/NGSolve/netgen.git
synced 2025-01-28 05:40:34 +05:00
[python] Import tkinter only when necessary
Don't import if Netgen was configured with USE_GUI=OFF
This commit is contained in:
parent
375e564329
commit
ce47af852e
@ -1,3 +1,8 @@
|
|||||||
|
if(USE_GUI)
|
||||||
|
set(IMPORT_TKINTER True)
|
||||||
|
else()
|
||||||
|
set(IMPORT_TKINTER False)
|
||||||
|
endif()
|
||||||
configure_file(__init__.py ${CMAKE_CURRENT_BINARY_DIR}/__init__.py @ONLY)
|
configure_file(__init__.py ${CMAKE_CURRENT_BINARY_DIR}/__init__.py @ONLY)
|
||||||
|
|
||||||
install(FILES
|
install(FILES
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
# import tkinter only if Netgen was configured with USE_GUI=ON
|
||||||
|
if @IMPORT_TKINTER@:
|
||||||
import tkinter
|
import tkinter
|
||||||
|
|
||||||
_netgen_bin_dir=os.path.realpath(os.path.join(os.path.dirname(__file__),'..','@NETGEN_PYTHON_RPATH_BIN@'))
|
_netgen_bin_dir=os.path.realpath(os.path.join(os.path.dirname(__file__),'..','@NETGEN_PYTHON_RPATH_BIN@'))
|
||||||
|
Loading…
Reference in New Issue
Block a user