Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. How do I generate different Makefile versions for a project for different compile options other than debug/release... user define options

How do I generate different Makefile versions for a project for different compile options other than debug/release... user define options

Scheduled Pinned Locked Moved Qt Creator and other tools
2 Posts 2 Posters 2.1k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    celticdaddio
    wrote on last edited by
    #1

    I currently use hand crafted makefiles and I want to convert to using qmake.
    I have a master make file at the root of my source tree. When I make at this level, it drills down through the source tree issuing gmake commands for sub projects and passing certain options to the make files for the sub projects. The complication in converting to qmake arises in that I don't know how to handle this particular situation which is, that some projects want other projects built differently, that other projects would want that same project built. For example...

    Project A depends on Project B built with options X, Y, Z

    However

    Project C depends on Project B built with only option Y.

    I know i need a .pro file for each project, but I am not sure how to use qmake to generate the appropriate Makefile for project B in each case.

    If I could pass user define arguments to qmake with the pro filename I guess I could handle it that way, but how can I pass variables in to my .pro file to determine the Makefile generated...

    Any suggestions?

    Ed

    1 Reply Last reply
    0
    • L Offline
      L Offline
      loladiro
      wrote on last edited by
      #2

      Just create 2 .pro files (you can put options that are shared in a .pri file and use include()) and adjust $$DESTDIR and all directories that will contain intermediate files that are different between the two versions:
      @
      MOC_DIR
      OBJECTS_DIR
      RCC_DIR
      UI_DIR
      QMAKE_MAKEFILE
      @

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved