add variant gmock to googletest (#5278)

This commit is contained in:
healther 2017-09-19 04:28:33 +02:00 committed by scheibelp
parent bb042f7bd7
commit df8e7d7590

View file

@ -34,11 +34,18 @@ class Googletest(CMakePackage):
version('1.7.0', '5eaf03ed925a47b37c8e1d559eb19bc4') version('1.7.0', '5eaf03ed925a47b37c8e1d559eb19bc4')
version('1.6.0', '90407321648ab25b067fcd798caf8c78') version('1.6.0', '90407321648ab25b067fcd798caf8c78')
variant('gmock', default=False, description='Build with gmock')
conflicts('+gmock', when='@:1.7.0')
def cmake_args(self): def cmake_args(self):
spec = self.spec spec = self.spec
if '@1.8.0:' in spec: if '@1.8.0:' in spec:
# New style (contains both Google Mock and Google Test) # New style (contains both Google Mock and Google Test)
options = ['-DBUILD_GMOCK=OFF', '-DBUILD_GTEST=ON'] options = ['-DBUILD_GTEST=ON']
if '+gmock' in spec:
options.append('-DBUILD_GMOCK=ON')
else:
options.append('-DBUILD_GMOCK=OFF')
else: else:
# Old style (contains only GTest) # Old style (contains only GTest)
options = [] options = []