From dd34bab1b47e929b7becb5f1fd9cee9696cef44b Mon Sep 17 00:00:00 2001 From: Tony Theodore Date: Sun, 4 Oct 2015 18:39:06 +1100 Subject: qt: add cmake test workaround in #857 allows this to build. see also #852, a complete solution that covers Qt5 is required --- src/qt-test.cmake | 21 +++++++++++++++++++++ src/qt.mk | 11 +++++++++-- 2 files changed, 30 insertions(+), 2 deletions(-) create mode 100644 src/qt-test.cmake diff --git a/src/qt-test.cmake b/src/qt-test.cmake new file mode 100644 index 0000000..064214c --- /dev/null +++ b/src/qt-test.cmake @@ -0,0 +1,21 @@ +# This file is part of MXE. +# See index.html for further information. + +# partial module - included by src/cmake/CMakeLists.txt + +set(TGT test-${PKG}-cmake) + +enable_language(CXX) + +set(CMAKE_INCLUDE_CURRENT_DIR ON) +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +find_package(Qt4 ${PKG_VERSION} EXACT REQUIRED) +include(${QT_USE_FILE}) + +add_executable(${TGT} WIN32 ${CMAKE_CURRENT_LIST_DIR}/${PKG}-test.cpp) +target_link_libraries(${TGT} ${QT_LIBRARIES}) + +install(TARGETS ${TGT} DESTINATION bin) diff --git a/src/qt.mk b/src/qt.mk index 89ab27e..71536fe 100644 --- a/src/qt.mk +++ b/src/qt.mk @@ -122,10 +122,17 @@ define $(PKG)_BUILD # setup cmake toolchain echo 'set(QT_QMAKE_EXECUTABLE $(PREFIX)/$(TARGET)/qt/bin/qmake)' > '$(CMAKE_TOOLCHAIN_DIR)/$(PKG).cmake' - # fix static linking errors of QtGui to missing lcms2 and lzma + # fix static linking errors of QtGui to missing lcms2 and lzma # introduced by poor libmng linking - echo 'set(MNG_LIBRARY mng lcms2 lzma)' >> '$(CMAKE_TOOLCHAIN_DIR)/$(PKG).cmake' + echo 'set(MNG_LIBRARY mng lcms2 lzma)' >> '$(CMAKE_TOOLCHAIN_DIR)/$(PKG).cmake' + # test cmake + mkdir '$(1).test-cmake' + cd '$(1).test-cmake' && '$(TARGET)-cmake' \ + -DPKG=$(PKG) \ + -DPKG_VERSION=$($(PKG)_VERSION) \ + '$(PWD)/src/cmake/test' + $(MAKE) -C '$(1).test-cmake' -j 1 install endef $(PKG)_BUILD_SHARED = $(subst -static ,-shared ,\ -- cgit v0.12