Commit cfb773dba21697bb3e4f329bae1f39a9f65a2ef7
1 parent
60803b16
Dependency management improvements and additions
Showing
2 changed files
with
42 additions
and
45 deletions
CMakeLists.txt
| @@ -78,9 +78,9 @@ set(QT_DEPENDENCIES ${QT_DEPENDENCIES} Concurrent Core) | @@ -78,9 +78,9 @@ set(QT_DEPENDENCIES ${QT_DEPENDENCIES} Concurrent Core) | ||
| 78 | if(NOT BR_EMBEDDED) | 78 | if(NOT BR_EMBEDDED) |
| 79 | set(QT_DEPENDENCIES ${QT_DEPENDENCIES} Gui Network Sql Widgets Xml) | 79 | set(QT_DEPENDENCIES ${QT_DEPENDENCIES} Gui Network Sql Widgets Xml) |
| 80 | endif() | 80 | endif() |
| 81 | -foreach(QT_DEPENDENCY ${QT_DEPENDENCIES}) | ||
| 82 | - find_package(Qt5${QT_DEPENDENCY}) | ||
| 83 | -endforeach() | 81 | + |
| 82 | +find_package(Qt5 COMPONENTS ${QT_DEPENDENCIES} REQUIRED) | ||
| 83 | + | ||
| 84 | set(BR_THIRDPARTY_LIBS ${BR_THIRDPARTY_LIBS} ${Qt5Core_QTMAIN_LIBRARIES}) | 84 | set(BR_THIRDPARTY_LIBS ${BR_THIRDPARTY_LIBS} ${Qt5Core_QTMAIN_LIBRARIES}) |
| 85 | if(IOS) | 85 | if(IOS) |
| 86 | list(APPEND BR_THIRDPARTY_LIBS "${_qt5Core_install_prefix}/lib/libqtpcre.a") | 86 | list(APPEND BR_THIRDPARTY_LIBS "${_qt5Core_install_prefix}/lib/libqtpcre.a") |
share/openbr/cmake/InstallDependencies.cmake
| @@ -45,16 +45,11 @@ function(install_qt_library lib) | @@ -45,16 +45,11 @@ function(install_qt_library lib) | ||
| 45 | elseif(CMAKE_HOST_APPLE) | 45 | elseif(CMAKE_HOST_APPLE) |
| 46 | install(DIRECTORY ${_qt5Core_install_prefix}/lib/Qt${lib}.framework DESTINATION lib) | 46 | install(DIRECTORY ${_qt5Core_install_prefix}/lib/Qt${lib}.framework DESTINATION lib) |
| 47 | else() | 47 | else() |
| 48 | - if(CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64" AND NOT ANDROID AND NOT IOS) | ||
| 49 | - set(QT_MULTIARCH "aarch64-linux-gnu/") | ||
| 50 | - else() | ||
| 51 | - set(QT_MULTIARCH "") | ||
| 52 | - endif() | ||
| 53 | - | ||
| 54 | - install(FILES ${_qt5Core_install_prefix}/lib/${QT_MULTIARCH}libQt5${lib}.so.5.${Qt5Core_VERSION_MINOR}.${Qt5Core_VERSION_PATCH} DESTINATION lib) | ||
| 55 | - install(FILES ${_qt5Core_install_prefix}/lib/${QT_MULTIARCH}libQt5${lib}.so.5.${Qt5Core_VERSION_MINOR} DESTINATION lib) | ||
| 56 | - install(FILES ${_qt5Core_install_prefix}/lib/${QT_MULTIARCH}libQt5${lib}.so.5 DESTINATION lib) | ||
| 57 | - install(FILES ${_qt5Core_install_prefix}/lib/${QT_MULTIARCH}libQt5${lib}.so DESTINATION lib) | 48 | + set(Qt5_LIB_DIR "${Qt5_DIR}/../..") |
| 49 | + install(FILES ${Qt5_LIB_DIR}/libQt5${lib}.so.5.${Qt5_VERSION_MINOR}.${Qt5_VERSION_PATCH} DESTINATION lib) | ||
| 50 | + install(FILES ${Qt5_LIB_DIR}/libQt5${lib}.so.5.${Qt5_VERSION_MINOR} DESTINATION lib) | ||
| 51 | + install(FILES ${Qt5_LIB_DIR}/libQt5${lib}.so.5 DESTINATION lib) | ||
| 52 | + install(FILES ${Qt5_LIB_DIR}/libQt5${lib}.so DESTINATION lib) | ||
| 58 | endif() | 53 | endif() |
| 59 | endif() | 54 | endif() |
| 60 | endfunction() | 55 | endfunction() |
| @@ -68,13 +63,11 @@ endfunction() | @@ -68,13 +63,11 @@ endfunction() | ||
| 68 | # Qt Plugins | 63 | # Qt Plugins |
| 69 | function(install_qt_imageformats) | 64 | function(install_qt_imageformats) |
| 70 | if(${BR_INSTALL_DEPENDENCIES}) | 65 | if(${BR_INSTALL_DEPENDENCIES}) |
| 71 | - if(CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64" AND NOT ANDROID AND NOT IOS) | ||
| 72 | - set(QT_MULTIARCH "/lib/aarch64-linux-gnu/qt5") | ||
| 73 | - else() | ||
| 74 | - set(QT_MULTIARCH "") | 66 | + set(Qt5_PLUGIN_DIR "${Qt5_DIR}/../../qt5/plugins") |
| 67 | + if (NOT EXISTS ${Qt5_PLUGIN_DIR}) | ||
| 68 | + set(Qt5_PLUGIN_DIR "${Qt5_DIR}/../../../plugins") | ||
| 75 | endif() | 69 | endif() |
| 76 | - | ||
| 77 | - set(IMAGE_FORMATS_DIR "${_qt5Core_install_prefix}${QT_MULTIARCH}/plugins/imageformats") | 70 | + set(IMAGE_FORMATS_DIR "${Qt5_PLUGIN_DIR}/imageformats") |
| 78 | if(ANDROID) | 71 | if(ANDROID) |
| 79 | set(INSTALL_DEPENDENCIES_PREFIX "lib") | 72 | set(INSTALL_DEPENDENCIES_PREFIX "lib") |
| 80 | set(INSTALL_DEPENDENCIES_EXTENSION ".so") | 73 | set(INSTALL_DEPENDENCIES_EXTENSION ".so") |
| @@ -101,13 +94,10 @@ endfunction() | @@ -101,13 +94,10 @@ endfunction() | ||
| 101 | 94 | ||
| 102 | function(install_qt_audio) | 95 | function(install_qt_audio) |
| 103 | if(${BR_INSTALL_DEPENDENCIES}) | 96 | if(${BR_INSTALL_DEPENDENCIES}) |
| 104 | - if(CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64" AND NOT ANDROID AND NOT IOS) | ||
| 105 | - set(QT_MULTIARCH "/lib/aarch64-linux-gnu/qt5") | ||
| 106 | - else() | ||
| 107 | - set(QT_MULTIARCH "") | 97 | + set(Qt5_PLUGIN_DIR "${Qt5_DIR}/../../qt5/plugins") |
| 98 | + if (NOT EXISTS ${Qt5_PLUGIN_DIR}) | ||
| 99 | + set(Qt5_PLUGIN_DIR "${Qt5_DIR}/../../../plugins") | ||
| 108 | endif() | 100 | endif() |
| 109 | - | ||
| 110 | - set(AUDIO_DIR "${_qt5Core_install_prefix}${QT_MULTIARCH}/plugins/audio") | ||
| 111 | if(CMAKE_HOST_WIN32) | 101 | if(CMAKE_HOST_WIN32) |
| 112 | install(FILES ${AUDIO_DIR}/qtaudio_windows.dll DESTINATION bin/audio) | 102 | install(FILES ${AUDIO_DIR}/qtaudio_windows.dll DESTINATION bin/audio) |
| 113 | elseif(CMAKE_HOST_APPLE) | 103 | elseif(CMAKE_HOST_APPLE) |
| @@ -119,6 +109,23 @@ function(install_qt_audio) | @@ -119,6 +109,23 @@ function(install_qt_audio) | ||
| 119 | endif() | 109 | endif() |
| 120 | endfunction() | 110 | endfunction() |
| 121 | 111 | ||
| 112 | +function(install_qt_sql) | ||
| 113 | + if(${BR_INSTALL_DEPENDENCIES}) | ||
| 114 | + set(Qt5_PLUGIN_DIR "${Qt5_DIR}/../../qt5/plugins") | ||
| 115 | + if (NOT EXISTS ${Qt5_PLUGIN_DIR}) | ||
| 116 | + set(Qt5_PLUGIN_DIR "${Qt5_DIR}/../../../plugins") | ||
| 117 | + endif() | ||
| 118 | + set(SQL_DIR "${Qt5_PLUGIN_DIR}/sqldrivers") | ||
| 119 | + if(CMAKE_HOST_WIN32) | ||
| 120 | + install(FILES ${SQL_DIR}/qsqlite.dll DESTINATION bin/sqldrivers) | ||
| 121 | + elseif(CMAKE_HOST_APPLE) | ||
| 122 | + install(FILES ${SQL_DIR}/libqsqlite.dylib DESTINATION bin/sqldrivers) | ||
| 123 | + else() | ||
| 124 | + install(FILES ${SQL_DIR}/libqsqlite.so DESTINATION bin/sqldrivers) | ||
| 125 | + endif() | ||
| 126 | + endif() | ||
| 127 | +endfunction() | ||
| 128 | + | ||
| 122 | function(install_qt_platforms) | 129 | function(install_qt_platforms) |
| 123 | if(${BR_INSTALL_DEPENDENCIES}) | 130 | if(${BR_INSTALL_DEPENDENCIES}) |
| 124 | if(ANDROID) | 131 | if(ANDROID) |
| @@ -131,18 +138,16 @@ function(install_qt_platforms) | @@ -131,18 +138,16 @@ function(install_qt_platforms) | ||
| 131 | install(FILES ${_qt5Core_install_prefix}/plugins/platforms/libqcocoa.dylib | 138 | install(FILES ${_qt5Core_install_prefix}/plugins/platforms/libqcocoa.dylib |
| 132 | DESTINATION bin/platforms) | 139 | DESTINATION bin/platforms) |
| 133 | else() | 140 | else() |
| 134 | - if(CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64" AND NOT ANDROID AND NOT IOS) | ||
| 135 | - set(QT_MULTIARCH "/lib/aarch64-linux-gnu/qt5") | ||
| 136 | - else() | ||
| 137 | - set(QT_MULTIARCH "") | 141 | + set(Qt5_PLUGIN_DIR "${Qt5_DIR}/../../qt5/plugins") |
| 142 | + if (NOT EXISTS ${Qt5_PLUGIN_DIR}) | ||
| 143 | + set(Qt5_PLUGIN_DIR "${Qt5_DIR}/../../../plugins") | ||
| 138 | endif() | 144 | endif() |
| 139 | - | ||
| 140 | - install(FILES ${_qt5Core_install_prefix}${QT_MULTIARCH}/plugins/platforms/libqlinuxfb.so | 145 | + install(FILES ${Qt5_PLUGIN_DIR}/platforms/libqlinuxfb.so |
| 141 | DESTINATION bin/platforms) | 146 | DESTINATION bin/platforms) |
| 142 | 147 | ||
| 143 | - if(EXISTS ${_qt5Core_install_prefix}${QT_MULTIARCH}/plugins/platforms/libqxcb.so) | 148 | + if(EXISTS ${Qt5_PLUGIN_DIR}/platforms/libqxcb.so) |
| 144 | install_qt_library(XcbQpa) | 149 | install_qt_library(XcbQpa) |
| 145 | - install(FILES ${_qt5Core_install_prefix}${QT_MULTIARCH}/plugins/platforms/libqxcb.so | 150 | + install(FILES ${Qt5_PLUGIN_DIR}/platforms/libqxcb.so |
| 146 | DESTINATION bin/platforms) | 151 | DESTINATION bin/platforms) |
| 147 | endif() | 152 | endif() |
| 148 | endif() | 153 | endif() |
| @@ -167,22 +172,14 @@ function(install_qt_misc) | @@ -167,22 +172,14 @@ function(install_qt_misc) | ||
| 167 | install(FILES ${_qt5Core_install_prefix}/jar/QtAndroid-bundled.jar | 172 | install(FILES ${_qt5Core_install_prefix}/jar/QtAndroid-bundled.jar |
| 168 | DESTINATION java) | 173 | DESTINATION java) |
| 169 | elseif(UNIX AND NOT APPLE) | 174 | elseif(UNIX AND NOT APPLE) |
| 170 | - if(CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64" AND NOT ANDROID AND NOT IOS) | ||
| 171 | - set(QT_MULTIARCH "aarch64-linux-gnu/") | ||
| 172 | - else() | ||
| 173 | - set(QT_MULTIARCH "") | ||
| 174 | - endif() | ||
| 175 | - | ||
| 176 | - file(GLOB icudlls ${_qt5Core_install_prefix}/lib/${QT_MULTIARCH}libicu*.so*) | 175 | + set(Qt5_LIB_DIR "${Qt5_DIR}/../..") |
| 176 | + file(GLOB icudlls "${Qt5_LIB_DIR}/libicu*.so*") | ||
| 177 | if(NOT icudlls) | 177 | if(NOT icudlls) |
| 178 | file(GLOB icudlls /usr/lib/x86_64-linux-gnu/libicu*.so*) | 178 | file(GLOB icudlls /usr/lib/x86_64-linux-gnu/libicu*.so*) |
| 179 | endif() | 179 | endif() |
| 180 | install(FILES ${icudlls} DESTINATION lib) | 180 | install(FILES ${icudlls} DESTINATION lib) |
| 181 | - | ||
| 182 | - file(GLOB libpng12 /lib/x86_64-linux-gnu/libpng12.so*) | ||
| 183 | - if(libpng12) | ||
| 184 | - install(FILES ${libpng12} DESTINATION lib) | ||
| 185 | - endif() | 181 | + file(GLOB libpng12 "/lib/x86_64-linux-gnu/libpng12.so*") |
| 182 | + install(FILES ${libpng12} DESTINATION lib) | ||
| 186 | endif() | 183 | endif() |
| 187 | endfunction() | 184 | endfunction() |
| 188 | 185 |