Re: [googletest] gtest deployment

54 views
Skip to first unread message

Zhanyong Wan (λx.x x)

unread,
Nov 5, 2012, 12:11:20 PM11/5/12
to Ford, googletes...@googlegroups.com
On Mon, Nov 5, 2012 at 8:09 AM, Ford <fsle...@gmail.com> wrote:
> Is there a preferred way to deploy gtest with a project? I understand "make
> install" is disabled because of potential compiler flag issues but I don't
> know the best way to provide gtest with a software package.

I recommend including a copy of gtest with your project and adding
build scripts needed by the build system you choose. LLVM/Clang and
protobuf follow this model.

gtest officially supports cmake. If you use cmake for your build
system, you might be able to reuse gtest's own build scripts.

> I am using
> autotools so I guess I could some how pass the CXXFLAGS from the main
> project configure to the gtest configure. Would it be better for them to
> manually configure gtest (but potentially use different flags)? Many
> projects I have seen let you run "./configure; make; make check; make
> install;" without having to deal with manually building the test suite.

gtest orginally used autotools but we decided to deprecate that as it
was a lot of pain to maintain. Have you considered switching away
from autotools?

--
Zhanyong

Ford

unread,
Nov 5, 2012, 12:34:40 PM11/5/12
to googletes...@googlegroups.com
Thanks for the suggestion, I took a look at the protobuf configure system and I understand how they solved this problem. I work for an academic research group and most of the faculty are not very familiar with modern build systems. There were some growing pains transitioning from old style Makefiles to autotools so switching again to cmake will probably be an unnecessary headache. That being said, I should probably at least consider cmake for future projects to see if it would be better than autotools. Is there a reason Google has moved from the more commonly used autotools to cmake?


On Monday, November 5, 2012 11:09:47 AM UTC-5, Ford wrote:
Is there a preferred way to deploy gtest with a project? I understand "make install" is disabled because of potential compiler flag issues but I don't know the best way to provide gtest with a software package. I am using autotools so I guess I could some how pass the CXXFLAGS from the main project configure to the gtest configure. Would it be better for them to manually configure gtest (but potentially use different flags)? Many projects I have seen let you run "./configure; make; make check; make install;" without having to deal with manually building the test suite.

Zhanyong Wan (λx.x x)

unread,
Nov 5, 2012, 12:54:00 PM11/5/12
to Ford, googletes...@googlegroups.com
On Mon, Nov 5, 2012 at 9:34 AM, Ford <fsle...@gmail.com> wrote:
> Thanks for the suggestion, I took a look at the protobuf configure system
> and I understand how they solved this problem. I work for an academic
> research group and most of the faculty are not very familiar with modern
> build systems. There were some growing pains transitioning from old style
> Makefiles to autotools

I can totally understand that. :)

> so switching again to cmake will probably be an
> unnecessary headache.

This I'm not sure of. I was a novice of cmake and was able to teach
myself enough cmake to convert gtest to it from autotools in basically
one weekend. It's much, much easier than autotools.

> That being said, I should probably at least consider
> cmake for future projects to see if it would be better than autotools. Is
> there a reason Google has moved from the more commonly used autotools to
> cmake?

gtest's autotools scripts were a lot of pain to maintain. I felt that
we were fighting with it all the time and when there was a problem,
very few people could understand why and how to fix it.

>
>
> On Monday, November 5, 2012 11:09:47 AM UTC-5, Ford wrote:
>>
>> Is there a preferred way to deploy gtest with a project? I understand
>> "make install" is disabled because of potential compiler flag issues but I
>> don't know the best way to provide gtest with a software package. I am using
>> autotools so I guess I could some how pass the CXXFLAGS from the main
>> project configure to the gtest configure. Would it be better for them to
>> manually configure gtest (but potentially use different flags)? Many
>> projects I have seen let you run "./configure; make; make check; make
>> install;" without having to deal with manually building the test suite.



--
Zhanyong
Reply all
Reply to author
Forward
0 new messages