Update: gnucash-3.1 has been released.
The bug related to the environment file has been fixed, sort of; gnucash will now look for the file where it got installed in /etc/opt/... So the fix above for copying the environment file is no longer needed.
Also it turns out that the googletest/gmock source tree does not need to be installed as I showed above - it just needs to be available when Gnucash is built. So the gnucash CMAKE command changes to something like this, assuming you unpacked and built googletest under the same parent directory, and the source is still there:
Code:
$ cmake -D CMAKE_INSTALL_PREFIX=/opt/gnucash \
-D ENABLE_BINRELOC=OFF \
-D WITH_SQL=OFF \
-D WITH_OFX=OFF \
-D WITH_AQBANKING=OFF \
-D DISABLE_NLS=ON \
-D GMOCK_ROOT=../../googletest-release-1.8.0/googlemock/src \
..
There are a number of bug fixes in gnucash-3.1 and you might seriously consider upgrading from 2.6.x to this version.