diff --git a/var/spack/repos/builtin/packages/jsoncpp/package.py b/var/spack/repos/builtin/packages/jsoncpp/package.py index 4f53c4dfbf..06945692c5 100644 --- a/var/spack/repos/builtin/packages/jsoncpp/package.py +++ b/var/spack/repos/builtin/packages/jsoncpp/package.py @@ -26,4 +26,9 @@ class Jsoncpp(CMakePackage): depends_on('python', type='test') def cmake_args(self): - return ['-DBUILD_SHARED_LIBS=ON'] + args = ['-DBUILD_SHARED_LIBS=ON'] + if self.run_tests: + args.append('-DJSONCPP_WITH_TESTS=ON') + else: + args.append('-DJSONCPP_WITH_TESTS=OFF') + return args