Unable to find GMock/GTest on distributions other than Ubuntu

Bug #1300200 reported by Benjamin Kircher on 2014-03-31
This bug affects 2 people
Affects Status Importance Assigned to Milestone
mir (Ubuntu)

Bug Description

CMake fails to find GMock/GTest on Fedora and Gentoo with

$ cmake -DCMAKE_BUILD_TYPE=Debug ..
CMake Error at cmake/FindGtest.cmake:13 (message):
  google-mock package not found
Call Stack (most recent call first):
  tests/CMakeLists.txt:20 (find_package)
-- Configuring incomplete, errors occurred!

within the call to

find_path(GMOCK_INSTALL_DIR gmock/CMakeLists.txt HINTS /usr/src)

in cmake/FindGtest.cmake line 10. I suspect, this is because gmock/CMakeLists.txt is not installed on those distributions along with the rest of the package.

Anyway, Google Test developers discourage the use of a pre-compiled library, see their FAQ [1]. This issue also affects
- https://launchpad.net/process-cpp
- https://launchpad.net/properties-cpp

Possible solution: I have an alternative find-script at hand that also uses ExternalProject_Add() but always downloads and extracts Google Mock in your build tree, automatically adds the Google Mock libraries as dependency of the test, and compiles the Google Mock libraries along with your project.

I'm willing to contribute this find-script to your project if you wish but I need to check with my employer's Open Source contribution policies before I do that.

[1] https://code.google.com/p/googletest/wiki/FAQ#Why_is_it_not_recommended_to_install_a_pre-compiled_copy_of_Goog

Changed in mir:
status: New → Triaged
tags: added: portability
Changed in mir:
importance: Undecided → Low
Michał Sawicz (saviq) wrote :

Syncing task from Mir.

Changed in mir (Ubuntu):
importance: Undecided → Low
status: New → Triaged
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers