Bug 1019952

Summary: mingw[32/64]-cmake sets incorrect path to moc, uic, and rcc
Product: [Fedora] Fedora Reporter: Patrick Noffke <patrick>
Component: mingw-qt5-qtbaseAssignee: Erik van Pienbroek <erik-fedora>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: unspecified    
Version: 18CC: erik-fedora
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: mingw-qt5-qtbase-5.1.1-5.fc19 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-12-03 10:39:39 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
Simple hello example that uses moc. none

Description Patrick Noffke 2013-10-16 16:53:49 UTC
Created attachment 813065 [details]
Simple hello example that uses moc.

Description of problem:
When using mingw32-cmake (or mingw64-cmake) with a Qt5 application that uses moc, uic, or rcc, the path to the corresponding program will be /usr/i686-w64-mingw32/sys-root/mingw/bin/ instead of /usr/i686-w64-mingw32/bin

Version-Release number of selected component (if applicable):
mingw32-qt5-qtbase-5.0.2-3.fc18.noarch

How reproducible:
Every time

Steps to Reproduce:
1.  Extract attached archive and place files hello.cpp, hellomoc.h, and CMakeLists.txt in a test directory.
2.  cd to the test directory.
3.  mkdir build && cd build
4.  mingw32-cmake ..
5.  VERBOSE=1 make

Actual results:
Generating moc_hellomoc.cpp
/usr/i686-w64-mingw32/sys-root/mingw/bin/moc -I/usr/i686-w64-mingw32/sys-root/mingw/include/qt5/QtWidgets -I/usr/i686-w64-mingw32/sys-root/mingw/include/qt5/QtGui -I/usr/i686-w64-mingw32/sys-root/mingw/include/qt5/QtCore -I/usr/i686-w64-mingw32/sys-root/mingw/include/qt5 -I/usr/i686-w64-mingw32/sys-root/mingw/share/qt5/mkspecs/win32-g++-cross -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -o /home/pnoffke/accucam/trunk/build/mingw-cmake-hello-moc/build/moc_hellomoc.cpp /home/pnoffke/accucam/trunk/build/mingw-cmake-hello-moc/hellomoc.h 
No such file or directory
AUTOMOC: error: process for /home/pnoffke/accucam/trunk/build/mingw-cmake-hello-moc/build/moc_hellomoc.cpp failed:
No such file or directory
moc failed...
make[2]: *** [CMakeFiles/mingw-cmake-hello_automoc] Error 1
make[2]: Leaving directory `/home/pnoffke/accucam/trunk/build/mingw-cmake-hello-moc/build'
make[1]: *** [CMakeFiles/mingw-cmake-hello_automoc.dir/all] Error 2
make[1]: Leaving directory `/home/pnoffke/accucam/trunk/build/mingw-cmake-hello-moc/build'
make: *** [all] Error 2


Expected results:
Run /usr/i686-w64-mingw32/bin/moc-qt5 instead of /usr/i686-w64-mingw32/sys-root/mingw/bin/moc.

Additional info:
If I run mingw32-cmake as a rule in a makefile, then I can run a set of "fixup" rules as follows before running make.  This corrects this problem for me, but it is not ideal because the whole build needs to be redone every time a CMakeLists.txt file is modified.

        find $(PRODUCT_BUILD_DIR) -name AutomocInfo.cmake | xargs sed -i 's;AM_QT_MOC_EXECUTABLE .*;AM_QT_MOC_EXECUTABLE "/usr/i686-w64-mingw32/bin/moc-qt5");'
        find $(PRODUCT_BUILD_DIR) -name build.make | xargs sed -i 's;/usr/i686-w64-mingw32/sys-root/mingw/bin/moc;/usr/i686-w64-mingw32/bin/moc-qt5;'
        find $(PRODUCT_BUILD_DIR) -name build.make | xargs sed -i 's;/usr/i686-w64-mingw32/sys-root/mingw/bin/uic;/usr/i686-w64-mingw32/bin/uic-qt5;'
        find $(PRODUCT_BUILD_DIR) -name build.make | xargs sed -i 's;/usr/i686-w64-mingw32/sys-root/mingw/bin/rcc;/usr/i686-w64-mingw32/bin/rcc-qt5;'

