There is a very nice JSON file generated called modules.json
, in the top-level build directory of VTK. It gives a lot of information about modules selected and their dependencies etc., here is a little Python script I put together in about 5 minutes to display this information:
#!/usr/bin/env python
import json
def get_program_parameters():
import argparse
description = 'Parse the VTK JSON file.'
epilogue = '''
'''
parser = argparse.ArgumentParser(description=description, epilog=epilogue,
formatter_class=argparse.RawTextHelpFormatter)
parser.add_argument('file_name', help='The path to the VTK JSON file, modules.json.')
args = parser.parse_args()
return args.file_name
def disp_dependencies(data):
# This is just a dictionary e.g
for k, v in data['modules'].items():
print(k)
if v['depends']:
print(' Dependencies :', ' '.join(v['depends']))
if v['optional_depends']:
print(' Optional dependencies:', ' '.join(v['optional_depends']))
if v['private_depends']:
print(' Private dependencies :', ' '.join(v['private_depends']))
def main():
fn = get_program_parameters()
with open(fn) as data_file:
json_data = json.load(data_file)
disp_dependencies(json_data)
if __name__ == '__main__':
main()
@ben.boeckel thanks for providing modules.json
, it is really useful.
@lorensen You may find this script useful.