diff --git a/var/spack/repos/builtin/packages/googletest/package.py b/var/spack/repos/builtin/packages/googletest/package.py index 48dfcabb2f..849621c456 100644 --- a/var/spack/repos/builtin/packages/googletest/package.py +++ b/var/spack/repos/builtin/packages/googletest/package.py @@ -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 = []