MB-12112: Streamline CMake files

With an improved ERL_BUILD_OTP macro less code is needed within
the individual CMakeLists.txt files.

Change-Id: I9b03b82194dc787715730d3adb2bc599af162d0a
Reviewed-on: http://review.couchbase.org/41147
Reviewed-by: Sarath Lakshman <sarath@couchbase.com>
Reviewed-by: Chris Hillery <ceej@couchbase.com>
Reviewed-by: Trond Norbye <trond.norbye@gmail.com>
Tested-by: Trond Norbye <trond.norbye@gmail.com>
MB-12112 Simplify unit test runner

The unit test runner `runtest.py` needed the source as well as the
build directory of couchdb. This didn't work well as ERL_LIBS picks
the first application it encounters without checking if there might
be one which contains missing files later in the path.

The build system was changes so that the build directory also includes
the header files, hence only the information about the build path is
needed.

The `source` parameter got renamed to `libsdirs` and now takes a
directory as input that will be added to the ERL_LIBS environment
variable. This enables geocouch to use the same test runner.

All the subdirectories from the supplied couchdb build directory are
now added to erl_flags. This way you don't need to supply as many
modules as previously.

Change-Id: I07d5c40071ea85342ef72d2e64acf9feda0fb25c
Reviewed-on: http://review.couchbase.org/41581
Reviewed-by: Sarath Lakshman <sarath@couchbase.com>
Reviewed-by: Volker Mische <volker.mische@gmail.com>
Tested-by: buildbot <build@couchbase.com>
Merge remote-tracking branch 'upstream/master'