I fixed bugs in the Steem codebase that prevented out-of-source builds from working.
You can find the pull request here.
It is much nicer to build in a separate directory so that it doesn't clutter up the source directory with a bunch of files. It becomes really easy to clean all the built files and start from scratch as well. Just delete the build directory and start over.
Even better, you can maintain two (or more) different build directories in order to build with different configuration options (e.g. one for witnesses with low memory node enabled, and one that is built as a full node for your own personal computer and/or a backend to a website like steemit.com or steemd.com).
I even created a small script to help me with this process. Assuming I have a folder ~/steem in which I cloned the steem repositry into (meaning the repository is actually in ~/steem/steem) and I have installed my scripts build_witness_release.sh and build_full_debug.sh into the ~/steem directory (with execute bit set), then I can build the witness node as follows:
~/steem$ mkdir -p witness-release && cd witness-release
~/steem/witness-release$ ../build_witness_release.sh && make
And I can build the full node (with Debug enabled) for my personal use as follows:
~/steem$ mkdir -p full-debug && cd full-debug
~/steem/full-debug$ ../build_full_debug.sh && make
The code for build_witness_release.sh and build_full_debug.sh are included below. You can modify them to get other build configuration combinations.
Source for build_witness_release.sh:
#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cmake -DCMAKE_BUILD_TYPE=Release -DLOW_MEMORY_NODE=ON -DENABLE_CONTENT_PATCHING=OFF "$DIR/steem" $@
Source for build_full_debug.sh:
#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cmake -DCMAKE_BUILD_TYPE=Debug -DLOW_MEMORY_NODE=OFF -DENABLE_CONTENT_PATCHING=ON "$DIR/steem" $@