Fixed seg fault on start with >= VTK9.1, MACOSX: fixed bundle with homebrew

This commit is contained in:
matlabbe
2023-03-25 22:41:28 -07:00
parent fc7a6708c5
commit 6dca8ab0f3
4 changed files with 31 additions and 17 deletions
+9 -1
View File
@@ -39,6 +39,10 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <vtkVersionMacros.h>
#include <vtkObject.h>
#if VTK_MAJOR_VERSION > 9 || (VTK_MAJOR_VERSION==9 && VTK_MINOR_VERSION >= 1)
#include <QVTKRenderWidget.h>
#endif
using namespace rtabmap;
int main(int argc, char* argv[])
@@ -51,9 +55,13 @@ int main(int argc, char* argv[])
CoInitialize(nullptr);
#endif
#if VTK_MAJOR_VERSION >= 8
#if VTK_MAJOR_VERSION >= 8 && defined(BUILD_AS_BUNDLE)
vtkObject::GlobalWarningDisplayOff();
#endif
#if VTK_MAJOR_VERSION > 9 || (VTK_MAJOR_VERSION==9 && VTK_MINOR_VERSION >= 1)
// needed to ensure appropriate OpenGL context is created for VTK rendering.
QSurfaceFormat::setDefaultFormat(QVTKRenderWidget::defaultFormat());
#endif
/* Create tasks */
QApplication * app = new QApplication(argc, argv);