Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. Separates "bin" and "build" at compile with Shadow Build

Separates "bin" and "build" at compile with Shadow Build

Scheduled Pinned Locked Moved Installation and Deployment
2 Posts 2 Posters 830 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.
  • C Offline
    C Offline
    calak
    wrote on last edited by
    #1

    Hello everyone!

    I work on a "big" project, with a lot of SubProjects, so I tried to keeping a clear files organization:

    @
    [Project Root]
    ├ 3rdparty
    ├ bin (Final executableS fileS, including DLL on Windows)
    │ ├ linux
    │ │ └ ...
    │ ├ win32
    │ │ ├ release
    │ │ │ ├ SomeApp.exe
    │ │ │ ├ AnotherApp.exe
    │ │ │ ├ SomeDynamicLib.dll
    │ │ │ └ ...
    │ │ ├ debug
    │ │ │ └ ...
    │ │ └ tests
    │ │ └ ...
    │ └ ...
    ├ build (all object files, removed on a clean)
    │ └ (same structure as "bin")
    ├ doc
    ├ include (project specific headers)
    ├ lib (lib*.a, lib*d.a)
    ├ src (Sources of apps and libs, including *.h)
    │ ├ SomeApp
    │ ├ AnotherApp
    │ ├ SomeDynamicLib
    │ └ ...
    └ resource@

    I want to have the objects files out from sources' directory, so I use Shadow Build and I sets BuildDir pointing to "/Project's Root/build/".
    The problem is that binary files (final apps and libs) are builds in this directory too.
    Also, if I add "DESTDIR=/ProjectRoot/bin/" (so, out of the BuildDir path) in the .pro file , i get this error at compile.

    "Makefile.Debug:74: error : multiple target patterns. Stop."

    If I set BuildDir directly to the Project's Root, i can place binaries to /bin/, but when I compile, Qt creates (unwanted) directories that corresponds to sub projects at this place (then directly in the "Project's Root").

    Does it exists a way to make what I want?

    • Compiled binaries in bin/ (per exemple *.exe and *.dll on Windows)
    • Objects files and makefiles in build/ (with the pre-quoted organization)

    Thanks in advance

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      Stop using shadow building and it will work well:
      @

      .pro

      DESTDIR=bin

      BUILDDIR=build
      OBJECTS_DIR = $${BUILDDIR}
      MOC_DIR = $${BUILDDIR}
      RCC_DIR = $${BUILDDIR}
      UI_DIR = $${BUILDDIR}
      @

      Or use a more advanced example from one of my projects: "link":https://github.com/sierdzio/spdr/blob/master/definitions.pri.

      (Z(:^

      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