Comment 1 Fedora Update System 2013-11-18 00:39:20 UTC
mingw-qt5-qttranslations-5.1.1-1.fc19,mingw-qt5-qttools-5.1.1-1.fc19,mingw-qt5-qtsensors-5.1.1-1.fc19,mingw-qt5-qtscript-5.1.1-1.fc19,mingw-qt5-qtquick1-5.1.1-1.fc19,mingw-qt5-qtjsbackend-5.1.1-1.fc19,mingw-qt5-qtimageformats-5.1.1-1.fc19,mingw-qt5-qtgraphicaleffects-5.1.1-1.fc19,mingw-qt5-qtdeclarative-5.1.1-1.fc19,mingw-qt5-qtbase-5.1.1-3.fc19,mingw-qt5-qt3d-5.0.0-0.5.git20130510.0158ce78.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/mingw-qt5-qttranslations-5.1.1-1.fc19,mingw-qt5-qttools-5.1.1-1.fc19,mingw-qt5-qtsensors-5.1.1-1.fc19,mingw-qt5-qtscript-5.1.1-1.fc19,mingw-qt5-qtquick1-5.1.1-1.fc19,mingw-qt5-qtjsbackend-5.1.1-1.fc19,mingw-qt5-qtimageformats-5.1.1-1.fc19,mingw-qt5-qtgraphicaleffects-5.1.1-1.fc19,mingw-qt5-qtdeclarative-5.1.1-1.fc19,mingw-qt5-qtbase-5.1.1-3.fc19,mingw-qt5-qt3d-5.0.0-0.5.git20130510.0158ce78.fc19

Comment 2 Fedora Update System 2013-11-19 05:23:35 UTC
Package mingw-qt5-qttranslations-5.1.1-1.fc19, mingw-qt5-qttools-5.1.1-1.fc19, mingw-qt5-qtsensors-5.1.1-1.fc19, mingw-qt5-qtscript-5.1.1-1.fc19, mingw-qt5-qtquick1-5.1.1-1.fc19, mingw-qt5-qtjsbackend-5.1.1-1.fc19, mingw-qt5-qtimageformats-5.1.1-1.fc19, mingw-qt5-qtgraphicaleffects-5.1.1-1.fc19, mingw-qt5-qtdeclarative-5.1.1-1.fc19, mingw-qt5-qtbase-5.1.1-3.fc19, mingw-qt5-qt3d-5.0.0-0.5.git20130510.0158ce78.fc19:
* should fix your issue,
* was pushed to the Fedora 19 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing mingw-qt5-qttranslations-5.1.1-1.fc19 mingw-qt5-qttools-5.1.1-1.fc19 mingw-qt5-qtsensors-5.1.1-1.fc19 mingw-qt5-qtscript-5.1.1-1.fc19 mingw-qt5-qtquick1-5.1.1-1.fc19 mingw-qt5-qtjsbackend-5.1.1-1.fc19 mingw-qt5-qtimageformats-5.1.1-1.fc19 mingw-qt5-qtgraphicaleffects-5.1.1-1.fc19 mingw-qt5-qtdeclarative-5.1.1-1.fc19 mingw-qt5-qtbase-5.1.1-3.fc19 mingw-qt5-qt3d-5.0.0-0.5.git20130510.0158ce78.fc19'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2013-21648/mingw-qt5-qttranslations-5.1.1-1.fc19,mingw-qt5-qttools-5.1.1-1.fc19,mingw-qt5-qtsensors-5.1.1-1.fc19,mingw-qt5-qtscript-5.1.1-1.fc19,mingw-qt5-qtquick1-5.1.1-1.fc19,mingw-qt5-qtjsbackend-5.1.1-1.fc19,mingw-qt5-qtimageformats-5.1.1-1.fc19,mingw-qt5-qtgraphicaleffects-5.1.1-1.fc19,mingw-qt5-qtdeclarative-5.1.1-1.fc19,mingw-qt5-qtbase-5.1.1-3.fc19,mingw-qt5-qt3d-5.0.0-0.5.git20130510.0158ce78.fc19
then log in and leave karma (feedback).

