forked from qt-creator/qt-creator
CMake build: Move documentation functions to re-usable location
Removes "install_..._docs" and "clean_docs" special targets. Instead install documentation with "--install . --component qch_docs" and "--install . --component html_docs" which have the advantage that the install prefix can be specified later on with --prefix. Also removes export of IDE_SOURCE_DIR, which is not used. Change-Id: I4fce0b9aa8c7fc40b7e94e065777ddf4c0b76c41 Reviewed-by: Cristian Adam <cristian.adam@qt.io>
This commit is contained in:
@@ -51,6 +51,8 @@ def get_arguments():
|
||||
parser.add_argument('--add-config', help=('Adds the argument to the CMake configuration call. '
|
||||
'Use "--add-config=-DSOMEVAR=SOMEVALUE" if the argument begins with a dash.'),
|
||||
action='append', dest='config_args', default=[])
|
||||
parser.add_argument('--with-docs', help='Build and install documentation.',
|
||||
action='store_true', default=False)
|
||||
parser.add_argument('--deploy', help='Installs the "Dependencies" component of the plugin.',
|
||||
action='store_true', default=False)
|
||||
parser.add_argument('--debug', help='Enable debug builds', action='store_true', default=False)
|
||||
@@ -79,6 +81,9 @@ def build(args, paths):
|
||||
# TODO this works around a CMake bug https://gitlab.kitware.com/cmake/cmake/issues/20119
|
||||
cmake_args += ['-DBUILD_WITH_PCH=OFF']
|
||||
|
||||
if args.with_docs:
|
||||
cmake_args += ['-DWITH_DOCS=ON']
|
||||
|
||||
ide_revision = common.get_commit_SHA(paths.src)
|
||||
if ide_revision:
|
||||
cmake_args += ['-DQTC_PLUGIN_REVISION=' + ide_revision]
|
||||
@@ -88,8 +93,17 @@ def build(args, paths):
|
||||
cmake_args += args.config_args
|
||||
common.check_print_call(cmake_args + [paths.src], paths.build)
|
||||
common.check_print_call(['cmake', '--build', '.'], paths.build)
|
||||
if args.with_docs:
|
||||
common.check_print_call(['cmake', '--build', '.', '--target', 'docs'], paths.build)
|
||||
common.check_print_call(['cmake', '--install', '.', '--prefix', paths.install, '--strip'],
|
||||
paths.build)
|
||||
if args.with_docs:
|
||||
common.check_print_call(['cmake', '--install', '.', '--prefix', paths.install,
|
||||
'--component', 'qch_docs'],
|
||||
paths.build)
|
||||
common.check_print_call(['cmake', '--install', '.', '--prefix', paths.install,
|
||||
'--component', 'html_docs'],
|
||||
paths.build)
|
||||
if args.deploy:
|
||||
common.check_print_call(['cmake', '--install', '.', '--prefix', paths.install,
|
||||
'--component', 'Dependencies'],
|
||||
|
Reference in New Issue
Block a user