qt5_wrap_ui(<VAR> ui_file1 [ui_file2 ...]
            [OPTIONS ...])


Creates rules for calling the User Interface Compiler (uic) on the given .ui files. For each input file, an header file is generated in the build directory. The paths of the generated header files are added to <VAR>.

Note: This is a low-level macro. See the CMake AUTOUIC Documentation for a more convenient way to process .ui files with uic.

Note: For compatibility with Qt 6, the command is also available under the name qt_wrap_ui.


You can set additional OPTIONS that should be added to the uic calls. You can find possible options in the uic documentation.


set(SOURCES mainwindow.cpp main.cpp)
qt5_wrap_ui(SOURCES mainwindow.ui)
add_executable(myapp ${SOURCES})

© 2024 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.