Skip to content

Commit

Permalink
[Qt] Fix static builds of qt5-imageformats (#8222)
Browse files Browse the repository at this point in the history
* forward extra arguments to vcpkg_configure_qmake from submodules
* make image format dependent on tiff and libwebp
* make tools dependent on imageformat
* build options must be passed a bit different then normal qmake options
* add the required dependencies
* a new dependency discovered in qt5-declarative
* need webpdemux also
* qt5-declarative is dependent on imageformats so we can drop it here
* remove empty qt.conf if it exists. closes #8180
* add all recommended dependencies as dependencies in control.
  • Loading branch information
Neumann-A authored and Rastaban committed Sep 20, 2019
1 parent d060ff5 commit 86a5b6f
Show file tree
Hide file tree
Showing 29 changed files with 92 additions and 51 deletions.
4 changes: 2 additions & 2 deletions ports/qt5-3d/CONTROL
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Source: qt5-3d
Version: 5.12.5
Version: 5.12.5-1
Description: Qt5 3d Module - Functionality for near-realtime simulation systems with support for 2D and 3D rendering
Build-Depends: qt5-base, qt5-declarative
Build-Depends: qt5-base, qt5-declarative, qt5-imageformats, qt5-gamepad
2 changes: 1 addition & 1 deletion ports/qt5-base/CONTROL
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Source: qt5-base
Version: 5.12.5
Version: 5.12.5-1
Homepage: https://www.qt.io/
Description: Qt5 Application Framework Base Module. Includes Core, GUI, Widgets, Networking, SQL, Concurrent and other essential qt components.
Build-Depends: zlib, libjpeg-turbo, libpng, freetype, pcre2, harfbuzz, sqlite3, libpq, double-conversion, openssl
2 changes: 1 addition & 1 deletion ports/qt5-base/cmake/qt_build_submodule.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ function(qt_build_submodule SOURCE_PATH)
get_filename_component(PYTHON2_EXE_PATH ${PYTHON2} DIRECTORY)
vcpkg_add_to_path("${PYTHON2_EXE_PATH}")

vcpkg_configure_qmake(SOURCE_PATH ${SOURCE_PATH})
vcpkg_configure_qmake(SOURCE_PATH ${SOURCE_PATH} ${ARGV})

vcpkg_build_qmake(SKIP_MAKEFILES)

Expand Down
2 changes: 1 addition & 1 deletion ports/qt5-base/cmake/qt_submodule_installation.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ function(qt_submodule_installation)
if(QT_UPDATE_VERSION)
SET(VCPKG_POLICY_EMPTY_PACKAGE enabled PARENT_SCOPE)
else()
qt_build_submodule(${TARGET_SOURCE_PATH})
qt_build_submodule(${TARGET_SOURCE_PATH} ${ARGV})
qt_install_copyright(${TARGET_SOURCE_PATH})
endif()
endfunction()
4 changes: 4 additions & 0 deletions ports/qt5-base/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,10 @@ else()
vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/${PORT}/bin)
vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/qt5/bin)
endif()

if(EXISTS ${CURRENT_PACKAGES_DIR}/tools/qt5/bin/qt.conf)
file(REMOVE "${CURRENT_PACKAGES_DIR}/tools/qt5/bin/qt.conf")
endif()

