Appimagekit: build.sh: Could NOT find GTest (missing: GTEST_LIBRARY GTEST_MAIN_LIBRARY)

Created on 5 Dec 2017  路  7Comments  路  Source: AppImage/AppImageKit

https://github.com/AppImage/AppImageKit/blob/386f4e4250defdd0053bdd4542cf780c4b7cfdd6/libappimage/test/test_appimagelib.cpp#L13

build.sh on Ubuntu 14.04 fails with

+ mkdir -p libappimage/build
+ pushd libappimage/build
~/AppImageKit/libappimage/build ~/AppImageKit
+ cmake ..
CMake Error at /usr/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
  Could NOT find GTest (missing: GTEST_LIBRARY GTEST_MAIN_LIBRARY)
Call Stack (most recent call first):
  /usr/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
  /usr/share/cmake-3.10/Modules/FindGTest.cmake:196 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  test/CMakeLists.txt:2 (find_package)


-- Configuring incomplete, errors occurred!
See also "/home/me/AppImageKit/libappimage/build/CMakeFiles/CMakeOutput.log".
+ popd
~/AppImageKit
+ rm build/data.o build/1024_blank_bytes
rm: cannot remove 'build/1024_blank_bytes': No such file or directory

Please fix build.sh and/or install-build-deps.sh so that it compiles again on Ubuntu 14.04. Thanks.

bug high-priority

Most helpful comment

The following is working for me:

sudo apt-get install cmake libgtest-dev
cd /usr/src/gtest
sudo cmake CMakeLists.txt
sudo make

# copy or symlink libgtest.a and libgtest_main.a to your /usr/lib folder
sudo cp *.a /usr/lib

So this would need to be added to build.sh.

All 7 comments

sudo apt install libgtest-dev does _not_ seem to solve this.

I plan to pull in GTest as a dependency with ExternalProject_Add, too. Ubuntu's GTest distribution has a lot of issues. See https://www.eriksmistad.no/getting-started-with-google-test-on-ubuntu/ on how to initialize it properly, @probonopd, you apparently have to compile(!) something system wide after installing the dev packet because there's no binary package. That's pretty annoying.

If it's too complicated to get the tests going from build.sh it'd be ok (for me) to disable them when using build.sh and only run them for CMake based builds.

@probonopd as said before, going to change that very soon by using a custom GTest, so, since it works on Travis, I'd ask you to be patient, and wait for a day or two.

The following is working for me:

sudo apt-get install cmake libgtest-dev
cd /usr/src/gtest
sudo cmake CMakeLists.txt
sudo make

# copy or symlink libgtest.a and libgtest_main.a to your /usr/lib folder
sudo cp *.a /usr/lib

So this would need to be added to build.sh.

It's sudo-ish code, which shouldn't go into build.sh script, but rather install-build-deps.sh. But, as said before, it's really not worth the effort.

This has been resolved since #568 and its subsidiary PRs.

Was this page helpful?
0 / 5 - 0 ratings