add variant gmock to googletest (#5278)
This commit is contained in:
parent
bb042f7bd7
commit
df8e7d7590
1 changed files with 8 additions and 1 deletions
|
@ -34,11 +34,18 @@ class Googletest(CMakePackage):
|
|||
version('1.7.0', '5eaf03ed925a47b37c8e1d559eb19bc4')
|
||||
version('1.6.0', '90407321648ab25b067fcd798caf8c78')
|
||||
|
||||
variant('gmock', default=False, description='Build with gmock')
|
||||
conflicts('+gmock', when='@:1.7.0')
|
||||
|
||||
def cmake_args(self):
|
||||
spec = self.spec
|
||||
if '@1.8.0:' in spec:
|
||||
# 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:
|
||||
# Old style (contains only GTest)
|
||||
options = []
|
||||
|
|
Loading…
Reference in a new issue