Results 1 to 3 of 3

Thread: Qt pro files and CMAKE library projects

  1. #1
    Join Date
    Aug 2011
    Posts
    38
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Qt pro files and CMAKE library projects

    It's possible to add cmake based project to .pro a.k.a qmake build process ? I would like build need CMake projects together with qmake based project using subdir template.

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Qt pro files and CMAKE library projects

    Hmm, you might need some dummy source file to satisfy the requirements of the lib target inside your custom .pro file for the sub project and a custom target that actually runs the build.

    The cmake step is probably just a call with QMake's system() inside the .pro file for the sub directory.

    Though it might be worthwhile to consider switching to cmake for the overall project.

    Cheers,
    _

  3. #3
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,240
    Thanks
    303
    Thanked 865 Times in 852 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Qt pro files and CMAKE library projects

    There is Qt documentation on using CMake with Qt. There is similar documentation on the KDAB web site.

    There is an (abandoned) SourceForge project which supposedly generates CMakelists.txt files from .pro files, but as the comments there imply, it may not work well for complex Qt projects.

    It would be better from a maintainability point of view to just pick one build system or the other and port your projects to use that one exclusively. Otherwise, I think anda_skoa's suggestion to run cmake from QMake (or the corresponding cmake version to run an external QMake process) is the only way to have a mixed build system.

    A mixed build system would probably give you headaches trying to track down why (and where) builds fail, because the two build systems probably won't communicate problems to each other very well.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

Similar Threads

  1. how can I unite qm files from various projects
    By iskenderoguz in forum Newbie
    Replies: 1
    Last Post: 11th June 2014, 14:27
  2. Replies: 2
    Last Post: 3rd July 2013, 04:27
  3. Qt Creator Adding files to cmake project
    By xadian in forum Qt Tools
    Replies: 1
    Last Post: 1st April 2013, 15:18
  4. Using Cmake in qt5 projects
    By alizadeh91 in forum Qt Programming
    Replies: 0
    Last Post: 14th August 2012, 10:21
  5. Linking files from different projects
    By kzaarouri in forum Qt Programming
    Replies: 3
    Last Post: 4th March 2012, 04:54

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.