set(CMAKE_AUTOMOC ON) is great.<br>But for now I have to use qt5_wrap_ui macros.<br>e.g.<br><br clear="all"><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote">

cmake_minimum_required(VERSION 2.8.9 FATAL_ERROR)<br><br>project(testproject)<br><br># Find includes in corresponding build directories<br>set(CMAKE_INCLUDE_CURRENT_DIR ON)<br># Instruct CMake to run moc automatically when needed<br>

set(CMAKE_AUTOMOC ON)<br><br># Find the QtWidgets library<br>find_package(Qt5Widgets REQUIRED)<br><br># Tell CMake to create the helloworld executable<br>add_executable(helloworld<br>    main.cpp<br>    mainwindow.cpp<br>

    mainwindow.ui<br>)<br><br># Use the Widgets module from Qt 5<br>qt5_use_modules(helloworld Widgets)<br><br># Support UI files<br>qt5_wrap_ui(ui_mainwindow.h mainwindow.ui)<br><br></blockquote>Any help? Thanks!<br><br clear="all">

-- <br><div>Best Regards</div>
<div>Yuchen</div><br>