> On Apr 7, 2018, at 11:12 PM, DaveC49 <davidcous...@bigpond.com> wrote:
> Hi,
> I am past the initial problem but I appear to be having a problem with GTEST
> not being found. I have gtest 1.8.0 intsalled  and I have also uninstalled
> it and reinstalled 1.7.0 from the ubuntu repository with the same result:
> $ cmake -D CMAKE_INSTALL_PREFIX=/usr/local/gnucash -D WITH_AQBANKING=OFF ../
> -- Using guile-2.0.x
> -- Using guile SRFI-64
> -- Checking for GTEST
> CMake Error at common/cmake_modules/GncAddTest.cmake:145 (MESSAGE):
>  GTEST not found.  Please install it or set GTEST_ROOT or GMOCK_ROOT
> Call Stack (most recent call first):
>  CMakeLists.txt:596 (GNC_GTEST_CONFIGURE)
> -- Configuring incomplete, errors occurred!
> See also
> "/home/david/Applications/gnucash-3.0/build-cmake/CMakeFiles/CMakeOutput.log".
> See also
> "/home/david/Applications/gnucash-3.0/build-cmake/CMakeFiles/CMakeError.log".
> I am using build-cmake under the gnucash-3.0 directory.  I have
> GTEST_ROOT="/usr/local" and GMOCK_ROOT="/usr/local".  The gtest and gmock
> files are installed as follows:
> /usr/local/include/gtest/gtest.h  and other gtest includes'
> /usr/local/include/gmock/gmock.h and other gmock includes
> /usr/local/lib/libgmock.a
> /usr/local/lib/libgmock_main.a
> /usr/local/lib/libgtest.a
> /usr/local/lib/libgtest_main.a
> I have also built and had the 
> /usr/local/lib/libgmock.so
> /usr/local/lib/libgmock_main.so
> /usr/local/lib/libgtest.so
> /usr/local/lib/libgtest_main.so
> files installed without any success.
> The  /usr/src contains these files which are from the distros v 1.7.0
> installation
> /usr/src/gmock
> /usr/src/gtest
> I opened GncAddTest.cmake which fails at line 145 and looked at the
> The FIND_PATH(GTEST_INCLUDE_DIR gtest/gtest.h  should  find gtest.h in
> /usr/local/include/gtest/gtest.h using the PATH ${GTEST_ROOT}/include =>
> FIND_PATH(GTEST_SRC_DIR src/gtest_all.cc  should find gtest_all.cc in 
> /usr/src/gtest/src/gtest-all.cc using the PATH using the PATH /usr/src/gtest
> even though these are the v1.7.0 files found. => GTEST_SRC_DIR is TRUE
> FIND_LIBRARY(GTEST_SHARED_LIB gtest)  I am not sure whether this will or
> will not find /usr/local/lib/libgtest.a
> and whether FIND_LIBRARY(GTEST_MAIN_LIB gtest_main) is finding
> /usr/local/lib/libgtest_main.a
> The Documentation for the CMake FIND_LIBRARY function indicates that the
> name supplied as the argument is what the function searches for. From what 
> can understand it will search paths specified in the 
> PATH and LIB environment variables.
> These are respectively:
> $ echo $PATH
> /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/usr/lib/jvm/java-8-oracle/bin:/usr/lib/jvm/java-8-oracle/db/bin:/usr/lib/jvm/java-8-oracle/jre/bin
> $ echo $LIB
> /usr/include:/usr/local/include
> but the same error still occurs.  My conclusion is that the
> GNC_GTEST_CONFIGURE should be searching for libgtest rather than gtest or
> perhaps for both if some installations name the library gtest rather than
> libgtest.
> If anyone has any insights or suggestions please let me know. My next step
> is to generate a test Cmake setup to experiment with the FIND_LIBRARY
> function and also test the other searches done. This may take me a while
> since I am still getting to grips with CMake. The Cmake output and error
> files are attached if anyone can make more sense of them than I can
> CMakeError.log
> <http://gnucash.1415818.n4.nabble.com/file/t375329/CMakeError.log>  
> CMakeOutput.log
> <http://gnucash.1415818.n4.nabble.com/file/t375329/CMakeOutput.log>   .

If you just want to get GnuCash built the quickest path is to clone 
https://github.com/google/googletest <https://github.com/google/googletest> and 
set GTEST_ROOT=/path/to/googletest/googletest and 

Now if you want to get things fixed up so that it builds with the shared 
libraries, you’ll need to apply https://github.com/Gnucash/gnucash/pull/329 
<https://github.com/Gnucash/gnucash/pull/329> or wait for us to merge it. That 
won’t work with googletest-1.7.0. 

$PATH is searched for libraries only on Windows, but $LIB *should* work on 
Ubuntu. Have you examined CMakeOutput.log and CMakeErrors.log for the actual 
errors, or CMakeCache.txt to see which GTEST variables are set and which are 

John Ralls
gnucash-devel mailing list

Reply via email to