add variant htmlreport to package cppcheck (#7824)

Change-Id: I31766d3ceb4fa8852b9bdc82444e36514e760f4b
This commit is contained in:
healther 2018-04-21 17:26:37 +02:00 committed by Adam J. Stewart
parent 5794f432a9
commit 8cc24fa20b

View File

@ -37,6 +37,10 @@ class Cppcheck(Package):
version('1.72', '2bd36f91ae0191ef5273bb7f6dc0d72e')
version('1.68', 'c015195f5d61a542f350269030150708')
variant('htmlreport', default=False, description="Install cppcheck-htmlreport")
depends_on('py-pygments', when='+htmlreport', type='run')
def install(self, spec, prefix):
# cppcheck does not have a configure script
make("CFGDIR=%s" % os.path.join(prefix, 'cfg'))
@ -44,3 +48,5 @@ def install(self, spec, prefix):
mkdirp(prefix.bin)
install('cppcheck', prefix.bin)
shutil.copytree('cfg', os.path.join(prefix, 'cfg'))
if spec.satisfies('+htmlreport'):
install('htmlreport/cppcheck-htmlreport', prefix.bin)