Build info: Ensure hash length is same across all platforms and has no conflicts
[blender.git] / build_files / cmake / cmake_print_build_options.py
1 # Apache License, Version 2.0
2
3 # Simple utility that prints all WITH_* options in a CMakeLists.txt
4 # Called by 'make help_features'
5
6 import re
7 import sys
8
9 cmakelists_file = sys.argv[-1]
10
11 def main():
12     options = []
13     for l in open(cmakelists_file, 'r').readlines():
14         if not l.lstrip().startswith('#'):
15             l_option = re.sub(r'.*\boption\s*\(\s*(WITH_[a-zA-Z0-9_]+)\s+\"(.*)\"\s*.*', r'\g<1> - \g<2>', l)
16             if l_option != l:
17                 l_option = l_option.strip()
18                 if l_option.startswith('WITH_'):
19                     options.append(l_option)
20
21     print('\n'.join(options))
22
23
24 if __name__ == "__main__":
25     main()