Changes in GMock

Matěj Laitl matej at laitl.cz
Tue Oct 1 11:23:07 UTC 2013


On 1. 10. 2013 Konrad Zemek wrote:
> The way I see it, possible solutions are:
> 
> * go the way of Mir: find sources installed by Kubuntu's package in
>   "FindGmock.cmake" (in Mir it's FindGtest.cmake)
>   downsides: depends on how distro packages gmock; e.g. Arch has no
>   gmock package in official repos. Also, gmock version is out of our
>   control.

We may affect how distros package gmock. As gmock upstream clearly recommends 
installing the sources and then let each project build gmock from the 
installed sources, I think we should push distributions to do it that way.

So I'm +1 for requiring distros to install gmock sources and ideally providing 
a standardized way of finding them (for example pkgconfig). Initially, we can 
provide our own FindGmock.cmake with some heuristics ourselves.

This works well for the Eigen library (that is installed as sources), it ships 
/usr/share/pkgconfig/eigen3.pc:
Name: Eigen3
Description: A C++ template library for linear algebra: vectors, matrices, and 
related algorithms
Requires:
Version: 3.0.6
Libs:
Cflags: -I/usr/include/eigen3

There is no reason the same shouldn't work for gmock.

> * use CMake's ExternalProject_add. This is the method that I use in
>   my projects, additionally hidden behind FindGmock.cmake. Here we
>   control gmock version and at the same time not store its sources
>   in our repository.
>   downsides: sources have to be downloaded during "make" step.
>   Include directories are also not there before running cmake.

-1. Downloading stuff during build is a no-go for me, plus it is the least 
secure, you loose all the checksuming etc.

> * pull gmock's sources into our repository and add it through
>   add_directory(). This is by far the easiest option, and we still control
>   the version, and we have include files in place.
>   downsides: sources are in our repository.

+0 for this. Bundling is bad, but gmock is intended to be bundled/distributed 
as sources.

> As I mentioned, ExternalProject_add() abstracted behind
> FindGmock.cmake is the option that I personally use and prefer.
> It can also be used in conjunction with in-repo tar file to dodge
> downloading.

This is essentially bundling with some sugar so that it doesn't look horrible, 
-1 from me.

	Matěj


More information about the Amarok-devel mailing list