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. [Solved] qmake with subdirs
Forum Updated to NodeBB v4.3 + New Features

[Solved] qmake with subdirs

Scheduled Pinned Locked Moved Qt Creator and other tools
5 Posts 4 Posters 12.4k Views 1 Watching
  • 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.
  • M Offline
    M Offline
    mrwienh
    wrote on last edited by
    #1

    Hi,

    we are currently compiling a tool library and an application using two different project files (which we load into QT Creator seperately). To make things easier I have been trying to write a project file which combines these two projects using the subdirs template - since we also work with Visual Studio on Windows we hope to also generate VC solutions including 2 projects from this...

    I wrote a simple file that sits in a "project" directory which includes the relative paths to the relevant projects (although not really subdirs):

    TEMPLATE = subdirs
    CONFIG += qt debug_and_release
    SUBDIRS = ../libs/mylib ../apps/myapp
    myapp.depends = mylib

    this generates a Makefile but on compiling gives this error:

    Makefile:66: *** multiple target patterns. Stop.

    Same error message occurs in QT Creator (although the 2 projects load fine), furthermore the debug or release chooser is not accesible...

    What am I doing wrong? Does this happen because my dirs are not really subdirs of the main project file? If so, how do you layout a structure with libraries that span to other projects and thus can't be subdirs of the app in question?

    Many thanks

    Markus Wienhöfer

    1 Reply Last reply
    0
    • V Offline
      V Offline
      vcwong
      wrote on last edited by
      #2

      can you show the generated Makefile?

      --

      vcwong

      1 Reply Last reply
      0
      • M Offline
        M Offline
        mrwienh
        wrote on last edited by
        #3

        Hi,

        I actually found out that the problem was, that the mylib folder included an older version of the Makefile. I was under the assumption that calling qmake for the subdirs project would also invoke qmake for the sub-projects.

        The file loads fine now and compiles BUT:

        I am not able to choose any other target than DEBUG in either QT Creator or XCode. The sub projects themselves do compile fine and give me an option between DEBUG and RELEASE. When loading the subdirs project the dropdown is disabled in QT Creator.

        All project files do include a line

        CONFIG += debug_and_release

        though. (the single projects for compiling them individually and the subdirs project for compiling them together)

        The bundle project's Makefile does include targets for Debug, Release and All if I generate a Makefile via qmake -spec macx-g++ and compiles fine for all targets. Only when using the same project file in Creator or create an XCode project from it I'm stuck with Debug only...

        1 Reply Last reply
        0
        • D Offline
          D Offline
          Duck
          wrote on last edited by
          #4

          What happens if you just leave out the CONFIG += qt debug_and_release line?

          1 Reply Last reply
          0
          • S Offline
            S Offline
            stukdev
            wrote on last edited by
            #5

            In qtcreator project setting you can able to create specific 'mode' compilation, you can add release mode.

            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