Adapt build system to building with Qt5 and Qt6

By default it builds with Qt5 (KDEInstallDirs module from ECM takes care of
that), to build with Qt6 you need to build with -DQT_MAJOR_VERSION=6.
wilder
Ahmad Samir 4 years ago committed by Tomaz Canabrava
parent 8c53503329
commit 305e699a57
  1. 2
      CMakeLists.txt
  2. 14
      desktop/CMakeLists.txt
  3. 16
      src/CMakeLists.txt
  4. 4
      src/autotests/CMakeLists.txt
  5. 2
      src/characters/CMakeLists.txt
  6. 4
      src/session/CMakeLists.txt
  7. 2
      src/tests/CMakeLists.txt
  8. 2
      src/tests/demo_konsolepart/CMakeLists.txt
  9. 2
      src/tests/demo_konsolepart/src/CMakeLists.txt
  10. 4
      tools/uni2characterwidth/CMakeLists.txt

@ -59,7 +59,7 @@ endif()
ecm_setup_version(${RELEASE_SERVICE_VERSION} VARIABLE_PREFIX KONSOLEPRIVATE
SOVERSION 1
)
find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED
find_package(Qt${QT_MAJOR_VERSION} ${QT_MIN_VERSION} CONFIG REQUIRED
Core
DBus
PrintSupport

@ -4,11 +4,19 @@
install( PROGRAMS org.kde.konsole.desktop DESTINATION ${KDE_INSTALL_APPDIR} )
install( FILES org.kde.konsole.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR} )
install( FILES terminalemulator.desktop DESTINATION ${KDE_INSTALL_KSERVICETYPES5DIR} )
install( FILES konsolepart.desktop DESTINATION ${KDE_INSTALL_KSERVICES5DIR} )
if(ECM_VERSION VERSION_GREATER_EQUAL "5.89.0")
install(FILES terminalemulator.desktop DESTINATION ${KDE_INSTALL_KSERVICETYPESDIR})
install(FILES konsolepart.desktop DESTINATION ${KDE_INSTALL_KSERVICESDIR})
install(FILES konsole.notifyrc DESTINATION ${KDE_INSTALL_KNOTIFYRCDIR})
else()
install(FILES terminalemulator.desktop DESTINATION ${KDE_INSTALL_KSERVICETYPES5DIR})
install(FILES konsolepart.desktop DESTINATION ${KDE_INSTALL_KSERVICES5DIR})
install(FILES konsole.notifyrc DESTINATION ${KDE_INSTALL_KNOTIFY5RCDIR})
endif()
if(KF5KIO_VERSION VERSION_GREATER_EQUAL "5.85.0")
install( PROGRAMS konsolerun.desktop DESTINATION ${KDE_INSTALL_DATADIR}/kio/servicemenus )
else()
install( FILES konsolerun.desktop DESTINATION ${KDE_INSTALL_KSERVICES5DIR}/ServiceMenus )
endif()
install( FILES konsole.notifyrc DESTINATION ${KDE_INSTALL_KNOTIFY5RCDIR} )

