[CMake] cmake qt4 for dummies

David Cole david.cole at kitware.com
Wed Nov 24 11:44:46 EST 2010


The BundleUtilities example may be found here, by the way:
http://www.cmake.org/Wiki/BundleUtilitiesExample

(Sorry for forgetting the link on the original reply...)


On Wed, Nov 24, 2010 at 11:33 AM, David Cole <david.cole at kitware.com> wrote:
> The example that demonstrates how to use BundleUtilities contains a Qt
> app. See the CMakeLists file in that project for clues about how to
> structure a Qt application.
>
> See also CMake itself, in the CMake/Source/QtDialog. And ParaView, too
> -- it's a Qt app.
>
> Start with the example, though, it's much simpler than either CMake or ParaView.
>
>
> HTH,
> David
>
>
> On Wed, Nov 24, 2010 at 12:25 PM, luxInteg <lux-integ at btconnect.com> wrote:
>> Greetings,
>>
>> I am learning cmake.  I am  now  having a go at learning   to   compile a qt4
>> project wuth cmake.  I am  starting with  qt-4.6.2  and  I want to play with
>> compiling a small project  into a  library.
>>
>>
>> From what I can discern most things  seem straightforward but some   files
>> seemd to need  transforming  by the  so called MOC:-
>>
>> Lets say I have a  project that uses qmake  with the following files
>> ../src/file1.cpp
>> ../src/file2.cpp
>>
>>  to compile into   some library  libTESTcpp.a.  After running qmake   and make
>> the build-log reveals:-
>> compiled file1.cpp
>> cpmpiled file2.cpp
>> compiled moc/moc_file2.cpp
>>
>> then
>> archived *.o  ino libTESTcpp.a.
>>
>> SO when porting the setup to cmake:-
>> a) Can  the  transformation for file2.cpp  to moc/moc_file2.cpp be  manually
>> done  as per:-
>> configure_file(../src/file2.cpp ../src/moc/moc_file2.cpp @COPYONLY)  ?  OR
>>
>> b) Is it done otherwise and if so how so?
>>
>> The cmake qt4 examples I managed to find on the internet  eg
>> (
>> http://developer.qt.nokia.com/quarterly/view/using_cmake_to_build_qt_projects
>> )
>> tend to be  for executable files the most useful one (linked above)  mentioned
>> moc-headers, ui-files  qrc  files  none of which are present in this project.
>>
>>
>> Advice would be appreciated.
>>
>> luxInteg
>> _______________________________________________
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>>
>> Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ
>>
>> Follow this link to subscribe/unsubscribe:
>> http://www.cmake.org/mailman/listinfo/cmake
>>
>


More information about the CMake mailing list