mirror of
https://github.com/NGSolve/netgen.git
synced 2024-11-14 10:08:32 +05:00
Python CLI tool to print cmake configuration directory
This commit is contained in:
parent
125c21b200
commit
bcab484095
@ -10,7 +10,7 @@ configure_file(version_template.py ${CMAKE_CURRENT_BINARY_DIR}/version.py @ONLY)
|
|||||||
install(FILES
|
install(FILES
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/config.py
|
${CMAKE_CURRENT_BINARY_DIR}/config.py
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/version.py
|
${CMAKE_CURRENT_BINARY_DIR}/version.py
|
||||||
__main__.py __init__.py
|
__main__.py __init__.py config_cli.py
|
||||||
meshing.py csg.py geom2d.py stl.py gui.py NgOCC.py occ.py
|
meshing.py csg.py geom2d.py stl.py gui.py NgOCC.py occ.py
|
||||||
read_gmsh.py read_meshio.py
|
read_gmsh.py read_meshio.py
|
||||||
webgui.py
|
webgui.py
|
||||||
|
10
python/config_cli.py
Normal file
10
python/config_cli.py
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
import netgen.config
|
||||||
|
|
||||||
|
if __name__=="__main__":
|
||||||
|
import argparse
|
||||||
|
parser = argparse.ArgumentParser()
|
||||||
|
parser.add_argument("--cmake-dir", help="print path to CMake config files", action='store_true')
|
||||||
|
args = parser.parse_args()
|
||||||
|
if(args.cmake_dir):
|
||||||
|
print(netgen.config.get_cmake_dir())
|
||||||
|
|
@ -57,3 +57,12 @@ PYTHON_VERSION_MAJOR = "@Python3_VERSION_MAJOR@"
|
|||||||
PYTHON_VERSION_MINOR = "@Python3_VERSION_MINOR@"
|
PYTHON_VERSION_MINOR = "@Python3_VERSION_MINOR@"
|
||||||
|
|
||||||
version = NETGEN_VERSION_GIT
|
version = NETGEN_VERSION_GIT
|
||||||
|
|
||||||
|
def get_cmake_dir():
|
||||||
|
import os.path as p
|
||||||
|
d_python = p.dirname(p.dirname(__file__))
|
||||||
|
py_to_cmake = p.relpath(
|
||||||
|
NG_INSTALL_DIR_CMAKE,
|
||||||
|
NG_INSTALL_DIR_PYTHON
|
||||||
|
)
|
||||||
|
return p.normpath(p.join(d_python,py_to_cmake))
|
||||||
|
Loading…
Reference in New Issue
Block a user