Results 1 to 6 of 6

Thread: Qt Creator and big auto generated makefiles

  1. #1
    Join Date
    May 2015
    Posts
    3

    Default Qt Creator and big auto generated makefiles

    Suppose I create new project in Qt Creator by Non-Qt Project->Plain C++ Project.
    Unfortunately makefile generated by editor has ~20KB garbages I don't need for my simple 'Hello World' like *.pri files and compiler_yacc_decl_* rules.
    I guess there is some file in Tools/QtCreator/share/qtcreator/templates/wizards that should be modified but I couldn't grep that. Removing those lines:
    include(deployment.pri)
    qtcAddDeployment()
    from Tools/QtCreator/share/qtcreator/templates/wizards/plaincppapp/qmake/project.pro
    did't help.
    Is it possible to force Qt Creator to not generating so big makefiles for new projects?

  2. #2
    Join Date
    Dec 2009
    Location
    New Orleans, Louisiana
    Posts
    791
    Thanks
    13
    Thanked 153 Times in 150 Posts
    Qt products
    Qt5
    Platforms
    MacOS X

    Default Re: Qt Creator and big auto generated makefiles

    You could probably hack your way around and change what is generated by qmake, but seriously, why do you care about 20KB worth of files?

    Surely time spent developing and testing your application is more important than trying to reduce your build footprint by 20KB. If you are worried about the size of distributing your application, you shouldn't be distributing any generated files, including make files anyway. Just include the files required to build your application, etc.

    Just my opinon.

  3. #3
    Join Date
    May 2015
    Posts
    3

    Default Re: Qt Creator and big auto generated makefiles

    "hack your way around and change what is generated by qmake"
    That's what I would like to know. Could you provide more informations how to do this?

    <offtop>
    "but seriously, why do you care about 20KB worth of files?"
    I don't use Qt framework at all and I just don't need anything associated with Qt framework (like extra *.pri).
    That's not any kind of premature optimization. If you have some unsused variables in your code I guess you just remove them. That's the same.
    Clean code approach applied to makefiles

    "you shouldn't be distributing any generated files, including make files anyway"
    I disagree. I believe that attaching makefile to projects (e.g on github) is good practice.
    Ability to building some project downloaded from internet is important thing for me.
    </offtop>

    Thanks for response

  4. #4
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,419
    Thanks
    37
    Thanked 1,546 Times in 1,496 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Qt Creator and big auto generated makefiles

    Quote Originally Posted by yurai View Post
    <offtop>
    "but seriously, why do you care about 20KB worth of files?"
    I don't use Qt framework at all and I just don't need anything associated with Qt framework (like extra *.pri).
    Then maybe you don't want to use a qmake based project.

    Quote Originally Posted by yurai View Post
    I believe that attaching makefile to projects (e.g on github) is good practice.
    Ability to building some project downloaded from internet is important thing for me.
    You are mixing two things.

    The ability to build a project by having all necessary build input files is indeed good practise, but in this case those are not the Makefiles.
    The Makefiles generated by qmake are already build artefacts, specific to the platform and possibly even the machine qmake ran on.

    Cheers,
    _

  5. #5
    Join Date
    Dec 2009
    Location
    New Orleans, Louisiana
    Posts
    791
    Thanks
    13
    Thanked 153 Times in 150 Posts
    Qt products
    Qt5
    Platforms
    MacOS X

    Default Re: Qt Creator and big auto generated makefiles

    Quote Originally Posted by yurai View Post
    "hack your way around and change what is generated by qmake"
    That's what I would like to know. Could you provide more informations how to do this?
    Sorry, I have never had the need to do this, so I wouldn't know how to recommend for you to get started.

    Quote Originally Posted by yurai View Post
    I don't use Qt framework at all and I just don't need anything associated with Qt framework (like extra *.pri).
    That's not any kind of premature optimization. If you have some unsused variables in your code I guess you just remove them. That's the same.
    Clean code approach applied to makefiles
    If you're not using the Qt framework, then I would question why you're using qmake at all. Why not just hand code your Makefile and make it lean and mean if that's important to you?


    Quote Originally Posted by yurai View Post
    "you shouldn't be distributing any generated files, including make files anyway"
    I disagree. I believe that attaching makefile to projects (e.g on github) is good practice.
    Ability to building some project downloaded from internet is important thing for me.
    My point was the qmake generates the Makefile, specific to *your* build system. If you continue to use qmake for your project, the end user should run qmake on *their* system so that a Makefile is generated for their specific system. For example, I'm a mac user, the Makefile you generate for Linux or Windows will be useless for me or anyone else whose build system doesn't match yours exactly.

    Even the standard GNU build system consists of configure, make, make install. The configure step generates a Makefile that is appropriate for the user's system.

    Anyway, I wish I could be of more help, but I have never attempted to influence the stuff included in a qmake generated Makefile, other than the built-in qmake directives that allow you to add post-link commands and platform specific compiler/linker options, etc.

  6. #6
    Join Date
    May 2015
    Posts
    3

    Default Re: Qt Creator and big auto generated makefiles

    Finally I solved problem by producing my project from "scratch" by creating files manually and importing them.
    It requires some extra effort like setting include paths, preparing build and run configurations which is not so good but from the other hand
    I have directory hierarchy like I wanted to and custom makefiles without qmake dependency.
    Thanks for help and advices.

Similar Threads

  1. License for auto-generated code
    By undp in forum Qt Quick
    Replies: 2
    Last Post: 17th January 2012, 22:08
  2. How to make use of the INSTALL_ROOT that resides in generated Makefiles?
    By RomaHagen in forum Installation and Deployment
    Replies: 0
    Last Post: 2nd December 2011, 18:25
  3. Renaming auto-generated UI class
    By orfner in forum Qt Tools
    Replies: 2
    Last Post: 8th September 2011, 20:33
  4. default target in generated makefiles
    By iefremov in forum Installation and Deployment
    Replies: 1
    Last Post: 24th December 2010, 10:57
  5. Generated Makefiles clean-up
    By tora in forum Qt Programming
    Replies: 3
    Last Post: 4th June 2009, 11:45

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.