[CMake] QT_WRAP_UI no generated file Bug or Mistake

Mike Jackson mike.jackson at imts.us
Sat Aug 2 10:41:29 EDT 2008


Couple of things:

  _I_ suggest adding the following to your CMakeLists.txt file:

# ---------- Setup output Directories -------------------------
SET (LIBRARY_OUTPUT_PATH
   ${PROJECT_BINARY_DIR}/Bin
   CACHE PATH
   "Single Directory for all Libraries"
   )

# --------- Setup the Executable output Directory -------------
SET (EXECUTABLE_OUTPUT_PATH
   ${PROJECT_BINARY_DIR}/Bin
   CACHE PATH
   "Single Directory for all Executables."
   )

just AFTER the

CMAKE_MINIMUM_REQUIRED(VERSION 2.6.0)


Also, in your mainwindow.h and loginwindow.h files you have something  
like:

#include "../../build/ui_mainwindow.h"

change that to:

#include "ui_mainwindow.h"

Lastly, you had a typo in this line
ADD_EXECUTABLE( dummy ${DUMMY_SRCS} ${DUMMY_MOC_SRCS} $ 
{DUMMY_RC_SRCS} ${DUMMY_UI_HDRS} )

It should be:

ADD_EXECUTABLE( dummy ${DUMMY_SRCS} ${DUMMY_MOC_SRCS} $ 
{DUMMY_RC_SRCS} ${DUMMY_UIS_HDRS} )

After all that the ui_* files will be generated. Still doesn't  
compile but I'll let you figure that part out.

Cheers
-- 
Mike Jackson   Senior Research Engineer
Innovative Management & Technology Services


On Aug 2, 2008, at 8:39 AM, Jan Dinger wrote:

> Hello,
>
> sorry, but it don't works, same error. I've no idea what I can do.  
> I've toke a look at other QtApps that use cmake, I can't see any  
> mistakes in my CMakeLists.txt (after changes by Leo).
>
> I've uploaded my dummy program, this is only a test program. All  
> needed files included. I hope someone has time to test it, than we  
> can locate the error, because I hope this was my mistake and not a  
> bug.
>
> Cmake is a nice tool but I don't understand the logic. This error  
> is unbelievable, other qtApps use cmake too.
> If cmake don't work with my small dummy program I can't use it on  
> my projects...
>
> Here you can download my test program: http://www.jan-fox.org/ 
> downloads/dummy.tar.gz
>
> If there someone to can't test it here is the new CMakeLists.txt:
>
> ###snip###
> PROJECT( dummy )
>
> CMAKE_MINIMUM_REQUIRED(VERSION 2.6.0)
>
> FIND_PACKAGE( Qt4 REQUIRED )
>
> IF(QT_QTSQL_NOTFOUND)
>     MESSAGE(FATAL_ERROR "Looking for QtSQL -- not found, this  
> projects needs QTSQL")
> ELSE(QT_QTSQL_NOTFOUND)
>     MESSAGE(STATUS "Looking for QtSQL -- found")
>     set(QT_USE_QTSQL TRUE)
> ENDIF(QT_QTSQL_NOTFOUND)
>
> SET( DUMMY_SRCS
>     ./src/main.cpp
>     ./src/logindialog/logindialog.cpp
>     ./src/mainwindow/mainwindow.cpp
> )
>
> SET( DUMMY_MOC_HDRS
>     ./src/logindialog/logindialog.h
>     ./src/mainwindow/mainwindow.h
> )
>
> SET( DUMMY_UIS
>     ./ui/logindialog.ui
>     ./ui/mainwindow.ui
> )
>
> SET( DUMMY_RCS
>     ./images/dummy.qrc
> )
>
> ADD_DEFINITIONS( -Wall )
>
> INCLUDE( ${QT_USE_FILE} )
>
> INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR})
>
> QT4_ADD_RESOURCES( DUMMY_RC_SRCS ${DUMMY_RCS} )
>
> QT4_WRAP_CPP( DUMMY_MOC_SRCS ${DUMMY_MOC_HDRS} )
>
> QT4_WRAP_UI(DUMMY_UIS_HDRS ${DUMMY_UIS} )
>
> ADD_EXECUTABLE( dummy ${DUMMY_SRCS} ${DUMMY_MOC_SRCS} ${DUMMY_RC_SRCS}
> ${DUMMY_UI_HDRS} )
>
> TARGET_LINK_LIBRARIES( dummy ${QT_LIBRARIES} )
> ###snap###
>
> Special thanks at all
>
> so long
> jd
> _______________________________________________
> CMake mailing list
> CMake at cmake.org
> http://www.cmake.org/mailman/listinfo/cmake

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20080802/d06d5acc/attachment.htm>


More information about the CMake mailing list