forked from bartvdbraak/blender
Cleanup: move 'make help_features' into own file
This commit is contained in:
parent
ffe5b92325
commit
99e06af9c8
10
GNUmakefile
10
GNUmakefile
@ -474,15 +474,7 @@ doc_man: .FORCE
|
|||||||
$(PYTHON) doc/manpage/blender.1.py $(BLENDER_BIN) blender.1
|
$(PYTHON) doc/manpage/blender.1.py $(BLENDER_BIN) blender.1
|
||||||
|
|
||||||
help_features: .FORCE
|
help_features: .FORCE
|
||||||
@$(PYTHON) -c \
|
@$(PYTHON) "$(BLENDER_DIR)/build_files/cmake/cmake_print_build_options.py" $(BLENDER_DIR)"/CMakeLists.txt"
|
||||||
"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
|
|
||||||
|
|
||||||
|
|
||||||
clean: .FORCE
|
clean: .FORCE
|
||||||
$(MAKE) -C "$(BUILD_DIR)" clean
|
$(MAKE) -C "$(BUILD_DIR)" clean
|
||||||
|
25
build_files/cmake/cmake_print_build_options.py
Normal file
25
build_files/cmake/cmake_print_build_options.py
Normal file
@ -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()
|
Loading…
Reference in New Issue
Block a user