diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-09-13 09:21:56 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-09-13 09:21:56 +0300 |
commit | 0a23d39b9f66731f123387324bf1402ffdc4d2c0 (patch) | |
tree | 9349e68d54b4c3e1ec8159d9796bd422f7d2fd4a | |
parent | a4e4dc1b752145229e08c2a314c9d911861e8968 (diff) | |
parent | 99e06af9c8c2d2c92570796f76baefd405a3b67a (diff) |
Merge branch 'master' into blender2.8
-rw-r--r-- | GNUmakefile | 10 | ||||
-rw-r--r-- | build_files/cmake/cmake_print_build_options.py | 25 |
2 files changed, 26 insertions, 9 deletions
diff --git a/GNUmakefile b/GNUmakefile index f43da278f7e..c0ed52d6035 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -481,15 +481,7 @@ doc_man: .FORCE $(PYTHON) doc/manpage/blender.1.py $(BLENDER_BIN) blender.1 help_features: .FORCE - @$(PYTHON) -c \ - "import re; \ - print('\n'.join([ \ - w for l in open('"$(BLENDER_DIR)"/CMakeLists.txt', 'r').readlines() \ - if not l.lstrip().startswith('#') \ - for w in (re.sub(\ - r'.*\boption\s*\(\s*(WITH_[a-zA-Z0-9_]+)\s+(\".*\")\s*.*', r'\g<1> - \g<2>', l).strip('() \n'),) \ - if w.startswith('WITH_')]))" | uniq - + @$(PYTHON) "$(BLENDER_DIR)/build_files/cmake/cmake_print_build_options.py" $(BLENDER_DIR)"/CMakeLists.txt" clean: .FORCE $(MAKE) -C "$(BUILD_DIR)" clean diff --git a/build_files/cmake/cmake_print_build_options.py b/build_files/cmake/cmake_print_build_options.py new file mode 100644 index 00000000000..fb7a5b33bf0 --- /dev/null +++ b/build_files/cmake/cmake_print_build_options.py @@ -0,0 +1,25 @@ +# Apache License, Version 2.0 + +# Simple utility that prints all WITH_* options in a CMakeLists.txt +# Called by 'make help_features' + +import re +import sys + +cmakelists_file = sys.argv[-1] + +def main(): + options = [] + for l in open(cmakelists_file, 'r').readlines(): + if not l.lstrip().startswith('#'): + l_option = re.sub(r'.*\boption\s*\(\s*(WITH_[a-zA-Z0-9_]+)\s+\"(.*)\"\s*.*', r'\g<1> - \g<2>', l) + if l_option != l: + l_option = l_option.strip() + if l_option.startswith('WITH_'): + options.append(l_option) + + print('\n'.join(options)) + + +if __name__ == "__main__": + main() |