2020-08-25 16:05:56 +02:00
|
|
|
# === This file is part of Calamares - <https://calamares.io> ===
|
2020-08-26 00:24:52 +02:00
|
|
|
#
|
|
|
|
# SPDX-FileCopyrightText: 2020 Adriaan de Groot <groot@kde.org>
|
|
|
|
# SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
#
|
|
|
|
|
2019-05-07 13:16:48 +02:00
|
|
|
# libcalamaresui is the GUI part of Calamares, which includes handling
|
|
|
|
# view modules, view steps, widgets, and branding.
|
|
|
|
|
|
|
|
# The UI libs use the non-UI library
|
2019-08-08 18:42:02 +02:00
|
|
|
include_directories( ${CMAKE_SOURCE_DIR}/src/libcalamares ${CMAKE_BINARY_DIR}/src/libcalamares ${CMAKE_SOURCE_DIR} )
|
2019-05-07 13:16:48 +02:00
|
|
|
|
2017-09-21 10:53:09 +02:00
|
|
|
set( calamaresui_SOURCES
|
2016-09-25 03:20:50 +02:00
|
|
|
modulesystem/CppJobModule.cpp
|
2020-03-31 22:44:02 +02:00
|
|
|
modulesystem/ModuleFactory.cpp
|
2014-07-03 18:00:40 +02:00
|
|
|
modulesystem/ModuleManager.cpp
|
2014-07-10 17:11:03 +02:00
|
|
|
modulesystem/ProcessJobModule.cpp
|
2014-07-03 18:00:40 +02:00
|
|
|
modulesystem/ViewModule.cpp
|
|
|
|
|
|
|
|
utils/CalamaresUtilsGui.cpp
|
2014-08-26 15:18:30 +02:00
|
|
|
utils/ImageRegistry.cpp
|
2019-07-30 15:09:25 +02:00
|
|
|
utils/Paste.cpp
|
2014-07-03 18:00:40 +02:00
|
|
|
|
2018-06-13 11:11:31 +02:00
|
|
|
viewpages/BlankViewStep.cpp
|
2020-01-10 11:56:30 +01:00
|
|
|
viewpages/ExecutionViewStep.cpp
|
2020-05-13 14:01:51 +02:00
|
|
|
viewpages/Slideshow.cpp
|
2014-07-03 18:00:40 +02:00
|
|
|
viewpages/ViewStep.cpp
|
|
|
|
|
2014-09-03 17:56:46 +02:00
|
|
|
widgets/ClickableLabel.cpp
|
2021-12-07 12:24:41 +01:00
|
|
|
widgets/ErrorDialog.cpp
|
2015-06-20 01:04:54 +02:00
|
|
|
widgets/FixedAspectRatioLabel.cpp
|
2020-05-18 10:38:45 +02:00
|
|
|
widgets/PrettyRadioButton.cpp
|
2022-03-06 14:45:48 +01:00
|
|
|
widgets/LogWidget.cpp
|
2021-09-07 17:15:30 +02:00
|
|
|
widgets/TranslationFix.cpp
|
2014-09-03 17:56:46 +02:00
|
|
|
widgets/WaitingWidget.cpp
|
2019-08-08 16:47:14 +02:00
|
|
|
${CMAKE_SOURCE_DIR}/3rdparty/waitingspinnerwidget.cpp
|
2014-08-21 17:44:35 +02:00
|
|
|
|
2014-10-10 18:18:35 +02:00
|
|
|
Branding.cpp
|
2014-07-03 18:00:40 +02:00
|
|
|
ViewManager.cpp
|
|
|
|
)
|
|
|
|
|
2017-09-21 10:53:09 +02:00
|
|
|
# Don't warn about third-party sources
|
|
|
|
mark_thirdparty_code(
|
2019-08-08 16:47:14 +02:00
|
|
|
${CMAKE_SOURCE_DIR}/3rdparty/waitingspinnerwidget.cpp
|
2017-09-21 10:53:09 +02:00
|
|
|
)
|
|
|
|
|
2014-07-16 16:09:53 +02:00
|
|
|
if( WITH_PYTHON )
|
2017-09-18 12:12:10 +02:00
|
|
|
list( APPEND calamaresui_SOURCES
|
2014-07-16 16:09:53 +02:00
|
|
|
modulesystem/PythonJobModule.cpp
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
2016-10-02 19:14:56 +02:00
|
|
|
if( WITH_PYTHONQT )
|
2017-09-18 12:12:10 +02:00
|
|
|
list( APPEND calamaresui_SOURCES
|
2016-10-02 19:14:56 +02:00
|
|
|
modulesystem/PythonQtViewModule.cpp
|
2016-10-07 18:41:05 +02:00
|
|
|
utils/PythonQtUtils.cpp
|
2016-10-27 15:13:05 +02:00
|
|
|
viewpages/PythonQtJob.cpp
|
2016-10-04 15:29:17 +02:00
|
|
|
viewpages/PythonQtViewStep.cpp
|
2016-10-21 16:38:49 +02:00
|
|
|
viewpages/PythonQtGlobalStorageWrapper.cpp
|
|
|
|
viewpages/PythonQtUtilsWrapper.cpp
|
2016-10-02 19:14:56 +02:00
|
|
|
)
|
2020-05-14 16:18:52 +02:00
|
|
|
endif()
|
|
|
|
|
|
|
|
if( WITH_QML )
|
|
|
|
list( APPEND calamaresui_SOURCES
|
|
|
|
utils/Qml.cpp
|
|
|
|
viewpages/QmlViewStep.cpp
|
2016-10-02 19:14:56 +02:00
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
2017-09-18 12:12:10 +02:00
|
|
|
calamares_add_library( calamaresui
|
|
|
|
SOURCES ${calamaresui_SOURCES}
|
2020-02-17 16:52:45 +01:00
|
|
|
EXPORT_MACRO UIDLLEXPORT_PRO
|
2017-10-24 18:53:20 +02:00
|
|
|
LINK_LIBRARIES
|
2014-08-26 15:18:30 +02:00
|
|
|
Qt5::Svg
|
|
|
|
RESOURCES libcalamaresui.qrc
|
2020-06-10 00:31:13 +02:00
|
|
|
EXPORT Calamares
|
2021-12-07 14:20:31 +01:00
|
|
|
UI
|
|
|
|
utils/ErrorDialog/ErrorDialog.ui
|
2014-07-03 18:00:40 +02:00
|
|
|
VERSION ${CALAMARES_VERSION_SHORT}
|
|
|
|
)
|
2021-07-26 15:08:29 +02:00
|
|
|
target_link_libraries( calamaresui PRIVATE yamlcpp::yamlcpp )
|
2020-05-14 16:18:52 +02:00
|
|
|
if( KF5CoreAddons_FOUND AND KF5CoreAddons_VERSION VERSION_GREATER_EQUAL 5.58 )
|
2019-05-20 13:25:07 +02:00
|
|
|
target_compile_definitions( calamaresui PRIVATE WITH_KOSRelease )
|
|
|
|
endif()
|
2020-05-14 16:18:52 +02:00
|
|
|
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()
|
2020-06-10 16:43:34 +02:00
|
|
|
|
2021-07-26 14:22:28 +02:00
|
|
|
add_library(Calamares::calamaresui ALIAS calamaresui)
|
|
|
|
|
2020-06-10 16:43:34 +02:00
|
|
|
|
|
|
|
### Installation
|
|
|
|
#
|
|
|
|
#
|
|
|
|
# The library is already installed through calamares_add_library(),
|
|
|
|
# so we only need to do headers. Unlike the Calamares source tree,
|
|
|
|
# where libcalamares and libcalamaresui live in different branches,
|
|
|
|
# we're going to glom it all together in the installed headers location.
|
|
|
|
|
|
|
|
install(
|
|
|
|
FILES
|
|
|
|
Branding.h
|
|
|
|
ViewManager.h
|
|
|
|
DESTINATION include/libcalamares
|
|
|
|
)
|
|
|
|
|
|
|
|
# Install each subdir-worth of header files
|
|
|
|
foreach( subdir modulesystem utils viewpages widgets )
|
|
|
|
file( GLOB subdir_headers "${subdir}/*.h" )
|
|
|
|
install( FILES ${subdir_headers} DESTINATION include/libcalamares/${subdir} )
|
|
|
|
endforeach()
|
2021-03-09 17:55:10 +01:00
|
|
|
|
|
|
|
calamares_add_test(
|
|
|
|
test_libcalamaresuipaste
|
|
|
|
SOURCES
|
|
|
|
utils/TestPaste.cpp
|
|
|
|
utils/Paste.cpp
|
|
|
|
LIBRARIES
|
|
|
|
calamaresui
|
|
|
|
)
|