Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build fail with CMake + Qt (QUiLoader) #1185

Closed
stloeffler opened this issue Jan 16, 2016 · 3 comments
Closed

Build fail with CMake + Qt (QUiLoader) #1185

stloeffler opened this issue Jan 16, 2016 · 3 comments

Comments

@stloeffler
Copy link
Contributor

When trying to compile the following minimal example
CMakeLists.txt:

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)

mxe-cmake-qtuitools.cpp:

#include <QUiLoader>

int main() {
    QUiLoader l;
    return 0;
}

(which uses QUiLoader, which is part of Qt5UiTools) I get the following error message:
CMakeFiles/mxe-cmake-qtuitools.dir/build.make:89: *** target pattern contains no '%'. Stop.
build.make:89 reads
mxe-cmake-qtuitools.exe: Qt5::UiPlugin-NOTFOUND
although Qt5::UiPlugin is built and CMake doesn't complain while configuring.

This seems to be similar to Alexpux/MINGW-packages#762 which apparently has been resolved by patching Qt with https://github.com/Alexpux/MINGW-packages/blob/master/mingw-w64-qt5-static/0038-qt-5.5.0-cmake-Rearrange-STATIC-vs-INTERFACE-targets.patch

@starius
Copy link
Member

starius commented Jan 17, 2016

It is reproducible here. I'll try to rebuild Qt5 with this patch saved to file src/qtbase-3-make-Rearrange-STATIC-vs-INTERFACE-targets.patch

@starius
Copy link
Member

starius commented Jan 17, 2016

It works with this patch.

@starius
Copy link
Member

starius commented Jan 17, 2016

I'll open a pull request adding the patch and the test.

starius added a commit to LuaAndC/mxe that referenced this issue Jan 17, 2016
starius added a commit to LuaAndC/mxe that referenced this issue Jan 17, 2016
fiesh pushed a commit to fiesh/mxe that referenced this issue Feb 3, 2016
Add the patch known to fix this issue in
https://github.com/Alexpux/MINGW-packages/issues/762
(cmake: Rearrange STATIC vs INTERFACE targets).

fix mxe#1185
fiesh pushed a commit to fiesh/mxe that referenced this issue Feb 3, 2016
fiesh pushed a commit to fiesh/mxe that referenced this issue Feb 3, 2016
Add the patch known to fix this issue in
https://github.com/Alexpux/MINGW-packages/issues/762
(cmake: Rearrange STATIC vs INTERFACE targets).

fix mxe#1185
fiesh pushed a commit to fiesh/mxe that referenced this issue Feb 3, 2016
fiesh pushed a commit to fiesh/mxe that referenced this issue Feb 3, 2016
Add the patch known to fix this issue in
https://github.com/Alexpux/MINGW-packages/issues/762
(cmake: Rearrange STATIC vs INTERFACE targets).

fix mxe#1185
fiesh pushed a commit to fiesh/mxe that referenced this issue Feb 3, 2016
fiesh pushed a commit to fiesh/mxe that referenced this issue Feb 5, 2016
Add the patch known to fix this issue in
https://github.com/Alexpux/MINGW-packages/issues/762
(cmake: Rearrange STATIC vs INTERFACE targets).

fix mxe#1185
fiesh pushed a commit to fiesh/mxe that referenced this issue Feb 5, 2016
fiesh pushed a commit to fiesh/mxe that referenced this issue Feb 5, 2016
Add the patch known to fix this issue in
https://github.com/Alexpux/MINGW-packages/issues/762
(cmake: Rearrange STATIC vs INTERFACE targets).

fix mxe#1185
fiesh pushed a commit to fiesh/mxe that referenced this issue Feb 5, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants