diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt index 55812e0f6..9cd039cf8 100644 --- a/python/CMakeLists.txt +++ b/python/CMakeLists.txt @@ -89,6 +89,8 @@ if (OPENGL_FOUND) include_directories("../external/nanogui/ext/nanovg/src") list(APPEND SHARED_LIBRARIES "nanogui" ${OPENGL_LIBRARIES}) + list(APPEND SHARED_SOURCES "py_igl_viewer.cpp") + endif (OPENGL_FOUND) # include comiso if available @@ -148,7 +150,6 @@ add_library(igl SHARED py_vector.cpp py_igl.cpp py_doc.cpp - py_igl_viewer.cpp ${SHARED_SOURCES} ) diff --git a/python/python.cpp b/python/python.cpp index f81fa6c34..b86a69f08 100644 --- a/python/python.cpp +++ b/python/python.cpp @@ -5,7 +5,10 @@ extern void python_export_vector(py::module &); extern void python_export_igl(py::module &); + +#ifdef PY_VIEWER extern void python_export_igl_viewer(py::module &); +#endif #ifdef PY_COMISO extern void python_export_igl_comiso(py::module &); @@ -17,7 +20,11 @@ PYTHON_PLUGIN(igl) { python_export_vector(m); python_export_igl(m); + + + #ifdef PY_VIEWER python_export_igl_viewer(m); + #endif #ifdef PY_COMISO python_export_igl_comiso(m);