From ab186cb749fac88439f68de0710fe34b7937826f Mon Sep 17 00:00:00 2001 From: awawa-dev <69086569+awawa-dev@users.noreply.github.com> Date: Fri, 31 May 2024 19:49:54 +0200 Subject: [PATCH] Remove all of the QT plugins --- CMakeLists.txt | 16 ---- HyperhdrConfig.h.in | 3 - cmake/Dependencies.cmake | 120 ++----------------------- sources/db/CMakeLists.txt | 4 - sources/db/DBManager.cpp | 5 -- sources/hyperhdr-remote/CMakeLists.txt | 4 - sources/hyperhdr/CMakeLists.txt | 4 - sources/hyperhdr/HyperHdrDaemon.cpp | 6 -- 8 files changed, 9 insertions(+), 153 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 533f35a62..2587eedc9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -42,7 +42,6 @@ SET ( DEFAULT_SOUNDCAPMACOS OFF ) SET ( DEFAULT_CEC OFF ) SET ( DEFAULT_BONJOUR ON ) SET ( DEFAULT_MQTT ON ) -SET ( DEFAULT_STATIC_QT_PLUGINS OFF ) SET ( DEFAULT_PRECOMPILED_HEADERS ON ) SET ( DEFAULT_XZ ON ) SET ( DEFAULT_POWER_MANAGEMENT ON ) @@ -432,9 +431,6 @@ colorMe("ENABLE_XZ = " ${ENABLE_XZ}) message( STATUS "\n${CyanColor}BUILD FEATURES${ColorReset}") -option(USE_STATIC_QT_PLUGINS "Enable static QT plugins" ${DEFAULT_STATIC_QT_PLUGINS}) -colorMe("USE_STATIC_QT_PLUGINS = " ${USE_STATIC_QT_PLUGINS}) - option(USE_PRECOMPILED_HEADERS "Enable precompiled headers (PCH)" ${DEFAULT_PRECOMPILED_HEADERS}) colorMe("USE_PRECOMPILED_HEADERS = " ${USE_PRECOMPILED_HEADERS}) @@ -580,18 +576,6 @@ find_package(TurboJPEG REQUIRED) message( STATUS "TURBOJPEG_LIBRARY_DIRS=${TurboJPEG_LIBRARY}") message( STATUS "TURBOJPEG_INCLUDE_DIRS=${TurboJPEG_INCLUDE_DIRS}") -# Embedded QT plugins -if (USE_STATIC_QT_PLUGINS) - foreach(sqlPlugin ${Qt${Qt_VERSION}Sql_PLUGINS} Qt${Qt_VERSION}::Sql) - message( STATUS "PLUGIN=${sqlPlugin}") - get_target_property(file ${sqlPlugin} LOCATION) - if (NOT IS_SYMLINK ${file}) - message("Using static QT plugin: " ${file}) - set(STATIC_QT_PLUGINS_LIBS ${STATIC_QT_PLUGINS_LIBS} ${file}) - endif() - endforeach() -endif() - if (WIN32) if(NOT DEFINED CMAKE_LIBRARY_OUTPUT_DIRECTORY) set(CMAKE_LIBRARY_OUTPUT_DIRECTORY diff --git a/HyperhdrConfig.h.in b/HyperhdrConfig.h.in index 589aa7bc6..5dd30a56e 100644 --- a/HyperhdrConfig.h.in +++ b/HyperhdrConfig.h.in @@ -1,8 +1,5 @@ // Generated config file -// support for static QT plugins -#cmakedefine USE_STATIC_QT_PLUGINS - // cec support #cmakedefine ENABLE_CEC diff --git a/cmake/Dependencies.cmake b/cmake/Dependencies.cmake index 8e91dc85f..da9398aa7 100644 --- a/cmake/Dependencies.cmake +++ b/cmake/Dependencies.cmake @@ -16,18 +16,6 @@ macro(DeployApple TARGET) install(FILES "${PROJECT_SOURCE_DIR}/LICENSE" DESTINATION "hyperhdr.app/Contents/Resources" COMPONENT "HyperHDR") install(FILES "${PROJECT_SOURCE_DIR}/3RD_PARTY_LICENSES" DESTINATION "hyperhdr.app/Contents/Resources" COMPONENT "HyperHDR") - if ( Qt5Core_FOUND ) - get_target_property(MYQT_QMAKE_EXECUTABLE ${Qt5Core_QMAKE_EXECUTABLE} IMPORTED_LOCATION) - else() - SET (MYQT_QMAKE_EXECUTABLE "${_qt_import_prefix}/../../../bin/qmake") - endif() - - execute_process( - COMMAND ${MYQT_QMAKE_EXECUTABLE} -query QT_INSTALL_PLUGINS - OUTPUT_VARIABLE MYQT_PLUGINS_DIR - OUTPUT_STRIP_TRAILING_WHITESPACE - ) - install(CODE "set(MYQT_PLUGINS_DIR \"${MYQT_PLUGINS_DIR}\")" COMPONENT "HyperHDR") install(CODE "set(MY_DEPENDENCY_PATHS \"${TARGET_FILE}\")" COMPONENT "HyperHDR") install(CODE "set(MY_SYSTEM_LIBS_SKIP \"${SYSTEM_LIBS_SKIP}\")" COMPONENT "HyperHDR") install(CODE "set(SCOPE_Qt_VERSION ${Qt_VERSION})" COMPONENT "HyperHDR") @@ -128,40 +116,11 @@ macro(DeployApple TARGET) list(LENGTH _u_deps _u_length) if("${_u_length}" GREATER 0) message(WARNING "Unresolved dependencies detected!") - endif() - - foreach(PLUGIN "sqldrivers") - if(EXISTS ${MYQT_PLUGINS_DIR}/${PLUGIN}) - file(GLOB files "${MYQT_PLUGINS_DIR}/${PLUGIN}/*") - foreach(file ${files}) - file(GET_RUNTIME_DEPENDENCIES - EXECUTABLES ${file} - RESOLVED_DEPENDENCIES_VAR PLUGINS - UNRESOLVED_DEPENDENCIES_VAR _u_deps - ) - - foreach(DEPENDENCY ${PLUGINS}) - file(INSTALL - DESTINATION "${CMAKE_INSTALL_PREFIX}/hyperhdr.app/Contents/lib" - TYPE SHARED_LIBRARY - FILES ${DEPENDENCY} - ) - endforeach() - - get_filename_component(singleQtLib ${file} NAME) - list(APPEND MYQT_PLUGINS "${CMAKE_INSTALL_PREFIX}/hyperhdr.app/Contents/plugins/${PLUGIN}/${singleQtLib}") - file(INSTALL - DESTINATION "${CMAKE_INSTALL_PREFIX}/hyperhdr.app/Contents/plugins/${PLUGIN}" - TYPE SHARED_LIBRARY - FILES ${file} - ) - - endforeach() - endif() + endif() endforeach() include(BundleUtilities) - fixup_bundle("${CMAKE_INSTALL_PREFIX}/hyperhdr.app" "${MYQT_PLUGINS}" "${CMAKE_INSTALL_PREFIX}/hyperhdr.app/Contents/lib") + fixup_bundle("${CMAKE_INSTALL_PREFIX}/hyperhdr.app" "${CMAKE_INSTALL_PREFIX}/hyperhdr.app/Contents/lib") file(REMOVE_RECURSE "${CMAKE_INSTALL_PREFIX}/hyperhdr.app/Contents/lib") file(REMOVE_RECURSE "${CMAKE_INSTALL_PREFIX}/share") @@ -172,8 +131,6 @@ macro(DeployApple TARGET) cmake_policy(SET CMP0009 NEW) message( "Re-signing bundle's components...") file(GLOB_RECURSE libSignFramework LIST_DIRECTORIES false "${CMAKE_INSTALL_PREFIX}/hyperhdr.app/Contents/Frameworks/*") - file(GLOB_RECURSE libSignPlugins LIST_DIRECTORIES false "${CMAKE_INSTALL_PREFIX}/hyperhdr.app/Contents/plugins/*") - list(APPEND libSignFramework ${libSignPlugins}) list(APPEND libSignFramework "${CMAKE_INSTALL_PREFIX}/hyperhdr.app/Contents/MacOS/hyperhdr") foreach(_fileToSign ${libSignFramework}) string(FIND ${_fileToSign} ".framework/Resources" isResources) @@ -244,25 +201,6 @@ macro(DeployUnix TARGET) message( WARNING "OpenSSL NOT found (https instance will not work)") endif() - # Detect the Qt5 plugin directory, source: https://github.com/lxde/lxqt-qtplugin/blob/master/src/CMakeLists.txt - if ( Qt5Core_FOUND ) - get_target_property(QT_QMAKE_EXECUTABLE ${Qt5Core_QMAKE_EXECUTABLE} IMPORTED_LOCATION) - execute_process( - COMMAND ${QT_QMAKE_EXECUTABLE} -query QT_INSTALL_PLUGINS - OUTPUT_VARIABLE QT_PLUGINS_DIR - OUTPUT_STRIP_TRAILING_WHITESPACE - ) - elseif ( TARGET Qt${QT_VERSION_MAJOR}::qmake ) - get_target_property(QT_QMAKE_EXECUTABLE Qt${QT_VERSION_MAJOR}::qmake IMPORTED_LOCATION) - execute_process( - COMMAND ${QT_QMAKE_EXECUTABLE} -query QT_INSTALL_PLUGINS - OUTPUT_VARIABLE QT_PLUGINS_DIR - OUTPUT_STRIP_TRAILING_WHITESPACE - ) - endif() - - message(STATUS "QT plugin path: ${QT_PLUGINS_DIR}") - # Copy CEC lib if (CEC_FOUND) find_library(XRANDR_LIBRARY NAMES Xrandr libXrandr libXrandr.so.2) @@ -301,18 +239,9 @@ macro(DeployUnix TARGET) endforeach() endif() - # Create a qt.conf file in 'share/hyperhdr/bin' to override hard-coded search paths in Qt plugins - file(WRITE "${CMAKE_BINARY_DIR}/qt.conf" "[Paths]\nPlugins=../lib/\n") - install( - FILES "${CMAKE_BINARY_DIR}/qt.conf" - DESTINATION "share/hyperhdr/bin" - COMPONENT "HyperHDR" - ) - # install CODE install(CODE "set(TARGET_FILE \"${TARGET_FILE}\")" COMPONENT "HyperHDR") install(CODE "set(PREREQUISITE_LIBS \"${PREREQUISITE_LIBS}\")" COMPONENT "HyperHDR") - install(CODE "set(QT_PLUGINS_DIR \"${QT_PLUGINS_DIR}\")" COMPONENT "HyperHDR") install(CODE [[ @@ -382,40 +311,16 @@ macro(DeployUnix TARGET) file(GET_RUNTIME_DEPENDENCIES RESOLVED_DEPENDENCIES_VAR SYS_DEPENDENCIES EXECUTABLES $) - foreach(systraLib ${SYS_DEPENDENCIES}) - string(FIND ${systraLib} "libayatana" _sysindex) + foreach(systrayLib ${SYS_DEPENDENCIES}) + string(FIND ${systrayLib} "libayatana" _sysindex) if (${_sysindex} GREATER -1) - list(APPEND DEPENDENCIES ${systraLib}) + list(APPEND DEPENDENCIES ${systrayLib}) endif() - string(FIND ${systraLib} "libdbusmenu" _sysDBusindex) + string(FIND ${systrayLib} "libdbusmenu" _sysDBusindex) if (${_sysDBusindex} GREATER -1) - list(APPEND DEPENDENCIES ${systraLib}) + list(APPEND DEPENDENCIES ${systrayLib}) endif() - endforeach() - - - # Copy Qt plugins to 'share/hyperhdr/lib' - foreach(PLUGIN "sqldrivers") - #message(WARNING "Collecting Dependencies for QT plugin folder: ${PLUGIN}") - if(EXISTS ${QT_PLUGINS_DIR}/${PLUGIN}) - file(GLOB files "${QT_PLUGINS_DIR}/${PLUGIN}/*") - foreach(file ${files}) - file(GET_RUNTIME_DEPENDENCIES - RESOLVED_DEPENDENCIES_VAR QT_DEPENDENCIES - EXECUTABLES ${file} - ) - #message(WARNING "${file} => ${DEPENDENCIES} <= ${QT_DEPENDENCIES}") - list(APPEND DEPENDENCIES ${QT_DEPENDENCIES}) - - file(INSTALL - DESTINATION "${CMAKE_INSTALL_PREFIX}/share/hyperhdr/lib/${PLUGIN}" - TYPE SHARED_LIBRARY - FILES ${file} - ) - - endforeach() - endif() - endforeach() + endforeach() endif() @@ -483,6 +388,7 @@ macro(DeployWindows TARGET) --dry-run ${WINDEPLOYQT_PARAMS} --list mapping + --no-plugins "${TARGET_FILE}" OUTPUT_VARIABLE DEPS OUTPUT_STRIP_TRAILING_WHITESPACE @@ -521,14 +427,6 @@ macro(DeployWindows TARGET) # Copy MQTT install(CODE [[ file(INSTALL FILES $ DESTINATION "${CMAKE_INSTALL_PREFIX}/bin" TYPE SHARED_LIBRARY) ]] COMPONENT "HyperHDR") - # Create a qt.conf file in 'bin' to override hard-coded search paths in Qt plugins - file(WRITE "${CMAKE_BINARY_DIR}/qt.conf" "[Paths]\nPlugins=../lib/\n") - install( - FILES "${CMAKE_BINARY_DIR}/qt.conf" - DESTINATION "bin" - COMPONENT "HyperHDR" - ) - execute_process( COMMAND ${SEVENZIP_BIN} e ${PROJECT_SOURCE_DIR}/resources/lut/lut_lin_tables.tar.xz -o${CMAKE_CURRENT_BINARY_DIR} -aoa -y RESULT_VARIABLE STATUS diff --git a/sources/db/CMakeLists.txt b/sources/db/CMakeLists.txt index 11471d4e3..defa581b0 100644 --- a/sources/db/CMakeLists.txt +++ b/sources/db/CMakeLists.txt @@ -15,10 +15,6 @@ target_link_libraries(database Qt${Qt_VERSION}::Sql ) -if (USE_STATIC_QT_PLUGINS) - target_link_libraries(database ${STATIC_QT_PLUGINS_LIBS}) -endif() - if(USE_PRECOMPILED_HEADERS AND COMMAND target_precompile_headers) target_precompile_headers(database REUSE_FROM precompiled_hyperhdr_headers) endif() diff --git a/sources/db/DBManager.cpp b/sources/db/DBManager.cpp index 135b6b860..db51c42e1 100644 --- a/sources/db/DBManager.cpp +++ b/sources/db/DBManager.cpp @@ -44,11 +44,6 @@ #include // Required to determine the cmake options -#ifdef USE_STATIC_QT_PLUGINS - #include - Q_IMPORT_PLUGIN(QSQLiteDriverPlugin) -#endif - QFileInfo DBManager::_databaseName; QThreadStorage DBManager::_databasePool; diff --git a/sources/hyperhdr-remote/CMakeLists.txt b/sources/hyperhdr-remote/CMakeLists.txt index d4c1d7ca2..7c326d8f4 100644 --- a/sources/hyperhdr-remote/CMakeLists.txt +++ b/sources/hyperhdr-remote/CMakeLists.txt @@ -30,10 +30,6 @@ if(NOT WIN32) set_target_properties(${PROJECT_NAME} PROPERTIES LINK_FLAGS_RELEASE -s) endif() -if (USE_STATIC_QT_PLUGINS) - target_link_libraries(${PROJECT_NAME} ${STATIC_QT_PLUGINS_LIBS}) -endif() - target_link_libraries(${PROJECT_NAME} effectengine commandline diff --git a/sources/hyperhdr/CMakeLists.txt b/sources/hyperhdr/CMakeLists.txt index dd20405f0..96befda39 100644 --- a/sources/hyperhdr/CMakeLists.txt +++ b/sources/hyperhdr/CMakeLists.txt @@ -41,10 +41,6 @@ else() PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) endif() -if (USE_STATIC_QT_PLUGINS) - target_link_libraries(hyperhdr ${STATIC_QT_PLUGINS_LIBS}) -endif() - if(ENABLE_XZ) if (LIBLZMA_FOUND) target_link_libraries(hyperhdr LibLZMA::LibLZMA) diff --git a/sources/hyperhdr/HyperHdrDaemon.cpp b/sources/hyperhdr/HyperHdrDaemon.cpp index 546fdcaf8..152b7fcdc 100644 --- a/sources/hyperhdr/HyperHdrDaemon.cpp +++ b/sources/hyperhdr/HyperHdrDaemon.cpp @@ -28,12 +28,6 @@ #include #include -#ifdef USE_STATIC_QT_PLUGINS - #include - Q_IMPORT_PLUGIN(QJpegPlugin) - Q_IMPORT_PLUGIN(QGifPlugin) -#endif - #include #include