Comment 3 Patrick Noffke 2013-11-26 15:23:26 UTC
Now it fails looking for uic (I think it should be looking for uic-qt5 instead).

$ mingw32-cmake ..
-- The C compiler identification is GNU 4.8.2
-- The CXX compiler identification is GNU 4.8.2
-- Check for working C compiler: /usr/bin/i686-w64-mingw32-gcc
-- Check for working C compiler: /usr/bin/i686-w64-mingw32-gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/i686-w64-mingw32-g++
-- Check for working CXX compiler: /usr/bin/i686-w64-mingw32-g++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
CMake Error at /usr/i686-w64-mingw32/sys-root/mingw/lib/cmake/Qt5Widgets/Qt5WidgetsConfig.cmake:15 (message):
  The imported target "Qt5::Widgets" references the file

     "/usr/i686-w64-mingw32/bin/uic"

  but this file does not exist.  Possible reasons include:

  * The file was deleted, renamed, or moved to another location.

  * An install or uninstall procedure did not complete successfully.

  * The installation package was faulty and contained

     "/usr/i686-w64-mingw32/sys-root/mingw/lib/cmake/Qt5Widgets/Qt5WidgetsConfigExtras.cmake"

  but not all the files it references.

Call Stack (most recent call first):
  /usr/i686-w64-mingw32/sys-root/mingw/lib/cmake/Qt5Widgets/Qt5WidgetsConfigExtras.cmake:6 (_qt5_Widgets_check_file_exists)
  /usr/i686-w64-mingw32/sys-root/mingw/lib/cmake/Qt5Widgets/Qt5WidgetsConfig.cmake:139 (include)
  CMakeLists.txt:3 (find_package)


CMake Warning (dev) in CMakeLists.txt:
  No cmake_minimum_required command is present.  A line of code such as

    cmake_minimum_required(VERSION 2.8)

  should be added at the top of the file.  The version specified may be lower
  if you wish to support older CMake versions for this project.  For more
  information run "cmake --help-policy CMP0000".
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Configuring incomplete, errors occurred!
See also "/home/pnoffke/tmp/mingw-cmake/mingw-cmake-hello-moc/build/CMakeFiles/CMakeOutput.log".

Comment 4 Fedora Update System 2013-11-27 04:31:08 UTC
Package mingw-qt5-qttranslations-5.1.1-1.fc19, mingw-qt5-qttools-5.1.1-1.fc19, mingw-qt5-qtsensors-5.1.1-1.fc19, mingw-qt5-qtscript-5.1.1-1.fc19, mingw-qt5-qtquick1-5.1.1-1.fc19, mingw-qt5-qtjsbackend-5.1.1-1.fc19, mingw-qt5-qtimageformats-5.1.1-1.fc19, mingw-qt5-qtgraphicaleffects-5.1.1-1.fc19, mingw-qt5-qtdeclarative-5.1.1-1.fc19, mingw-qt5-qt3d-5.0.0-0.5.git20130510.0158ce78.fc19, mingw-qt5-qtbase-5.1.1-4.fc19:
* should fix your issue,
* was pushed to the Fedora 19 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing mingw-qt5-qttranslations-5.1.1-1.fc19 mingw-qt5-qttools-5.1.1-1.fc19 mingw-qt5-qtsensors-5.1.1-1.fc19 mingw-qt5-qtscript-5.1.1-1.fc19 mingw-qt5-qtquick1-5.1.1-1.fc19 mingw-qt5-qtjsbackend-5.1.1-1.fc19 mingw-qt5-qtimageformats-5.1.1-1.fc19 mingw-qt5-qtgraphicaleffects-5.1.1-1.fc19 mingw-qt5-qtdeclarative-5.1.1-1.fc19 mingw-qt5-qt3d-5.0.0-0.5.git20130510.0158ce78.fc19 mingw-qt5-qtbase-5.1.1-4.fc19'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2013-21648/mingw-qt5-qttranslations-5.1.1-1.fc19,mingw-qt5-qttools-5.1.1-1.fc19,mingw-qt5-qtsensors-5.1.1-1.fc19,mingw-qt5-qtscript-5.1.1-1.fc19,mingw-qt5-qtquick1-5.1.1-1.fc19,mingw-qt5-qtjsbackend-5.1.1-1.fc19,mingw-qt5-qtimageformats-5.1.1-1.fc19,mingw-qt5-qtgraphicaleffects-5.1.1-1.fc19,mingw-qt5-qtdeclarative-5.1.1-1.fc19,mingw-qt5-qtbase-5.1.1-4.fc19,mingw-qt5-qt3d-5.0.0-0.5.git20130510.0158ce78.fc19
then log in and leave karma (feedback).

