build_docs.py 1.7 KB

1234567891011121314151617181920212223242526272829303132
  1. #!/usr/bin/env python
  2. """
  3. This script builds OpenCV docs for macOS.
  4. """
  5. from __future__ import print_function
  6. import os, sys, multiprocessing, argparse, traceback
  7. from subprocess import check_call, check_output, CalledProcessError, Popen
  8. # import common code
  9. sys.path.insert(0, os.path.abspath(os.path.abspath(os.path.dirname(__file__))+'/../ios'))
  10. from build_docs import DocBuilder
  11. class OSXDocBuilder(DocBuilder):
  12. def getToolchain(self):
  13. return None
  14. if __name__ == "__main__":
  15. script_dir = os.path.abspath(os.path.dirname(sys.argv[0]))
  16. parser = argparse.ArgumentParser(description='The script builds OpenCV docs for macOS.')
  17. parser.add_argument('framework_dir', metavar='FRAMEWORK_DIR', help='folder where framework build files are located')
  18. parser.add_argument('--output_dir', default=None, help='folder where docs will be built (default is "../doc_build" relative to framework_dir)')
  19. parser.add_argument('--framework_header', default=None, help='umbrella header for OpenCV framework (default is "../../../lib/Release/{framework_name}.framework/Headers/{framework_name}.h")')
  20. parser.add_argument('--framework_name', default='opencv2', help='Name of OpenCV framework (default: opencv2, will change to OpenCV in future version)')
  21. args = parser.parse_args()
  22. arch = "x86_64"
  23. target = "macosx"
  24. b = OSXDocBuilder(script_dir, args.framework_dir, args.output_dir if args.output_dir else os.path.join(args.framework_dir, "../doc_build"), args.framework_header if args.framework_header else os.path.join(args.framework_dir, "../../../lib/Release/" + args.framework_name + ".framework/Headers/" + args.framework_name + ".h"), args.framework_name, arch, target)
  25. b.build()