<div dir="ltr">Hi, folks <br><br>Iam using cmake-2.6.0 and there is somthing wrong...<br><br>QT_WRAP_UI generates no File, so I can&#39;t compile my souce code.<br><br>Here is my CMakeLists.txt<br>###snip###<br>PROJECT( dummy )<br>
<br>CMAKE_MINIMUM_REQUIRED(VERSION 2.6.0)<br><br>#set(CMAKE_MODULE_PATH &quot;${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules&quot; )<br><br>FIND_PACKAGE( Qt4 REQUIRED )<br>IF(QT_FOUND)<br>&nbsp;&nbsp;&nbsp; INCLUDE(${QT_USE_FILE})<br>&nbsp;&nbsp;&nbsp; IF(QT_QTSQL_FOUND)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; INCLUDE_DIRECTORIES(${QT_QTSQL_INCLUDE_DIR})<br>&nbsp;&nbsp;&nbsp; ELSE(QT_QTSQL_FOUND)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; MESSAGE(FATAL ERROR &quot;Qt SQL libraries missing.&quot;)<br>&nbsp;&nbsp;&nbsp; ENDIF(QT_QTSQL_FOUND)<br>&nbsp;&nbsp;&nbsp; ELSE(QT_FOUND)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; MESSAGE(FATAL ERROR &quot;Qt4 not found.&quot;)<br>
ENDIF(QT_FOUND)<br><br><br>SET( DUMMY_SRCS<br>&nbsp;&nbsp;&nbsp; ./src/main.cpp<br>&nbsp;&nbsp;&nbsp; ./src/logindialog/logindialog.cpp<br>&nbsp;&nbsp;&nbsp; ./src/mainwindow/mainwindow.cpp<br>)<br><br>SET( DUMMY_MOC_HDRS<br>&nbsp;&nbsp;&nbsp; ./src/logindialog/logindialog.h<br>&nbsp;&nbsp;&nbsp; ./src/mainwindow/mainwindow.h<br>
)<br><br>SET( DUMMY_UIS<br>&nbsp;&nbsp;&nbsp; ./ui/logindialog.ui<br>&nbsp;&nbsp;&nbsp; ./ui/mainwindow.ui<br>)<br><br>SET( DUMMY_RCS<br>&nbsp;&nbsp;&nbsp; ./images/dummy.qrc<br>)<br><br>ADD_DEFINITIONS( -Wall )<br><br>SET( QT_USE_QTSQL TRUE )<br><br>QT4_ADD_RESOURCES( DUMMY_RC_SRCS ${DUMMY_RCS} )<br>
<br>IF(QT_WRAP_CPP)<br>&nbsp;&nbsp;&nbsp; &nbsp;IF (QT_WRAP_UI)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; QT4_WRAP_UI(DUMMY_UIS_HDRS ${DUMMY_UIS} )<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; QT4_WRAP_CPP( DUMMY_MOC_SRCS ${DUMMY_MOC_HDRS} )<br>&nbsp;&nbsp;&nbsp; ENDIF (QT_WRAP_UI)<br>ENDIF(QT_WRAP_CPP)<br><br>INCLUDE_DIRECTORIES( ${CMAKE_BINARY_DIR} )<br>
<br>ADD_EXECUTABLE( dummy ${DUMMY_SRCS} ${DUMMY_MOC_SRCS} ${DUMMY_RC_SRCS} ${DUMMY_UI_HDRS} )<br><br>TARGET_LINK_LIBRARIES( dummy ${QT_LIBRARIES} ${QT_QTSQL_LIBRARIES} )<br><br>###snap###<br><br>Here is my compile process:<br>
<br>###snip###<br>[ 11%] Generating qrc_dummy.cxx<br>[ 22%] Generating src/logindialog/moc_logindialog.cxx<br>[ 33%] Generating src/mainwindow/moc_mainwindow.cxx<br>Scanning dependencies of target dummy<br>[ 44%] Building CXX object CMakeFiles/dummy.dir/src/main.cpp.o<br>
In file included from /home/jan/workspace/cpp/dummy/src/main.cpp:4:<br>/home/jan/workspace/cpp/dummy/src/mainwindow/mainwindow.h:3:39: error: ../../build/ui_mainwindow.h: No such file or directory<br>In file included from /home/jan/workspace/cpp/dummy/src/main.cpp:5:<br>
/home/jan/workspace/cpp/dummy/src/logindialog/logindialog.h:5:40: error: ../../build/ui_logindialog.h: No such file or directory<br>In file included from /home/jan/workspace/cpp/dummy/src/main.cpp:4:<br>/home/jan/workspace/cpp/dummy/src/mainwindow/mainwindow.h:5: error: 'Ui' has not been declared<br>
/home/jan/workspace/cpp/dummy/src/mainwindow/mainwindow.h:5: error: expected `{&#39; before 'mainwindow'<br>/home/jan/workspace/cpp/dummy/src/mainwindow/mainwindow.h:5: error: function definition does not declare parameters<br>
In file included from /home/jan/workspace/cpp/dummy/src/main.cpp:5:<br>/home/jan/workspace/cpp/dummy/src/logindialog/logindialog.h:7: error: 'Ui' has not been declared<br>/home/jan/workspace/cpp/dummy/src/logindialog/logindialog.h:7: error: expected `{&#39; before 'logindialog'<br>
/home/jan/workspace/cpp/dummy/src/logindialog/logindialog.h:7: error: function definition does not declare parameters<br>/home/jan/workspace/cpp/dummy/src/main.cpp: In function 'int main(int, char**)':<br>/home/jan/workspace/cpp/dummy/src/main.cpp:17: error: aggregate 'CLoginDialog logindialog' has incomplete type and cannot be defined<br>
/home/jan/workspace/cpp/dummy/src/main.cpp:18: error: aggregate 'CMainWindow window' has incomplete type and cannot be defined<br>/home/jan/workspace/cpp/dummy/src/main.cpp:19: error: incomplete type 'CLoginDialog' used in nested name specifier<br>
make[2]: *** [CMakeFiles/dummy.dir/src/main.cpp.o] Error 1<br>make[1]: *** [CMakeFiles/dummy.dir/all] Error 2<br>make: *** [all] Error 2<br>###snap###<br><br>The error is correct, I can&#39;t compile without any ui_xxx.h files. So whats is wrong with my CMakeLists.txt <br>
<br>I hope someone has a little bit time to help me.<br><br>I hope it is my mistake and no bug....<br><br>so long<br>jd<br><br></div>