Comment 5 Fedora Update System 2013-12-01 09:39:21 UTC
Package mingw-qt5-qtbase-5.1.1-5.fc19, mingw-qt5-qttranslations-5.1.1-1.fc19, mingw-qt5-qttools-5.1.1-1.fc19, mingw-qt5-qtsensors-5.1.1-1.fc19, mingw-qt5-qtscript-5.1.1-1.fc19, mingw-qt5-qtquick1-5.1.1-1.fc19, mingw-qt5-qtjsbackend-5.1.1-1.fc19, mingw-qt5-qtimageformats-5.1.1-1.fc19, mingw-qt5-qtgraphicaleffects-5.1.1-1.fc19, mingw-qt5-qtdeclarative-5.1.1-1.fc19, mingw-qt5-qt3d-5.0.0-0.5.git20130510.0158ce78.fc19:
* should fix your issue,
* was pushed to the Fedora 19 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing mingw-qt5-qtbase-5.1.1-5.fc19 mingw-qt5-qttranslations-5.1.1-1.fc19 mingw-qt5-qttools-5.1.1-1.fc19 mingw-qt5-qtsensors-5.1.1-1.fc19 mingw-qt5-qtscript-5.1.1-1.fc19 mingw-qt5-qtquick1-5.1.1-1.fc19 mingw-qt5-qtjsbackend-5.1.1-1.fc19 mingw-qt5-qtimageformats-5.1.1-1.fc19 mingw-qt5-qtgraphicaleffects-5.1.1-1.fc19 mingw-qt5-qtdeclarative-5.1.1-1.fc19 mingw-qt5-qt3d-5.0.0-0.5.git20130510.0158ce78.fc19'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2013-21648/mingw-qt5-qttranslations-5.1.1-1.fc19,mingw-qt5-qttools-5.1.1-1.fc19,mingw-qt5-qtsensors-5.1.1-1.fc19,mingw-qt5-qtscript-5.1.1-1.fc19,mingw-qt5-qtquick1-5.1.1-1.fc19,mingw-qt5-qtjsbackend-5.1.1-1.fc19,mingw-qt5-qtimageformats-5.1.1-1.fc19,mingw-qt5-qtgraphicaleffects-5.1.1-1.fc19,mingw-qt5-qtdeclarative-5.1.1-1.fc19,mingw-qt5-qtbase-5.1.1-5.fc19,mingw-qt5-qt3d-5.0.0-0.5.git20130510.0158ce78.fc19
then log in and leave karma (feedback).

Comment 6 Patrick Noffke 2013-12-02 15:47:12 UTC
It works now, thanks!

Comment 7 Fedora Update System 2013-12-03 10:39:39 UTC
mingw-qt5-qtbase-5.1.1-5.fc19, mingw-qt5-qttranslations-5.1.1-1.fc19, mingw-qt5-qttools-5.1.1-1.fc19, mingw-qt5-qtsensors-5.1.1-1.fc19, mingw-qt5-qtscript-5.1.1-1.fc19, mingw-qt5-qtquick1-5.1.1-1.fc19, mingw-qt5-qtjsbackend-5.1.1-1.fc19, mingw-qt5-qtimageformats-5.1.1-1.fc19, mingw-qt5-qtgraphicaleffects-5.1.1-1.fc19, mingw-qt5-qtdeclarative-5.1.1-1.fc19, mingw-qt5-qt3d-5.0.0-0.5.git20130510.0158ce78.fc19 has been pushed to the Fedora 19 stable repository.  If problems still persist, please make note of it in this bug report.