Skip to content

Commit

Permalink
qt5: add test that cmake works with QUiLoader
Browse files Browse the repository at this point in the history
  • Loading branch information
starius authored and WSoptics committed Feb 5, 2016
1 parent 5f0b272 commit 4d26826
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 0 deletions.
31 changes: 31 additions & 0 deletions src/qttools-test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# This file is part of MXE.
# See index.html for further 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
)
11 changes: 11 additions & 0 deletions src/qttools-test/mxe-cmake-qtuitools.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// This file is part of MXE.
// See index.html for further information.

// Source: https://github.com/mxe/mxe/issues/1185

#include <QUiLoader>

int main() {
QUiLoader l;
return 0;
}
7 changes: 7 additions & 0 deletions src/qttools.mk
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,12 @@ define $(PKG)_BUILD
cd '$(1)' && '$(PREFIX)/$(TARGET)/qt5/bin/qmake'
$(MAKE) -C '$(1)' -j '$(JOBS)'
$(MAKE) -C '$(1)' -j 1 install

# test QUiLoader
mkdir '$(1)'.test
cd '$(1)'.test && '$(TARGET)-cmake' '$(PWD)/src/qttools-test'
$(MAKE) -C '$(1)'.test
cp '$(1)'.test/mxe-cmake-qtuitools.exe \
'$(PREFIX)/$(TARGET)/bin/test-qttools.exe'
endef

0 comments on commit 4d26826

Please sign in to comment.