[Interest] using cmake to build Qt projects.

william.crocker at analog.com william.crocker at analog.com
Thu May 5 13:18:16 CEST 2016


On 05/05/2016 06:08 AM, Jean-Michaƫl Celerier wrote:
>>  I am almost there, but when it links there are symbols undefined.
>>  From my experience the symbols I am seeing are typical of missing moc files.
>
> You should still post your error messages I think, maybe it's some library that
> Qt links automatically but that you have to link by hand with CMake ?

No. They were my symbols.

[Resolution]

Just as with qmake, one has to declare all of the .h files.
When I add the .h files to the add_executable() statement it
works. This so they can be MOCed.

Thanks.

Bill

I also had to add -pthread to my
set(CMAKE_CXX_FLAGS "-m32 -pthread").

>
>
> On Wed, May 4, 2016 at 7:29 PM, william.crocker at analog.com
> <mailto:william.crocker at analog.com> <william.crocker at analog.com
> <mailto:william.crocker at analog.com>> wrote:
>
>     On 05/04/2016 01:07 PM, Thiago Macieira wrote:
>
>         On quarta-feira, 4 de maio de 2016 10:08:27 PDT Bill Crocker wrote:
>
>              From my experience the symbols I am seeing are typical of missing moc
>             files. I know I have all of my #include "abc.moc" statements in place
>             because my project builds fine with qmake.
>
>
>         That probably is. You need to tell cmake to handle the moc files. Either use
>         qt4_wrap_moc (or whatever the macro is called) or turn automoc on.
>
>
>     Per the inclusion of my cmake instruction file at the end of the post,
>     that is what I thought these two lines were for.
>
>     set(CMAKE_AUTOMOC TRUE)
>     set(CMAKE_INCLUDE_CURRENT_DIR ON)
>
>     _______________________________________________
>     Interest mailing list
>     Interest at qt-project.org <mailto:Interest at qt-project.org>
>     http://lists.qt-project.org/mailman/listinfo/interest
>
>




More information about the Interest mailing list