[libcalamaresui] Don't build QML bits if they're not wanted
When WITH_QML is off (by explicit choice) - don't build the QmlViewStep - don't build the QML slideshow
This commit is contained in:
parent
47979555fe
commit
736f99768a
@ -14,11 +14,9 @@ set( calamaresui_SOURCES
|
||||
utils/CalamaresUtilsGui.cpp
|
||||
utils/ImageRegistry.cpp
|
||||
utils/Paste.cpp
|
||||
utils/Qml.cpp
|
||||
|
||||
viewpages/BlankViewStep.cpp
|
||||
viewpages/ExecutionViewStep.cpp
|
||||
viewpages/QmlViewStep.cpp
|
||||
viewpages/Slideshow.cpp
|
||||
viewpages/ViewStep.cpp
|
||||
|
||||
@ -45,10 +43,6 @@ if( WITH_PYTHON )
|
||||
endif()
|
||||
|
||||
if( WITH_PYTHONQT )
|
||||
include_directories(${PYTHON_INCLUDE_DIRS})
|
||||
# *_DIRS because we also use extensions
|
||||
include_directories(${PYTHONQT_INCLUDE_DIRS})
|
||||
|
||||
list( APPEND calamaresui_SOURCES
|
||||
modulesystem/PythonQtViewModule.cpp
|
||||
utils/PythonQtUtils.cpp
|
||||
@ -57,25 +51,33 @@ if( WITH_PYTHONQT )
|
||||
viewpages/PythonQtGlobalStorageWrapper.cpp
|
||||
viewpages/PythonQtUtilsWrapper.cpp
|
||||
)
|
||||
set( OPTIONAL_PYTHON_LIBRARIES
|
||||
${PYTHON_LIBRARIES}
|
||||
${PYTHONQT_LIBRARIES}
|
||||
endif()
|
||||
|
||||
if( WITH_QML )
|
||||
list( APPEND calamaresui_SOURCES
|
||||
utils/Qml.cpp
|
||||
viewpages/QmlViewStep.cpp
|
||||
)
|
||||
endif()
|
||||
|
||||
calamares_add_library( calamaresui
|
||||
SOURCES ${calamaresui_SOURCES}
|
||||
EXPORT_MACRO UIDLLEXPORT_PRO
|
||||
LINK_PRIVATE_LIBRARIES
|
||||
${OPTIONAL_PYTHON_LIBRARIES}
|
||||
LINK_LIBRARIES
|
||||
Qt5::Svg
|
||||
Qt5::QuickWidgets
|
||||
RESOURCES libcalamaresui.qrc
|
||||
EXPORT CalamaresLibraryDepends
|
||||
VERSION ${CALAMARES_VERSION_SHORT}
|
||||
)
|
||||
|
||||
if ( KF5CoreAddons_FOUND AND KF5CoreAddons_VERSION VERSION_GREATER_EQUAL 5.58 )
|
||||
if( KF5CoreAddons_FOUND AND KF5CoreAddons_VERSION VERSION_GREATER_EQUAL 5.58 )
|
||||
target_compile_definitions( calamaresui PRIVATE WITH_KOSRelease )
|
||||
endif()
|
||||
if( WITH_PYTHONQT )
|
||||
# *_DIRS because we also use extensions
|
||||
target_include_directories( calamaresui PRIVATE ${PYTHON_INCLUDE_DIRS} ${PYTHONQT_INCLUDE_DIRS} )
|
||||
target_link_libraries( calamaresui PRIVATE ${PYTHON_LIBRARIES} ${PYTHONQT_LIBRARIES} )
|
||||
endif()
|
||||
if( WITH_QML )
|
||||
target_link_libraries( calamaresui PUBLIC Qt5::QuickWidgets )
|
||||
endif()
|
||||
|
@ -23,11 +23,11 @@
|
||||
#include "Slideshow.h"
|
||||
|
||||
#include "Branding.h"
|
||||
#include "CalamaresConfig.h"
|
||||
#include "Job.h"
|
||||
#include "JobQueue.h"
|
||||
#include "Settings.h"
|
||||
#include "ViewManager.h"
|
||||
|
||||
#include "modulesystem/Module.h"
|
||||
#include "modulesystem/ModuleManager.h"
|
||||
#include "utils/CalamaresUtilsGui.h"
|
||||
@ -49,10 +49,12 @@ makeSlideshow( QWidget* parent )
|
||||
{
|
||||
case -1:
|
||||
return new Calamares::SlideshowPictures( parent );
|
||||
#ifdef WITH_QML
|
||||
case 1:
|
||||
FALLTHRU;
|
||||
case 2:
|
||||
return new Calamares::SlideshowQML( parent );
|
||||
#endif
|
||||
default:
|
||||
cWarning() << "Unknown Branding slideshow API" << api;
|
||||
return new Calamares::SlideshowPictures( parent );
|
||||
|
@ -28,10 +28,12 @@
|
||||
|
||||
#include <QLabel>
|
||||
#include <QMutexLocker>
|
||||
#ifdef WITH_QML
|
||||
#include <QQmlComponent>
|
||||
#include <QQmlEngine>
|
||||
#include <QQuickItem>
|
||||
#include <QQuickWidget>
|
||||
#endif
|
||||
#include <QTimer>
|
||||
|
||||
#include <chrono>
|
||||
@ -41,6 +43,7 @@ namespace Calamares
|
||||
|
||||
Slideshow::~Slideshow() {}
|
||||
|
||||
#ifdef WITH_QML
|
||||
SlideshowQML::SlideshowQML( QWidget* parent )
|
||||
: Slideshow( parent )
|
||||
, m_qmlShow( new QQuickWidget )
|
||||
@ -173,6 +176,7 @@ SlideshowQML::changeSlideShowState( Action state )
|
||||
|
||||
m_state = state;
|
||||
}
|
||||
#endif
|
||||
|
||||
SlideshowPictures::SlideshowPictures( QWidget* parent )
|
||||
: Slideshow( parent )
|
||||
|
@ -21,15 +21,19 @@
|
||||
#ifndef LIBCALAMARESUI_SLIDESHOW_H
|
||||
#define LIBCALAMARESUI_SLIDESHOW_H
|
||||
|
||||
#include "CalamaresConfig.h"
|
||||
|
||||
#include <QMutex>
|
||||
#include <QStringList>
|
||||
#include <QWidget>
|
||||
|
||||
class QLabel;
|
||||
class QTimer;
|
||||
#ifdef WITH_QML
|
||||
class QQmlComponent;
|
||||
class QQuickItem;
|
||||
class QQuickWidget;
|
||||
#endif
|
||||
|
||||
namespace Calamares
|
||||
{
|
||||
@ -81,6 +85,7 @@ protected:
|
||||
Action m_state = Stop;
|
||||
};
|
||||
|
||||
#ifdef WITH_QML
|
||||
/** @brief Slideshow using a QML file
|
||||
*
|
||||
* This is the "classic" slideshow in Calamares, which runs some QML
|
||||
@ -109,6 +114,7 @@ private:
|
||||
QQmlComponent* m_qmlComponent;
|
||||
QQuickItem* m_qmlObject; ///< The actual show
|
||||
};
|
||||
#endif
|
||||
|
||||
/** @brief Slideshow using images
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user