[CMake] Qt-Sources and non Qt-Source

John Drescher drescherjm at gmail.com
Tue Aug 12 11:33:53 EDT 2008


On Tue, Aug 12, 2008 at 11:24 AM, Jan Dinger <dinger.jan at googlemail.com> wrote:
> Hello folks,
>
> I've a CMakeLists.txt, this file works fine. Now I've added a small wrapper,
> this wrapper is no Qt-Code (no Q_OBJECT flag). How can I merge this in my
> CMakeLists.txt?
>
> make crashes with the this error:
> ### snip ###
> make[2]: *** No rule to make target `../.src/xmlhandler/xmlhandler.h',
> needed by `.src/xmlhandler/moc_xmlhandler.cxx'.  Stop.
> make[1]: *** [CMakeFiles/autoluncher.dir/all] Error 2
> make: *** [all] Error 2
> ### snap ###
>
> xmlhandler.h is plain c++
>
> How can I integrate it in my CMakeLists.txt?
>
> Here is my CMakeLists.txt
> ### snip ###
> PROJECT( autoluncher )
>
> CMAKE_MINIMUM_REQUIRED(VERSION 2.6.0)
>
> FIND_PACKAGE( Qt4 REQUIRED )
>
> SET( AUTOLUNCHER_SRCS
>     ./src/main.cpp
>     ./src/mainwindow/mainwindow.cpp
>     ./src/xmlhandler/xmlhandler.cpp
> )
>
> SET( AUTOLUNCHER_MOC_HDRS
>     ./src/mainwindow/mainwindow.h
>     .src/xmlhandler/xmlhandler.h
> )
>
Your path is wrong for the header file. It should be ./src not .src

John


More information about the CMake mailing list