diff --git a/src/Main/CMakeLists.txt b/src/Main/CMakeLists.txt index 80150326b..4193dbd5e 100644 --- a/src/Main/CMakeLists.txt +++ b/src/Main/CMakeLists.txt @@ -182,9 +182,8 @@ if(ENABLE_FLITE) endif() if (Qt5Core_FOUND) - target_link_libraries(fgfs Qt5::Widgets fglauncher) + target_link_libraries(fgfs Qt5::Core Qt5::Widgets fglauncher fgqmlui) set_property(TARGET fgfs PROPERTY AUTOMOC ON) - target_link_libraries(fgfs fglauncher fgqmlui) endif() if(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD") diff --git a/src/Viewer/renderer.cxx b/src/Viewer/renderer.cxx index d603dde1a..fddf2e621 100644 --- a/src/Viewer/renderer.cxx +++ b/src/Viewer/renderer.cxx @@ -112,8 +112,10 @@ #include "CameraGroup.hxx" #include "FGEventHandler.hxx" +#if defined(HAVE_QT) #include #include +#endif #include @@ -1547,7 +1549,7 @@ FGRenderer::setupView( void ) osg::Geode* geode = new osg::Geode; geode->addDrawable(new SGHUDDrawable); geode->addDrawable(new SGPuDrawable); - +#if defined(HAVE_QT) std::string rootQMLPath = fgGetString("/sim/gui/qml-root-path"); auto graphicsWindowQt = dynamic_cast(guiCamera->getGraphicsContext()); @@ -1555,10 +1557,10 @@ FGRenderer::setupView( void ) _quickDrawable = new QQuickDrawable; _quickDrawable->setup(graphicsWindowQt); - _quickDrawable->setSource(QUrl(QString::fromStdString(rootQMLPath))); + _quickDrawable->setSource(QUrl::fromLocalFile(QString::fromStdString(rootQMLPath))); geode->addDrawable(_quickDrawable); } - +#endif // Draw first (eg. before Canvas GUI) guiCamera->insertChild(0, geode); guiCamera->insertChild(0, FGPanelNode::create2DPanelNode()); @@ -1746,9 +1748,11 @@ FGRenderer::resize( int width, int height ) // update splash node if present ? _splash->resize(width, height); +#if defined(HAVE_QT) if (_quickDrawable) { _quickDrawable->resize(width, height); } +#endif } typedef osgUtil::LineSegmentIntersector::Intersection Intersection;