qt_install_copyright(${SOURCE_PATH})
endif()
Expand Down
4 changes: 2 additions & 2 deletions ports/qt5-charts/CONTROL
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Source: qt5-charts
Version: 5.12.5
Version: 5.12.5-1
Description: Qt5 Charts Module - UI components for displaying charts, driven by static or dynamic data models
Build-Depends: qt5-base
Build-Depends: qt5-base, qt5-declarative, qt5-multimedia
4 changes: 2 additions & 2 deletions ports/qt5-connectivity/CONTROL
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Source: qt5-connectivity
Version: 5.12.5
Version: 5.12.5-1
Description: Qt5 Connectivity module - Provides access to Bluetooth and NFC hardware
Build-Depends: qt5-base
Build-Depends: qt5-base, qt5-androidextras (android)
4 changes: 2 additions & 2 deletions ports/qt5-datavis3d/CONTROL
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Source: qt5-datavis3d
Version: 5.12.5
Version: 5.12.5-1
Description: Qt5 Data Visualization 3d Module - UI Components for creating 3D data visualizations
Build-Depends: qt5-base
Build-Depends: qt5-base, qt5-declarative, qt5-multimedia
4 changes: 2 additions & 2 deletions ports/qt5-declarative/CONTROL
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Source: qt5-declarative
Version: 5.12.5
Version: 5.12.5-1
Description: Qt5 Declarative (Quick 2) Module. Includes QtQuick, QtQuickParticles, QtQuickWidgets, QtQml, and QtPacketProtocol.
Build-Depends: qt5-base
Build-Depends: qt5-base, qt5-imageformats, qt5-svg
4 changes: 2 additions & 2 deletions ports/qt5-gamepad/CONTROL
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Source: qt5-gamepad
Version: 5.12.5
Version: 5.12.5-1
Description: Qt5 Gamepad Module - Enables Qt applications to support the use of gamepad hardware
Build-Depends: qt5-base
Build-Depends: qt5-base, qt5-declarative
4 changes: 2 additions & 2 deletions ports/qt5-imageformats/CONTROL
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Source: qt5-imageformats
Version: 5.12.5
Version: 5.12.5-1
Description: Qt5 Image Formats Module - Plugins for additional image formats: TIFF, MNG, TGA, WBMP
Build-Depends: qt5-base
Build-Depends: qt5-base, tiff, libwebp
27 changes: 26 additions & 1 deletion ports/qt5-imageformats/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,3 +1,28 @@
set(VCPKG_POLICY_EMPTY_INCLUDE_FOLDER enabled)
include(${CURRENT_INSTALLED_DIR}/share/qt5/qt_port_functions.cmake)
qt_submodule_installation()


list(APPEND CORE_OPTIONS
-system-tiff
-system-webp
-verbose)

find_library(TIFF_RELEASE NAMES tiff PATHS "${CURRENT_INSTALLED_DIR}/lib" NO_DEFAULT_PATH) # Depends on lzma
find_library(TIFF_DEBUG NAMES tiffd PATHS "${CURRENT_INSTALLED_DIR}/debug/lib" NO_DEFAULT_PATH)

find_library(WEBP_RELEASE NAMES webp PATHS "${CURRENT_INSTALLED_DIR}/lib" NO_DEFAULT_PATH)
find_library(WEBP_DEBUG NAMES webpd webp PATHS "${CURRENT_INSTALLED_DIR}/debug/lib" NO_DEFAULT_PATH)
find_library(WEBPDEMUX_RELEASE NAMES webpdemux PATHS "${CURRENT_INSTALLED_DIR}/lib" NO_DEFAULT_PATH)
find_library(WEBPDEMUX_DEBUG NAMES webpdemuxd webpdemux PATHS "${CURRENT_INSTALLED_DIR}/debug/lib" NO_DEFAULT_PATH)
# Depends on opengl in default build but might depend on giflib, libjpeg-turbo, zlib, libpng, tiff, freeglut (!osx), sdl1 (windows)
# which would require extra libraries to be linked e.g. giflib freeglut sdl1 other ones are already linked

#Dependent libraries
find_library(LZMA_RELEASE lzma PATHS "${CURRENT_INSTALLED_DIR}/lib" NO_DEFAULT_PATH)
find_library(LZMA_DEBUG lzmad lzma PATHS "${CURRENT_INSTALLED_DIR}/debug/lib" NO_DEFAULT_PATH)

