|
1 | 1 | import os |
2 | | -import warnings |
| 2 | +import sys |
3 | 3 |
|
4 | 4 | import cppyy.ll |
5 | 5 | from cppyy import include as cppinclude, cppdef, cppexec, nullptr |
|
16 | 16 | cppyy.add_include_path(os.path.join(BUILD_DIR, "include")) |
17 | 17 | cppyy.add_include_path(os.path.join(BUILD_DIR, "..", "include")) |
18 | 18 | cppyy.add_library_path(BUILD_DIR) |
19 | | -else: |
20 | | - warnings.warn("ogdf-python couldn't find OGDF. " |
21 | | - "Please set environment variables OGDF_INSTALL_DIR or OGDF_BUILD_DIR.") |
22 | 19 |
|
23 | 20 | cppyy.cppdef("#undef NDEBUG") |
24 | | -cppyy.include("ogdf/basic/internal/config_autogen.h") |
25 | | -cppyy.include("ogdf/basic/internal/config.h") |
26 | | -cppyy.include("ogdf/basic/Graph.h") |
27 | | -cppyy.include("ogdf/fileformats/GraphIO.h") |
| 21 | +try: |
| 22 | + cppyy.include("ogdf/basic/internal/config_autogen.h") |
| 23 | + cppyy.include("ogdf/basic/internal/config.h") |
| 24 | + cppyy.include("ogdf/basic/Graph.h") |
| 25 | + cppyy.include("ogdf/fileformats/GraphIO.h") |
28 | 26 |
|
29 | | -cppyy.load_library("libOGDF.so") |
| 27 | + cppyy.load_library("libOGDF") |
| 28 | +except: |
| 29 | + print( |
| 30 | + "ogdf-python couldn't load OGDF. " |
| 31 | + "If you haven't installed OGDF globally to your system, " |
| 32 | + "please set environment variables OGDF_INSTALL_DIR or OGDF_BUILD_DIR.", |
| 33 | + file=sys.stderr) |
| 34 | + raise |
30 | 35 |
|
31 | 36 | import ogdf_python.doxygen |
32 | 37 | import ogdf_python.pythonize |
|
0 commit comments