Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
probonopd opened this issue Dec 5, 2017 · 7 comments
Closed
Assignees

Comments

@probonopd
Copy link
Member

probonopd commented Dec 5, 2017

#include <gtest/gtest.h>

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.

@probonopd
Copy link
Member Author

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

@TheAssassin
Copy link
Member

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.

@probonopd
Copy link
Member Author

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.

@TheAssassin
Copy link
Member

@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.

@probonopd
Copy link
Member Author

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.

@TheAssassin
Copy link
Member

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.

@TheAssassin
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants