MantisBT - CMake
View Issue Details
0015853CMakeCMakepublic2015-11-19 13:552016-05-02 08:30
Joshua Pedrick 
 
normalminoralways
closedno change required 
linux-gccUbuntu12.04
CMake 3.4 
 
0015853: qt5_wrap_ui has no effect
qt5_wrap_ui just doesn't do anything at all.
create a ui: example.ui
find_package(Qt5Widgets REQUIRED)
qt5_wrap_ui( ui_example.h example.ui )

run cmake
run build
See that ui_example.h is not generated.

sample project included.
No tags attached.
tar ui_example.tar (10,240) 2015-11-19 13:55
https://public.kitware.com/Bug/file/5582/ui_example.tar
Issue History
2015-11-19 13:55Joshua PedrickNew Issue
2015-11-19 13:55Joshua PedrickFile Added: ui_example.tar
2015-11-19 13:57Clinton StimpsonNote Added: 0039886
2015-11-19 14:05Brad KingNote Added: 0039887
2015-11-19 14:05Brad KingStatusnew => resolved
2015-11-19 14:05Brad KingResolutionopen => no change required
2015-11-19 14:11Joshua PedrickNote Added: 0039888
2015-11-19 14:18Brad KingNote Added: 0039889
2015-11-19 14:19Joshua PedrickNote Added: 0039890
2015-11-19 14:24Clinton StimpsonNote Added: 0039891
2015-11-19 14:25Brad KingNote Added: 0039892
2015-11-19 14:43Joshua PedrickNote Added: 0039893
2015-11-19 14:52Joshua PedrickNote Added: 0039894
2016-05-02 08:30Robert MaynardNote Added: 0040964
2016-05-02 08:30Robert MaynardStatusresolved => closed

Notes
(0039886)
Clinton Stimpson   
2015-11-19 13:57   
Your sample project is missing the qt5_wrap_ui() call.
(0039887)
Brad King   
2015-11-19 14:05   
Furthermore, qt5_wrap_ui is provided by Qt5 packages and not by CMake. If there is a problem it needs to be reported to Qt folks.
(0039888)
Joshua Pedrick   
2015-11-19 14:11   
Ok,I added it in my own copy and it's still not working. Will report to Qt project.


```
cmake_minimum_required( VERSION 3.4 )

set(CMAKE_CXX_COMPILER g++)
set(CMAKE_C_COMPILER gcc)

project( example CXX )

set(CMAKE_AUTOMOC OFF)
set(CMAKE_AUTOUIC OFF)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
find_package(Qt5Widgets REQUIRED)

qt5_wrap_ui( ui_example.h ui_example.h )

add_library( example example.cpp ui_example.h )
```


running make:

-- Configuring done
-- Generating done
-- Build files have been written to: /home/jpedrick/Development/uncompress/ui_example/build
Scanning dependencies of target example
[ 50%] Building CXX object CMakeFiles/example.dir/example.cpp.o
/home/jpedrick/Development/uncompress/ui_example/example.cpp:1:24: fatal error: ui_example.h: No such file or directory
 #include "ui_example.h"
                        ^
compilation terminated.
(0039889)
Brad King   
2015-11-19 14:18   
> cmake_minimum_required( VERSION 3.4 )

Does the problem occur with CMake 3.3?
(0039890)
Joshua Pedrick   
2015-11-19 14:19   
@brad.king I believe I'm reporting a bug in cmQTWrapUICommand.cxx cmQTWrapUICommand.h, which is part of cmake...

I'm not sure how or where else to report this bug.
(0039891)
Clinton Stimpson   
2015-11-19 14:24   
Its a bug in your example.

The documentation for this is found here:
http://doc.qt.io/qt-5/cmake-manual.html [^]

For example.
qt5_wrap_ui( UI_SRCS ui_example.h )
add_library( example example.cpp ${UI_SRCS} )

A discussion on a mailing list seems more appropriate for this than a bug report.
Since its documented by Qt, bringing it up on their mailing list is better.
(0039892)
Brad King   
2015-11-19 14:25   
Re 0015853:0039890: cmQTWrapUICommand implements a command called "qt_wrap_ui":

 https://cmake.org/gitweb?p=cmake.git;a=blob;f=Source/cmQTWrapUICommand.h;hb=v3.4.0#l46 [^]

The only mention of "qt5_wrap_ui" in our source tree is for building cmake-gui with Qt5:

 https://cmake.org/gitweb?p=cmake.git;a=blob;f=Source/QtDialog/CMakeLists.txt;hb=v3.4.0#l23 [^]
(0039893)
Joshua Pedrick   
2015-11-19 14:43   
Ok, seems like using qt_wrap_ui also is a no op for me. I'll investigate and see if I can narrow it down to an actual bug or not.
(0039894)
Joshua Pedrick   
2015-11-19 14:52   
Ok, looks like it was just ambiguous documentation. Looking at QtDialog/CMakeLists.txt cleared it up.

I agree that this is not a bug.
(0040964)
Robert Maynard   
2016-05-02 08:30   
Closing resolved issues that have not been updated in more than 4 months.