diff options
author | Tony Theodore <tonyt@logyst.com> | 2017-10-10 12:15:06 (GMT) |
---|---|---|
committer | Tony Theodore <tonyt@logyst.com> | 2017-10-10 12:46:31 (GMT) |
commit | ab5d9a7185d90a977ccf3ca70c96edf027af5c79 (patch) | |
tree | 7368623b360f3d8ffd0c733dc4fd443cada1d018 /plugins | |
parent | f118332737b69447856302738dc1cd8932bb152b (diff) | |
download | mxe-ab5d9a7185d90a977ccf3ca70c96edf027af5c79.zip mxe-ab5d9a7185d90a977ccf3ca70c96edf027af5c79.tar.gz mxe-ab5d9a7185d90a977ccf3ca70c96edf027af5c79.tar.bz2 |
qttools: read test from current directory and freeze example 5.7 plugin
see: https://github.com/mxe/mxe/issues/1901#issuecomment-333551106
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/examples/qt5-freeze/README.md | 3 | ||||
-rw-r--r-- | plugins/examples/qt5-freeze/qttools-test/CMakeLists.txt | 30 | ||||
-rw-r--r-- | plugins/examples/qt5-freeze/qttools-test/mxe-cmake-qtuitools.cpp | 10 | ||||
-rw-r--r-- | plugins/examples/qt5-freeze/qttools.mk | 5 |
4 files changed, 46 insertions, 2 deletions
diff --git a/plugins/examples/qt5-freeze/README.md b/plugins/examples/qt5-freeze/README.md index bda7dfe..78383cc 100644 --- a/plugins/examples/qt5-freeze/README.md +++ b/plugins/examples/qt5-freeze/README.md @@ -29,6 +29,9 @@ export QT5_PKGS=${QT5_PKGS}qtbase cp `eval echo src/{$QT5_PKGS}.mk` $PLUGIN_DIR cp `eval echo src/{$QT5_PKGS}-*.patch` $PLUGIN_DIR +# copy other relevant sources +cp -R src/qttools-test $PLUGIN_DIR + # set $(PKG)_PATCHES to only look for patches in the current directory # on macos, use `gsed` instead of `sed` find $PLUGIN_DIR -name "qt[^5]*.mk" -exec sed -i '9i$(PKG)_PATCHES := $(realpath $(sort $(wildcard $(dir $(lastword $(MAKEFILE_LIST)))/$(PKG)-[0-9]*.patch)))' {} \; diff --git a/plugins/examples/qt5-freeze/qttools-test/CMakeLists.txt b/plugins/examples/qt5-freeze/qttools-test/CMakeLists.txt new file mode 100644 index 0000000..ad8de2f --- /dev/null +++ b/plugins/examples/qt5-freeze/qttools-test/CMakeLists.txt @@ -0,0 +1,30 @@ +# This file is part of MXE. See LICENSE.md for licensing information. + +# Source: https://github.com/mxe/mxe/issues/1185 + +cmake_minimum_required(VERSION 3.0) +find_package(Qt5 REQUIRED COMPONENTS Core Widgets Gui UiTools) + +include_directories(${Qt5UiTools_INCLUDE_DIRS}) +add_executable(mxe-cmake-qtuitools mxe-cmake-qtuitools.cpp) +# NB: Qt5Widgets, Qt5Gui, Qt5Core must be given separately; otherwise they are +# appended automatically at the end, making it impossible to satisfy all the +# other implicit dependencies (opengl, harfbuzz, etc.) +target_link_libraries( + mxe-cmake-qtuitools + ${Qt5UiTools_LIBRARIES} + ${Qt5Widgets_LIBRARIES} + ${Qt5Gui_LIBRARIES} + ${Qt5Core_LIBRARIES} + opengl32 + harfbuzz + jpeg + png + glib-2.0 + winmm + ws2_32 + intl + iconv + pcre16 + z +) diff --git a/plugins/examples/qt5-freeze/qttools-test/mxe-cmake-qtuitools.cpp b/plugins/examples/qt5-freeze/qttools-test/mxe-cmake-qtuitools.cpp new file mode 100644 index 0000000..60e008b --- /dev/null +++ b/plugins/examples/qt5-freeze/qttools-test/mxe-cmake-qtuitools.cpp @@ -0,0 +1,10 @@ +// This file is part of MXE. See LICENSE.md for licensing information. + +// Source: https://github.com/mxe/mxe/issues/1185 + +#include <QUiLoader> + +int main() { + QUiLoader l; + return 0; +} diff --git a/plugins/examples/qt5-freeze/qttools.mk b/plugins/examples/qt5-freeze/qttools.mk index 9fa6adf..2c28886 100644 --- a/plugins/examples/qt5-freeze/qttools.mk +++ b/plugins/examples/qt5-freeze/qttools.mk @@ -12,6 +12,8 @@ $(PKG)_FILE = $(subst qtbase,qttools,$(qtbase_FILE)) $(PKG)_URL = $(subst qtbase,qttools,$(qtbase_URL)) $(PKG)_DEPS := gcc qtactiveqt qtbase qtdeclarative +$(PKG)_TEST_DIR := $(dir $(lastword $(MAKEFILE_LIST)))/qttools-test + define $(PKG)_UPDATE echo $(qtbase_VERSION) endef @@ -23,9 +25,8 @@ define $(PKG)_BUILD # test QUiLoader mkdir '$(1)'.test - cd '$(1)'.test && '$(TARGET)-cmake' '$(PWD)/src/qttools-test' + cd '$(1)'.test && '$(TARGET)-cmake' '$($(PKG)_TEST_DIR)' $(MAKE) -C '$(1)'.test cp '$(1)'.test/mxe-cmake-qtuitools.exe \ '$(PREFIX)/$(TARGET)/bin/test-qttools.exe' endef - |