@ -21,7 +21,7 @@ configure_file(config-konsole.h.cmake
### Tests
if(BUILD_TESTING)
find_package(Qt5Test ${QT_MIN_VERSION} CONFIG REQUIRED)
find_package(Qt${QT_MAJOR_VERSION}Test ${QT_MIN_VERSION} CONFIG REQUIRED)
add_subdirectory(autotests)
add_subdirectory(tests)
endif()
@ -40,9 +40,9 @@ option(KONSOLE_BUILD_UNI2CHARACTERWIDTH "Konsole: build uni2characterwidth execu
# qdbuscpp2xml -M -s ViewManager.h -o org.kde.konsole.Konsole.xml
# Generate dbus .xml files; do not store .xml in source folder
qt5_generate_dbus_interface(ViewManager.h org.kde.konsole.Window.xml OPTIONS -m)
qt_generate_dbus_interface(ViewManager.h org.kde.konsole.Window.xml OPTIONS -m)
qt5_add_dbus_adaptor(windowadaptors_SRCS
qt_add_dbus_adaptor(windowadaptors_SRCS
${CMAKE_CURRENT_BINARY_DIR}/org.kde.konsole.Window.xml
ViewManager.h
Konsole::ViewManager)
@ -50,8 +50,8 @@ qt5_add_dbus_adaptor(windowadaptors_SRCS
set(konsole_LIBS
KF5::XmlGui
Qt5::PrintSupport
Qt5::Xml
Qt::PrintSupport
Qt::Xml
KF5::Notifications
KF5::WindowSystem
KF5::TextWidgets
@ -99,8 +99,8 @@ add_library(konsolehelpers
${konsolehelpers_SRCS}
)
target_link_libraries(konsolehelpers
Qt5::Core
Qt5::Widgets
Qt::Core
Qt::Widgets
)
add_subdirectory(colorscheme)
@ -225,7 +225,7 @@ ki18n_wrap_ui(konsoleprivate_SRCS
)
# add the resource files for the ui files
qt5_add_resources( konsoleprivate_SRCS ../desktop/konsole.qrc)
qt_add_resources( konsoleprivate_SRCS ../desktop/konsole.qrc)
add_library(konsoleprivate ${konsoleprivate_SRCS})
generate_export_header(konsoleprivate BASE_NAME konsoleprivate)

@ -3,7 +3,7 @@ include(ECMMarkNonGuiExecutable)
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR})
set(KONSOLE_TEST_LIBS Qt5::Test konsoleprivate)
set(KONSOLE_TEST_LIBS Qt::Test konsoleprivate)
add_executable(BookMarkTest BookMarkTest.cpp)
ecm_mark_as_test(BookMarkTest)
@ -44,7 +44,7 @@ else()
ecm_mark_as_test(DBusTest)
ecm_mark_nongui_executable(DBusTest)
add_test(NAME DBusTest COMMAND DBusTest)
target_link_libraries(DBusTest ${KONSOLE_TEST_LIBS} Qt5::DBus)
target_link_libraries(DBusTest ${KONSOLE_TEST_LIBS} Qt::DBus)
endif()
endif()

@ -21,4 +21,4 @@ generate_export_header(konsolecharacters BASE_NAME konsolecharacters)
target_include_directories(konsolecharacters
PUBLIC ${CMAKE_CURRENT_BINARY_DIR}
INTERFACE ${CMAKE_CURRENT_SOURCE_DIR})
target_link_libraries(konsolecharacters Qt5::Gui)
target_link_libraries(konsolecharacters Qt::Gui)

@ -5,9 +5,9 @@
# qdbuscpp2xml -m Session.h -o org.kde.konsole.Session.xml
# Generate dbus .xml files; do not store .xml in source folder
qt5_generate_dbus_interface(Session.h org.kde.konsole.Session.xml OPTIONS -m)
qt_generate_dbus_interface(Session.h org.kde.konsole.Session.xml OPTIONS -m)
qt5_add_dbus_adaptor(
qt_add_dbus_adaptor(
sessionadaptors_SRCS
${CMAKE_CURRENT_BINARY_DIR}/org.kde.konsole.Session.xml
Session.h

@ -4,7 +4,7 @@ include(ECMMarkAsTest)
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR})
set(KONSOLE_TEST_LIBS Qt5::Test konsoleprivate)
set(KONSOLE_TEST_LIBS Qt::Test konsoleprivate)
add_executable(PartManualTest PartManualTest.cpp)
ecm_mark_as_test(PartManualTest)

@ -13,7 +13,7 @@ include(ECMInstallIcons)
include(FeatureSummary)
set(QT_MIN_VERSION "5.4.0")
find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS Core Gui Widgets)
find_package(Qt${QT_MAJOR_VERSION} ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS Core Gui Widgets)
set(REQUIRED_KF5_VERSION "5.18.0")
find_package(KF5 ${REQUIRED_KF5_VERSION} REQUIRED COMPONENTS

@ -10,7 +10,7 @@ target_link_libraries(demo_konsolepart
KF5::I18n
KF5::Parts
KF5::Pty
Qt5::Widgets
Qt::Widgets
KF5::XmlGui
KF5::WindowSystem
)

@ -7,7 +7,7 @@
### See `uni2characterwidth --help` for usage information
if(KONSOLE_BUILD_UNI2CHARACTERWIDTH)
find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED
find_package(Qt${QT_MAJOR_VERSION} ${QT_MIN_VERSION} CONFIG REQUIRED
Core
)
find_package(KF5 ${KF5_MIN_VERSION} REQUIRED
@ -23,7 +23,7 @@ if(KONSOLE_BUILD_UNI2CHARACTERWIDTH)
add_executable(uni2characterwidth ${uni2characterwidth_SRC})
target_link_libraries(uni2characterwidth
Qt5::Core
Qt::Core
KF5::KIOCore
)

Loading…
Cancel
Save