set(OPT_REL "TIFF_LIBS=${TIFF_RELEASE} ${LZMA_RELEASE}"
"WEBP_LIBS=${WEBP_RELEASE} ${WEBPDEMUX_RELEASE}")
set(OPT_DBG "TIFF_LIBS=${TIFF_DEBUG} ${LZMA_DEBUG}"
"WEBP_LIBS=${WEBP_DEBUG} ${WEBPDEMUX_DEBUG}")
qt_submodule_installation(BUILD_OPTIONS ${CORE_OPTIONS} BUILD_OPTIONS_RELEASE ${OPT_REL} BUILD_OPTIONS_DEBUG ${OPT_DBG})
4 changes: 2 additions & 2 deletions ports/qt5-location/CONTROL
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Source: qt5-location
Version: 5.12.5
Version: 5.12.5-1
Description: Qt5 Location Module - Displays map, navigation, and place content in a QML application.
Build-Depends: qt5-base, qt5-declarative
Build-Depends: qt5-base, qt5-declarative, qt5-quickcontrols, qt5-quickcontrols2, qt5-serialport
4 changes: 2 additions & 2 deletions ports/qt5-multimedia/CONTROL
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Source: qt5-multimedia
Version: 5.12.5
Version: 5.12.5-1
Description: Qt5 Multimedia Module - Classes and widgets for audio, video, radio and camera functionality
Build-Depends: qt5-base, qt5-declarative
Build-Depends: qt5-base, qt5-declarative
4 changes: 2 additions & 2 deletions ports/qt5-purchasing/CONTROL
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Source: qt5-purchasing
Version: 5.12.5
Version: 5.12.5-1
Description: Qt5 Purchasing Module - Enables in-app purchase of products in Qt applications.
Build-Depends: qt5-base, qt5-declarative
Build-Depends: qt5-base, qt5-declarative, qt5-androidextras (android)
4 changes: 2 additions & 2 deletions ports/qt5-quickcontrols/CONTROL
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Source: qt5-quickcontrols
Version: 5.12.5
Version: 5.12.5-1
Description: Qt5 QuickControls Module.
Build-Depends: qt5-base, qt5-declarative
Build-Depends: qt5-base, qt5-declarative, qt5-graphicaleffects
4 changes: 2 additions & 2 deletions ports/qt5-quickcontrols2/CONTROL
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Source: qt5-quickcontrols2
Version: 5.12.5
Version: 5.12.5-1
Description: Qt5 QuickControls2 Module.
Build-Depends: qt5-base, qt5-declarative
Build-Depends: qt5-base, qt5-declarative, qt5-imageformats
4 changes: 2 additions & 2 deletions ports/qt5-remoteobjects/CONTROL
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Source: qt5-remoteobjects
Version: 5.12.5
Version: 5.12.5-1
Description: Qt5 Remoteobjects module - Provides an easy to use mechanism for sharing a QObject's API (Properties/Signals/Slots) between processes or devices.
Build-Depends: qt5-base
Build-Depends: qt5-base, qt5-declarative
4 changes: 2 additions & 2 deletions ports/qt5-script/CONTROL
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Source: qt5-script
Version: 5.12.5
Build-Depends: qt5-base
Version: 5.12.5-1
Build-Depends: qt5-base, qt5-tools
Description:Qt5 Script Module.
4 changes: 2 additions & 2 deletions ports/qt5-sensors/CONTROL
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Source: qt5-sensors
Version: 5.12.5
Version: 5.12.5-1
Description: Qt5 Sensors module - Provides access to sensor hardware and motion gesture recognition.
Build-Depends: qt5-base
Build-Depends: qt5-base, qt5-declarative
4 changes: 2 additions & 2 deletions ports/qt5-speech/CONTROL
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Source: qt5-speech
Version: 5.12.5
Version: 5.12.5-1
Description: Qt5 Speech Module
Build-Depends: qt5-base, atlmfc (windows)
Build-Depends: qt5-base, atlmfc (windows), qt5-declarative, qt5-multimedia
4 changes: 2 additions & 2 deletions ports/qt5-tools/CONTROL
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Source: qt5-tools
Version: 5.12.5
Version: 5.12.5-1
Description: Qt5 Tools Module; Includes deployment tools and helpers, Qt Designer, Assistant, and other applications
Build-Depends: qt5-base, qt5-declarative
Build-Depends: qt5-base, qt5-declarative, qt5-activeqt
4 changes: 2 additions & 2 deletions ports/qt5-virtualkeyboard/CONTROL
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Source: qt5-virtualkeyboard
Version: 5.12.5
Version: 5.12.5-1
Description: Qt5 Virtual Keyboard Module - A framework for implementing different input methods. Supports localized keyboard layouts and custom visual themes
Build-Depends: qt5-svg, qt5-quickcontrols
Build-Depends: qt5-svg, qt5-quickcontrols, qt5-multimedia, qt5-quickcontrols
4 changes: 2 additions & 2 deletions ports/qt5-webchannel/CONTROL
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Source: qt5-webchannel
Version: 5.12.5
Version: 5.12.5-1
Description: Qt5 Web Channel module - Provides access to QObject or QML objects from HTML clients for seamless integration of Qt applications with HTML/JavaScript clients.
Build-Depends: qt5-base
Build-Depends: qt5-base, qt5-declarative
2 changes: 1 addition & 1 deletion ports/qt5-websockets/CONTROL
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Source: qt5-websockets
Version: 5.12.5
Description: Qt5 Web Sockets Module - provides WebSocket communication compliant with RFC 6455
Build-Depends: qt5-base
Build-Depends: qt5-base, qt5-declarative
4 changes: 2 additions & 2 deletions ports/qt5-webview/CONTROL
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Source: qt5-webview
Version: 5.12.5
Version: 5.12.5-1
Description: Qt5 WebView module - Provides a way to display web content in a QML application without necessarily including a full web browser stack by using native APIs where it makes sense.
Build-Depends: qt5-base, qt5-declarative
Build-Depends: qt5-declarative
4 changes: 2 additions & 2 deletions ports/qt5-winextras/CONTROL
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Source: qt5-winextras
Version: 5.12.5
Version: 5.12.5-1
Description: Qt5 Windows Extras Module. Provides platform-specific APIs for Windows.
Build-Depends: qt5-base, atlmfc (windows)
Build-Depends: qt5-base, atlmfc (windows), qt5-declarative, qt5-multimedia
2 changes: 1 addition & 1 deletion ports/qt5-xmlpatterns/CONTROL
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Source: qt5-xmlpatterns
Version: 5.12.5
Description: Qt5 XML Patterns Module - Support for XPath, XQuery, XSLT and XML schema validation
Build-Depends: qt5-base
Build-Depends: qt5-base, qt5-declarative
18 changes: 15 additions & 3 deletions scripts/cmake/vcpkg_configure_qmake.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# The options passed to qmake.

