mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
Qt6 support (#1363)
* Initial Qt6 config * Change Package order to reingfence missing packages * Update to QT 6.2.0 * Qt 6.2.0 updates * macOS fix * Simplify handling QT5 & Qt6 in parallel * Updates for Windows * Fix macos build * macOS linker fix * General support of QTDIR, update docu * MaxOS add default qt directories * Fix merge typo * Update default CMakeSettings.json with installation path options * Add additional libs required by Qt6 to CompileHowTo * Fix Qt5 items Co-authored-by: Paulchen-Panther <16664240+Paulchen-Panther@users.noreply.github.com>
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
cmake_minimum_required(VERSION 3.0.0)
|
||||
project(hyperion-aml)
|
||||
|
||||
find_package(Qt5Widgets REQUIRED)
|
||||
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core Network Widgets REQUIRED)
|
||||
|
||||
include_directories(
|
||||
${CMAKE_CURRENT_BINARY_DIR}/../../libsrc/flatbufserver
|
||||
@@ -30,9 +30,9 @@ target_link_libraries(${PROJECT_NAME}
|
||||
amlogic-grabber
|
||||
framebuffer-grabber
|
||||
ssdp
|
||||
Qt5::Core
|
||||
Qt5::Gui
|
||||
Qt5::Network
|
||||
Qt${QT_VERSION_MAJOR}::Core
|
||||
Qt${QT_VERSION_MAJOR}::Network
|
||||
Qt${QT_VERSION_MAJOR}::Widgets
|
||||
)
|
||||
|
||||
if (ENABLE_AMLOGIC)
|
||||
|
@@ -1,7 +1,8 @@
|
||||
cmake_minimum_required(VERSION 3.0.0)
|
||||
project(hyperion-dispmanx)
|
||||
|
||||
find_package(Qt5Widgets REQUIRED)
|
||||
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core Network Widgets REQUIRED)
|
||||
|
||||
IF ( "${PLATFORM}" MATCHES rpi)
|
||||
find_package(BCM REQUIRED)
|
||||
ELSE()
|
||||
@@ -37,9 +38,9 @@ target_link_libraries( ${PROJECT_NAME}
|
||||
dispmanx-grabber
|
||||
${Dispmanx_LIBRARIES}
|
||||
ssdp
|
||||
Qt5::Core
|
||||
Qt5::Gui
|
||||
Qt5::Network
|
||||
Qt${QT_VERSION_MAJOR}::Core
|
||||
Qt${QT_VERSION_MAJOR}::Network
|
||||
Qt${QT_VERSION_MAJOR}::Widgets
|
||||
)
|
||||
|
||||
install ( TARGETS ${PROJECT_NAME} DESTINATION "share/hyperion/bin" COMPONENT "hyperion_dispmanx" )
|
||||
|
@@ -1,7 +1,7 @@
|
||||
cmake_minimum_required(VERSION 3.0.0)
|
||||
project(hyperion-framebuffer)
|
||||
|
||||
find_package(Qt5Widgets REQUIRED)
|
||||
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core Network Widgets REQUIRED)
|
||||
|
||||
include_directories(
|
||||
${CMAKE_CURRENT_BINARY_DIR}/../../libsrc/flatbufserver
|
||||
@@ -29,9 +29,10 @@ target_link_libraries( ${PROJECT_NAME}
|
||||
flatbuffers
|
||||
framebuffer-grabber
|
||||
ssdp
|
||||
Qt5::Core
|
||||
Qt5::Gui
|
||||
Qt5::Network
|
||||
Qt${QT_VERSION_MAJOR}::Core
|
||||
Qt${QT_VERSION_MAJOR}::Gui
|
||||
Qt${QT_VERSION_MAJOR}::Network
|
||||
Qt${QT_VERSION_MAJOR}::Widgets
|
||||
)
|
||||
|
||||
if (ENABLE_AMLOGIC)
|
||||
|
@@ -1,7 +1,7 @@
|
||||
cmake_minimum_required(VERSION 3.0.0)
|
||||
project(hyperion-osx)
|
||||
|
||||
find_package(Qt5Widgets REQUIRED)
|
||||
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core Gui Network Widgets REQUIRED)
|
||||
|
||||
include_directories(
|
||||
${CMAKE_CURRENT_BINARY_DIR}/../../libsrc/flatbufserver
|
||||
@@ -29,9 +29,10 @@ target_link_libraries( ${PROJECT_NAME}
|
||||
flatbuffers
|
||||
osx-grabber
|
||||
ssdp
|
||||
Qt5::Core
|
||||
Qt5::Gui
|
||||
Qt5::Network
|
||||
Qt${QT_VERSION_MAJOR}::Core
|
||||
Qt${QT_VERSION_MAJOR}::Gui
|
||||
Qt${QT_VERSION_MAJOR}::Network
|
||||
Qt${QT_VERSION_MAJOR}::Widgets
|
||||
)
|
||||
|
||||
install ( TARGETS ${PROJECT_NAME} DESTINATION "." COMPONENT "hyperion_osx" )
|
||||
|
@@ -1,7 +1,7 @@
|
||||
cmake_minimum_required(VERSION 3.0.0)
|
||||
project(hyperion-qt)
|
||||
|
||||
find_package(Qt5Widgets REQUIRED)
|
||||
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core Gui Network Widgets REQUIRED)
|
||||
|
||||
include_directories(
|
||||
${CMAKE_CURRENT_BINARY_DIR}/../../libsrc/flatbufserver
|
||||
@@ -35,9 +35,10 @@ target_link_libraries(${PROJECT_NAME}
|
||||
flatbufserver
|
||||
flatbuffers
|
||||
ssdp
|
||||
Qt5::Core
|
||||
Qt5::Widgets
|
||||
Qt5::Network
|
||||
Qt${QT_VERSION_MAJOR}::Core
|
||||
Qt${QT_VERSION_MAJOR}::Gui
|
||||
Qt${QT_VERSION_MAJOR}::Network
|
||||
Qt${QT_VERSION_MAJOR}::Widgets
|
||||
)
|
||||
|
||||
if(APPLE)
|
||||
|
@@ -1,7 +1,7 @@
|
||||
cmake_minimum_required(VERSION 3.0.0)
|
||||
project(hyperion-remote)
|
||||
|
||||
find_package(Qt5 COMPONENTS Core Gui Widgets Network REQUIRED)
|
||||
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core Network Widgets REQUIRED)
|
||||
|
||||
# The following I do not understand completely...
|
||||
# libQtCore.so uses some hardcoded library path inside which are incorrect after copying the file RPi file system
|
||||
@@ -34,9 +34,10 @@ target_link_libraries(${PROJECT_NAME}
|
||||
commandline
|
||||
hyperion-utils
|
||||
ssdp
|
||||
Qt5::Gui
|
||||
Qt5::Core
|
||||
Qt5::Network)
|
||||
Qt${QT_VERSION_MAJOR}::Core
|
||||
Qt${QT_VERSION_MAJOR}::Network
|
||||
Qt${QT_VERSION_MAJOR}::Widgets
|
||||
)
|
||||
|
||||
if (ENABLE_AMLOGIC)
|
||||
target_link_libraries(${PROJECT_NAME}
|
||||
|
@@ -1,7 +1,7 @@
|
||||
cmake_minimum_required(VERSION 3.0.0)
|
||||
project(hyperion-v4l2)
|
||||
|
||||
find_package(Qt5Widgets REQUIRED)
|
||||
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core Network Widgets REQUIRED)
|
||||
|
||||
include_directories(
|
||||
${CMAKE_CURRENT_BINARY_DIR}/../../libsrc/flatbufserver
|
||||
@@ -29,9 +29,9 @@ target_link_libraries(${PROJECT_NAME}
|
||||
flatbufserver
|
||||
flatbuffers
|
||||
ssdp
|
||||
Qt5::Core
|
||||
Qt5::Gui
|
||||
Qt5::Network
|
||||
Qt${QT_VERSION_MAJOR}::Core
|
||||
Qt${QT_VERSION_MAJOR}::Network
|
||||
Qt${QT_VERSION_MAJOR}::Widgets
|
||||
)
|
||||
|
||||
if (ENABLE_AMLOGIC)
|
||||
|
@@ -1,8 +1,9 @@
|
||||
cmake_minimum_required(VERSION 3.0.0)
|
||||
project(hyperion-x11)
|
||||
|
||||
find_package(Qt5Widgets REQUIRED)
|
||||
find_package(X11 REQUIRED)
|
||||
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core Gui Network Widgets REQUIRED)
|
||||
|
||||
|
||||
include_directories(
|
||||
${CMAKE_CURRENT_BINARY_DIR}/../../libsrc/flatbufserver
|
||||
@@ -38,10 +39,10 @@ target_link_libraries(${PROJECT_NAME}
|
||||
${X11_LIBRARIES}
|
||||
${X11_Xrandr_LIB}
|
||||
${X11_Xrender_LIB}
|
||||
Qt5::Core
|
||||
Qt5::Gui
|
||||
Qt5::Network
|
||||
Qt5::Widgets
|
||||
Qt${QT_VERSION_MAJOR}::Core
|
||||
Qt${QT_VERSION_MAJOR}::Gui
|
||||
Qt${QT_VERSION_MAJOR}::Network
|
||||
Qt${QT_VERSION_MAJOR}::Widgets
|
||||
)
|
||||
|
||||
install ( TARGETS ${PROJECT_NAME} DESTINATION "share/hyperion/bin" COMPONENT "hyperion_x11" )
|
||||
|
@@ -1,6 +1,8 @@
|
||||
cmake_minimum_required(VERSION 3.0.0)
|
||||
project(hyperion-xcb)
|
||||
|
||||
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core Network Widgets REQUIRED)
|
||||
|
||||
include_directories(
|
||||
${CMAKE_CURRENT_BINARY_DIR}/../../libsrc/flatbufserver
|
||||
${FLATBUFFERS_INCLUDE_DIRS}
|
||||
@@ -27,6 +29,9 @@ target_link_libraries(${PROJECT_NAME}
|
||||
flatbuffers
|
||||
xcb-grabber
|
||||
ssdp
|
||||
Qt${QT_VERSION_MAJOR}::Core
|
||||
Qt${QT_VERSION_MAJOR}::Network
|
||||
Qt${QT_VERSION_MAJOR}::Widgets
|
||||
)
|
||||
|
||||
install (TARGETS ${PROJECT_NAME} DESTINATION "share/hyperion/bin" COMPONENT "hyperion_xcb")
|
||||
|
@@ -12,7 +12,7 @@ else()
|
||||
include_directories(${PYTHON_INCLUDE_DIRS} ${PYTHON_INCLUDE_DIRS}/..)
|
||||
endif()
|
||||
|
||||
find_package(Qt5Widgets REQUIRED)
|
||||
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core Network Gui Widgets REQUIRED)
|
||||
|
||||
# generate windows .rc file for this binary
|
||||
if (WIN32)
|
||||
@@ -56,7 +56,10 @@ target_link_libraries(${PROJECT_NAME}
|
||||
database
|
||||
python
|
||||
resources
|
||||
Qt5::Widgets
|
||||
Qt${QT_VERSION_MAJOR}::Core
|
||||
Qt${QT_VERSION_MAJOR}::Gui
|
||||
Qt${QT_VERSION_MAJOR}::Network
|
||||
Qt${QT_VERSION_MAJOR}::Widgets
|
||||
)
|
||||
|
||||
if (NOT CMAKE_VERSION VERSION_LESS "3.12")
|
||||
@@ -71,7 +74,7 @@ endif (ENABLE_AVAHI)
|
||||
|
||||
if (ENABLE_AMLOGIC)
|
||||
target_link_libraries(${PROJECT_NAME}
|
||||
Qt5::Core
|
||||
#Qt${QT_VERSION_MAJOR}::Core
|
||||
pcre16 dl z
|
||||
)
|
||||
endif(ENABLE_AMLOGIC)
|
||||
@@ -172,12 +175,20 @@ endif()
|
||||
|
||||
# Deploy Qt DLLs into the binary folder.
|
||||
# This is necessary for starting the application from within the IDE
|
||||
|
||||
if (WIN32)
|
||||
get_target_property(QMAKE_EXECUTABLE Qt5::qmake IMPORTED_LOCATION)
|
||||
get_target_property(QT_QMAKE_EXECUTABLE Qt${QT_VERSION_MAJOR}::qmake IMPORTED_LOCATION)
|
||||
get_filename_component(QT_BIN_DIR "${QT_QMAKE_EXECUTABLE}" DIRECTORY)
|
||||
find_program(WINDEPLOYQT_EXECUTABLE windeployqt HINTS "${QT_BIN_DIR}")
|
||||
set(WINDEPLOYQT_PARAMS --verbose 0 --no-compiler-runtime --no-opengl-sw --no-system-d3d-compiler)
|
||||
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD COMMAND ${WINDEPLOYQT_EXECUTABLE} ${WINDEPLOYQT_PARAMS} "$<TARGET_FILE:${PROJECT_NAME}>")
|
||||
if (NOT WINDEPLOYQT_EXECUTABLE)
|
||||
find_program(WINDEPLOYQT_EXECUTABLE windeployqt)
|
||||
endif()
|
||||
|
||||
if (WINDEPLOYQT_EXECUTABLE AND NOT CMAKE_GITHUB_ACTION)
|
||||
set(WINDEPLOYQT_PARAMS_RUNTIME --verbose 0 --no-compiler-runtime --no-opengl-sw --no-system-d3d-compiler)
|
||||
message(STATUS "Found windeployqt: ${WINDEPLOYQT_EXECUTABLE} PATH_HINT:${QT_BIN_DIR}")
|
||||
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD COMMAND ${WINDEPLOYQT_EXECUTABLE} ${WINDEPLOYQT_PARAMS_RUNTIME} "$<TARGET_FILE:${PROJECT_NAME}>")
|
||||
endif()
|
||||
endif(WIN32)
|
||||
|
||||
if(ENABLE_DEPLOY_DEPENDENCIES)
|
||||
|
@@ -3,7 +3,7 @@
|
||||
#include <QByteArray>
|
||||
#include <QDir>
|
||||
#include <QFile>
|
||||
#include <QRegExp>
|
||||
#include <QRegularExpression>
|
||||
#include <QString>
|
||||
#include <QTextStream>
|
||||
|
||||
@@ -40,7 +40,7 @@ QStringList getProcessIdsByProcessName(const char *processName)
|
||||
/* Walk through the snapshot of processes */
|
||||
do
|
||||
{
|
||||
if (strcmp(processName, pe32.szExeFile) == 0)
|
||||
if (QString::compare(processName, QString::fromUtf16(reinterpret_cast<char16_t*>(pe32.szExeFile)), Qt::CaseInsensitive) == 0)
|
||||
listOfPids.append(QString::number(pe32.th32ProcessID));
|
||||
|
||||
} while(Process32Next(hProcessSnap, &pe32));
|
||||
@@ -54,8 +54,8 @@ QStringList getProcessIdsByProcessName(const char *processName)
|
||||
dir.setSorting(QDir::Name | QDir::Reversed);
|
||||
|
||||
for (const QString & pid : dir.entryList()) {
|
||||
QRegExp regexp("\\d*");
|
||||
if (!regexp.exactMatch(pid))
|
||||
QRegularExpression regexp("^\\d*$");
|
||||
if (!regexp.match(pid).hasMatch())
|
||||
{
|
||||
/* Not a number, can not be PID */
|
||||
continue;
|
||||
|
@@ -66,7 +66,9 @@ void SysTray::iconActivated(QSystemTrayIcon::ActivationReason reason)
|
||||
|
||||
void SysTray::createTrayIcon()
|
||||
{
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||
QGuiApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
|
||||
#endif
|
||||
|
||||
quitAction = new QAction(tr("&Quit"), this);
|
||||
quitAction->setIcon(QPixmap(":/quit.svg"));
|
||||
|
Reference in New Issue
Block a user