build.h changes break qmake build #1076

issue laanwj opened this issue on April 11, 2012
  1. laanwj commented at 6:09 AM on April 11, 2012: member

    The recent changes to add a build.h break the build, when building with qmake and using a different build directory from source directory (Qt creator does this by default).

    To reproduce:

    $ mkdir bitcoin-qt-build-desktop
    $ cd bitcoin-qt-build-desktop
    $ qmake ../bitcoin
    $ make
    ...
    make: *** No rule to make target `../bitcoin/src/build.h', needed by `build/version.o'.  Stop.
    

    I've tried fixing it with the suggestions here, but was unsuccessful: http://stackoverflow.com/questions/5192714/how-to-refer-to-the-source-directory-in-qmake

    Ideally, the build process should leave the source directory untouched when building in this way. Other generated source files such as ui__.h, .mocs and .qms also end up in the build direcory, not the source dir. Because of this, _build_dir*/build directory is in the include path, for example. Maybe we could place build.h there?

  2. Diapolo commented at 9:23 AM on April 11, 2012: none

    I had to remove the new lines in the project file, to be able to compile on Windows in Qt Creator, so yes, this needs some more work.

  3. sipa commented at 11:48 AM on April 11, 2012: member

    I'm unable to make build/version.o depend on build/build.h, somehow qmake always turns it into ../build/build.h. What is possible, is adding this to PRE_TARGETDEPS, which makes sure it is rebuild right at the start of the build process. That should suffice, but there is a caveat: if your source directory contains a build.h as well, that one will be used. Perhaps we need a build/ directory as well in the non-Qt builds?

    EDIT: see my buildinfo branch

  4. laanwj closed this on Apr 11, 2012

  5. suprnurd referenced this in commit 66c40e0687 on Dec 5, 2017
  6. sanch0panza referenced this in commit 0e104ee578 on May 17, 2018
  7. lateminer referenced this in commit ab1b5b447a on Dec 25, 2019
  8. lateminer referenced this in commit decac23124 on Dec 25, 2019
  9. MarcoFalke locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-13 15:16 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me