function(vcpkg_configure_qmake)
cmake_parse_arguments(_csc "" "SOURCE_PATH" "OPTIONS;OPTIONS_RELEASE;OPTIONS_DEBUG" ${ARGN})
cmake_parse_arguments(_csc "" "SOURCE_PATH" "OPTIONS;OPTIONS_RELEASE;OPTIONS_DEBUG;BUILD_OPTIONS;BUILD_OPTIONS_RELEASE;BUILD_OPTIONS_DEBUG" ${ARGN})

# Find qmake executable
set(_triplet_hostbindir ${CURRENT_INSTALLED_DIR}/tools/qt5/bin)
Expand Down Expand Up @@ -51,8 +51,14 @@ function(vcpkg_configure_qmake)

message(STATUS "Configuring ${TARGET_TRIPLET}-rel")
file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel)
if(DEFINED _csc_BUILD_OPTIONS OR DEFINED _csc_BUILD_OPTIONS_RELEASE)
set(BUILD_OPT -- ${_csc_BUILD_OPTIONS} ${_csc_BUILD_OPTIONS_RELEASE})
endif()
vcpkg_execute_required_process(
COMMAND ${QMAKE_COMMAND} CONFIG-=debug CONFIG+=release ${_csc_OPTIONS} ${_csc_OPTIONS_RELEASE} ${_csc_SOURCE_PATH} -qtconf "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/qt.conf"
COMMAND ${QMAKE_COMMAND} CONFIG-=debug CONFIG+=release
${_csc_OPTIONS} ${_csc_OPTIONS_RELEASE} ${_csc_SOURCE_PATH}
-qtconf "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/qt.conf"
${BUILD_OPT}
WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel
LOGNAME config-${TARGET_TRIPLET}-rel
)
Expand All @@ -64,8 +70,14 @@ function(vcpkg_configure_qmake)

message(STATUS "Configuring ${TARGET_TRIPLET}-dbg")
file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg)
if(DEFINED _csc_BUILD_OPTIONS OR DEFINED _csc_BUILD_OPTIONS_DEBUG)
set(BUILD_OPT -- ${_csc_BUILD_OPTIONS} ${_csc_BUILD_OPTIONS_DEBUG})
endif()
vcpkg_execute_required_process(
COMMAND ${QMAKE_COMMAND} CONFIG-=release CONFIG+=debug ${_csc_OPTIONS} ${_csc_OPTIONS_DEBUG} ${_csc_SOURCE_PATH} -qtconf "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/qt.conf"
COMMAND ${QMAKE_COMMAND} CONFIG-=release CONFIG+=debug
${_csc_OPTIONS} ${_csc_OPTIONS_DEBUG} ${_csc_SOURCE_PATH}
-qtconf "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/qt.conf"
${BUILD_OPT}
WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg
LOGNAME config-${TARGET_TRIPLET}-dbg
)
Expand Down

0 comments on commit 86a5b6f

Please sign in to comment.