Esempio n. 1
0
def deploy_qt(args, paths):
    if common.is_mac_platform():
        script = os.path.join(paths.src, 'scripts', 'deployqtHelper_mac.sh')
        app = os.path.join(paths.install, args.app_target)
        # TODO this is wrong if Qt is set up non-standard
        # TODO integrate deployqtHelper_mac.sh into deployqt.py, finally
        qt_bins = os.path.join(paths.qt, 'bin')
        qt_translations = os.path.join(paths.qt, 'translations')
        qt_plugins = os.path.join(paths.qt, 'plugins')
        qt_imports = os.path.join(paths.qt, 'imports')
        qt_qml = os.path.join(paths.qt, 'qml')
        env = dict(os.environ)
        if paths.llvm:
            env['LLVM_INSTALL_DIR'] = paths.llvm
        common.check_print_call([
            script, app, qt_bins, qt_translations, qt_plugins, qt_imports,
            qt_qml
        ],
                                paths.build,
                                env=env)
    else:
        cmd_args = [
            'python', '-u',
            os.path.join(paths.src, 'scripts', 'deployqt.py'), '-i'
        ]
        if paths.elfutils:
            cmd_args.extend(['--elfutils-path', paths.elfutils])
        if paths.llvm:
            cmd_args.extend(['--llvm-path', paths.llvm])
        exe = os.path.join(paths.install, 'bin', args.app_target)
        common.check_print_call(
            cmd_args + [exe, os.path.join(paths.qt, 'bin', 'qmake')],
            paths.build)
Esempio n. 2
0
def package(args, paths):
    if not os.path.exists(paths.result):
        os.makedirs(paths.result)
    common.check_print_call(['7z', 'a', '-mmt2', os.path.join(paths.result, args.name + '.7z'), '*'],
                            paths.install)
    if os.path.exists(paths.dev_install):  # some plugins might not provide anything in Devel
        common.check_print_call(['7z', 'a', '-mmt2',
                                 os.path.join(paths.result, args.name + '_dev.7z'), '*'],
                                paths.dev_install)
Esempio n. 3
0
def deploy_mac(args):
    (_, qt_install) = get_qt_install_info(args.qmake_binary)

    env = dict(os.environ)
    if args.llvm_path:
        env['LLVM_INSTALL_DIR'] = args.llvm_path

    script_path = os.path.dirname(os.path.realpath(__file__))
    deployqtHelper_mac = os.path.join(script_path, 'deployqtHelper_mac.sh')
    common.check_print_call([deployqtHelper_mac, args.qtcreator_binary, qt_install.bin,
                             qt_install.translations, qt_install.plugins, qt_install.qml],
                            env=env)
Esempio n. 4
0
def build(args, paths):
    if not os.path.exists(paths.build):
        os.makedirs(paths.build)
    if not os.path.exists(paths.result):
        os.makedirs(paths.result)
    prefix_paths = [paths.qt, paths.qt_creator
                    ] + [os.path.abspath(fp) for fp in args.prefix_paths]
    build_type = 'Debug' if args.debug else 'Release'
    cmake_args = [
        'cmake', '-DCMAKE_PREFIX_PATH=' + ';'.join(prefix_paths),
        '-DCMAKE_BUILD_TYPE=' + build_type,
        '-DCMAKE_INSTALL_PREFIX=' + paths.install, '-G', 'Ninja'
    ]

    # force MSVC on Windows, because it looks for GCC in the PATH first,
    # even if MSVC is first mentioned in the PATH...
    # TODO would be nicer if we only did this if cl.exe is indeed first in the PATH
    if common.is_windows_platform():
        cmake_args += ['-DCMAKE_C_COMPILER=cl', '-DCMAKE_CXX_COMPILER=cl']

    # TODO this works around a CMake bug https://gitlab.kitware.com/cmake/cmake/issues/20119
    cmake_args += ['-DBUILD_WITH_PCH=OFF']

    ide_revision = common.get_commit_SHA(paths.src)
    if ide_revision:
        cmake_args += ['-DQTC_PLUGIN_REVISION=' + ide_revision]
        with open(os.path.join(paths.result, args.name + '.7z.git_sha'),
                  'w') as f:
            f.write(ide_revision)

    cmake_args += args.config_args
    common.check_print_call(cmake_args + [paths.src], paths.build)
    common.check_print_call(['cmake', '--build', '.'], paths.build)
    common.check_print_call(
        ['cmake', '--install', '.', '--prefix', paths.install, '--strip'],
        paths.build)
    if args.deploy:
        common.check_print_call([
            'cmake', '--install', '.', '--prefix', paths.install,
            '--component', 'Dependencies'
        ], paths.build)
    common.check_print_call([
        'cmake', '--install', '.', '--prefix', paths.dev_install,
        '--component', 'Devel'
    ], paths.build)
Esempio n. 5
0
def deploy_qt(args, paths):
    if common.is_mac_platform():
        script = os.path.join(paths.src, 'scripts', 'deployqtHelper_mac.sh')
        app = os.path.join(paths.install, args.app_target)
        # TODO this is wrong if Qt is set up non-standard
        # TODO integrate deployqtHelper_mac.sh into deployqt.py, finally
        qt_bins = os.path.join(paths.qt, 'bin')
        qt_translations = os.path.join(paths.qt, 'translations')
        qt_plugins = os.path.join(paths.qt, 'plugins')
        qt_imports = os.path.join(paths.qt, 'imports')
        qt_qml = os.path.join(paths.qt, 'qml')
        common.check_print_call([
            script, app, qt_bins, qt_translations, qt_plugins, qt_imports,
            qt_qml
        ], paths.build)
    else:
        exe = os.path.join(paths.install, 'bin', args.app_target)
        common.check_print_call([
            'python', '-u',
            os.path.join(paths.src, 'scripts', 'deployqt.py'), '-i', exe,
            os.path.join(paths.qt, 'bin', 'qmake')
        ], paths.build)
Esempio n. 6
0
def build_qtcreatorcdbext(args, paths):
    if args.no_cdb:
        return
    # assumes existing Qt Creator build
    cmake_args = ['-DBUILD_EXECUTABLE_WIN32INTERRUPT=OFF',
                  '-DBUILD_EXECUTABLE_WIN64INTERRUPT=OFF',
                  '-DBUILD_LIBRARY_QTCREATORCDBEXT=ON']
    common.check_print_call(['cmake'] + cmake_args + [paths.src], paths.build)
    common.check_print_call(['cmake', '--build', '.'], paths.build)
    common.check_print_call(['cmake', '--install', '.', '--prefix', paths.qtcreatorcdbext_install,
                             '--component', 'qtcreatorcdbext'],
                            paths.build)
Esempio n. 7
0
def build_wininterrupt(args, paths):
    if not common.is_windows_platform():
        return
    # assumes existing Qt Creator build
    cmake_args = ['-DBUILD_EXECUTABLE_WIN32INTERRUPT=ON',
                  '-DBUILD_EXECUTABLE_WIN64INTERRUPT=ON',
                  '-DBUILD_LIBRARY_QTCREATORCDBEXT=OFF']
    common.check_print_call(['cmake'] + cmake_args + [paths.src], paths.build)
    common.check_print_call(['cmake', '--build', '.'], paths.build)
    common.check_print_call(['cmake', '--install', '.', '--prefix', paths.wininterrupt_install,
                             '--component', 'wininterrupt'],
                            paths.build)
Esempio n. 8
0
def build_qtcreatorcdbext(args, paths):
    if args.no_cdb:
        return
    if not os.path.exists(paths.qtcreatorcdbext_build):
        os.makedirs(paths.qtcreatorcdbext_build)
    prefix_paths = [common.to_posix_path(os.path.abspath(fp)) for fp in args.prefix_paths]
    cmake_args = ['-DCMAKE_PREFIX_PATH=' + ';'.join(prefix_paths),
                  '-DCMAKE_INSTALL_PREFIX=' + common.to_posix_path(paths.qtcreatorcdbext_install)]
    cmake_args += common_cmake_arguments(args)
    common.check_print_call(['cmake'] + cmake_args + [os.path.join(paths.src, 'src', 'libs', 'qtcreatorcdbext')],
                            paths.qtcreatorcdbext_build)
    common.check_print_call(['cmake', '--build', '.'], paths.qtcreatorcdbext_build)
    common.check_print_call(['cmake', '--install', '.', '--prefix', paths.qtcreatorcdbext_install,
                             '--component', 'qtcreatorcdbext'],
                            paths.qtcreatorcdbext_build)
Esempio n. 9
0
def build_wininterrupt(args, paths):
    if not common.is_windows_platform():
        return
    if not os.path.exists(paths.wininterrupt_build):
        os.makedirs(paths.wininterrupt_build)
    prefix_paths = [common.to_posix_path(os.path.abspath(fp)) for fp in args.prefix_paths]
    cmake_args = ['-DCMAKE_PREFIX_PATH=' + ';'.join(prefix_paths),
                  '-DCMAKE_INSTALL_PREFIX=' + common.to_posix_path(paths.wininterrupt_install)]
    cmake_args += common_cmake_arguments(args)
    common.check_print_call(['cmake'] + cmake_args + [os.path.join(paths.src, 'src', 'tools', 'wininterrupt')],
                            paths.wininterrupt_build)
    common.check_print_call(['cmake', '--build', '.'], paths.wininterrupt_build)
    common.check_print_call(['cmake', '--install', '.', '--prefix', paths.wininterrupt_install,
                             '--component', 'wininterrupt'],
                            paths.wininterrupt_build)
Esempio n. 10
0
def package(args, paths):
    if not os.path.exists(paths.result):
        os.makedirs(paths.result)
    common.check_print_call([
        '7z', 'a', '-mmt2',
        os.path.join(paths.result, args.name + '.7z'), '*'
    ], paths.install)
    if os.path.exists(paths.dev_install
                      ):  # some plugins might not provide anything in Devel
        common.check_print_call([
            '7z', 'a', '-mmt2',
            os.path.join(paths.result, args.name + '_dev.7z'), '*'
        ], paths.dev_install)
    # check for existence - the DebugInfo install target doesn't work for telemetry plugin
    if args.with_debug_info and os.path.exists(paths.debug_install):
        common.check_print_call([
            '7z', 'a', '-mmt2',
            os.path.join(paths.result, args.name + '-debug.7z'), '*'
        ], paths.debug_install)
Esempio n. 11
0
def build_qtcreator(args, paths):
    if not os.path.exists(paths.build):
        os.makedirs(paths.build)
    prefix_paths = [paths.qt]
    if args.llvm_path:
        prefix_paths += [args.llvm_path]
    if args.elfutils_path:
        prefix_paths += [args.elfutils_path]
    build_type = 'Debug' if args.debug else 'Release'
    with_docs_str = 'OFF' if args.no_docs else 'ON'
    cmake_args = [
        'cmake', '-DCMAKE_PREFIX_PATH=' + ';'.join(prefix_paths),
        '-DCMAKE_BUILD_TYPE=' + build_type, '-DWITH_DOCS=' + with_docs_str,
        '-DBUILD_DEVELOPER_DOCS=' + with_docs_str,
        '-DBUILD_EXECUTABLE_SDKTOOL=OFF',
        '-DCMAKE_INSTALL_PREFIX=' + paths.install, '-DWITH_TESTS=OFF', '-G',
        'Ninja'
    ]

    if args.python3:
        cmake_args += ['-DPYTHON_EXECUTABLE=' + args.python3]

    # force MSVC on Windows, because it looks for GCC in the PATH first,
    # even if MSVC is first mentioned in the PATH...
    # TODO would be nicer if we only did this if cl.exe is indeed first in the PATH
    if common.is_windows_platform():
        cmake_args += [
            '-DCMAKE_C_COMPILER=cl', '-DCMAKE_CXX_COMPILER=cl',
            '-DBUILD_EXECUTABLE_WIN32INTERRUPT=OFF',
            '-DBUILD_EXECUTABLE_WIN64INTERRUPT=OFF',
            '-DBUILD_LIBRARY_QTCREATORCDBEXT=OFF'
        ]
        if args.python_path:
            python_library = glob.glob(
                os.path.join(args.python_path, 'libs', 'python??.lib'))
            if python_library:
                cmake_args += [
                    '-DPYTHON_LIBRARY=' + python_library[0],
                    '-DPYTHON_INCLUDE_DIR=' +
                    os.path.join(args.python_path, 'include')
                ]

    # TODO this works around a CMake bug https://gitlab.kitware.com/cmake/cmake/issues/20119
    if common.is_linux_platform():
        cmake_args += ['-DBUILD_WITH_PCH=OFF']

    ide_revision = common.get_commit_SHA(paths.src)
    if ide_revision:
        cmake_args += [
            '-DIDE_REVISION=ON', '-DIDE_REVISION_STR=' + ide_revision,
            '-DIDE_REVISION_URL_STR=https://code.qt.io/cgit/qt-creator/qt-creator.git/log/?id='
            + ide_revision
        ]

    common.check_print_call(cmake_args + [paths.src], paths.build)
    common.check_print_call(['cmake', '--build', '.'], paths.build)
    if not args.no_docs:
        common.check_print_call(['cmake', '--build', '.', '--target', 'docs'],
                                paths.build)

    common.check_print_call(
        ['cmake', '--install', '.', '--prefix', paths.install, '--strip'],
        paths.build)
    common.check_print_call([
        'cmake', '--install', '.', '--prefix', paths.dev_install,
        '--component', 'Devel'
    ], paths.build)
Esempio n. 12
0
def package_qtcreator(args, paths):
    if not args.no_zip:
        if not args.no_qtcreator:
            common.check_print_call([
                '7z', 'a', '-mmt' + args.zip_threads,
                os.path.join(paths.result,
                             'qtcreator' + args.zip_infix + '.7z'),
                zipPatternForApp(paths)
            ], paths.install)
            common.check_print_call([
                '7z', 'a', '-mmt' + args.zip_threads,
                os.path.join(paths.result,
                             'qtcreator' + args.zip_infix + '_dev.7z'), '*'
            ], paths.dev_install)
            if args.with_debug_info:
                common.check_print_call([
                    '7z', 'a', '-mmt' + args.zip_threads,
                    os.path.join(paths.result, 'qtcreator' + args.zip_infix +
                                 '-debug.7z'), '*'
                ], paths.debug_install)
        if common.is_windows_platform():
            common.check_print_call([
                '7z', 'a', '-mmt' + args.zip_threads,
                os.path.join(paths.result,
                             'wininterrupt' + args.zip_infix + '.7z'), '*'
            ], paths.wininterrupt_install)
            if not args.no_cdb:
                common.check_print_call([
                    '7z', 'a', '-mmt' + args.zip_threads,
                    os.path.join(paths.result, 'qtcreatorcdbext' +
                                 args.zip_infix + '.7z'), '*'
                ], paths.qtcreatorcdbext_install)

    if common.is_mac_platform() and not args.no_qtcreator:
        if args.keychain_unlock_script:
            common.check_print_call([args.keychain_unlock_script],
                                    paths.install)
        if os.environ.get('SIGNING_IDENTITY'):
            signed_install_path = paths.install + '-signed'
            common.copytree(paths.install, signed_install_path, symlinks=True)
            apps = [
                d for d in os.listdir(signed_install_path)
                if d.endswith('.app')
            ]
            if apps:
                app = apps[0]
                common.codesign(os.path.join(signed_install_path, app))
                if not args.no_zip:
                    common.check_print_call([
                        '7z', 'a', '-mmt' + args.zip_threads,
                        os.path.join(
                            paths.result,
                            'qtcreator' + args.zip_infix + '-signed.7z'), app
                    ], signed_install_path)
        if not args.no_dmg:
            common.check_print_call([
                'python', '-u',
                os.path.join(paths.src, 'scripts', 'makedmg.py'),
                'qt-creator' + args.zip_infix + '.dmg', 'Qt Creator',
                paths.src, paths.install
            ], paths.result)
Esempio n. 13
0
def build_qtcreator(args, paths):
    if not os.path.exists(paths.build):
        os.makedirs(paths.build)
    prefix_paths = [os.path.abspath(fp)
                    for fp in args.prefix_paths] + [paths.qt]
    if paths.llvm:
        prefix_paths += [paths.llvm]
    if paths.elfutils:
        prefix_paths += [paths.elfutils]
    prefix_paths = [common.to_posix_path(fp) for fp in prefix_paths]
    with_docs_str = 'OFF' if args.no_docs else 'ON'
    build_date_option = 'OFF' if args.no_build_date else 'ON'
    test_option = 'ON' if args.with_tests else 'OFF'
    cmake_args = [
        'cmake', '-DCMAKE_PREFIX_PATH=' + ';'.join(prefix_paths),
        '-DCMAKE_BUILD_TYPE=' + args.build_type,
        '-DSHOW_BUILD_DATE=' + build_date_option,
        '-DWITH_DOCS=' + with_docs_str,
        '-DBUILD_DEVELOPER_DOCS=' + with_docs_str,
        '-DBUILD_EXECUTABLE_SDKTOOL=OFF',
        '-DCMAKE_INSTALL_PREFIX=' + common.to_posix_path(paths.install),
        '-DWITH_TESTS=' + test_option, '-G', 'Ninja'
    ]

    if args.python3:
        cmake_args += ['-DPYTHON_EXECUTABLE=' + args.python3]

    if args.module_paths:
        module_paths = [
            common.to_posix_path(os.path.abspath(fp))
            for fp in args.module_paths
        ]
        cmake_args += ['-DCMAKE_MODULE_PATH=' + ';'.join(module_paths)]

    # force MSVC on Windows, because it looks for GCC in the PATH first,
    # even if MSVC is first mentioned in the PATH...
    # TODO would be nicer if we only did this if cl.exe is indeed first in the PATH
    if common.is_windows_platform():
        if not os.environ.get('CC') and not os.environ.get('CXX'):
            cmake_args += ['-DCMAKE_C_COMPILER=cl', '-DCMAKE_CXX_COMPILER=cl']
        cmake_args += [
            '-DBUILD_EXECUTABLE_WIN32INTERRUPT=OFF',
            '-DBUILD_EXECUTABLE_WIN64INTERRUPT=OFF',
            '-DBUILD_LIBRARY_QTCREATORCDBEXT=OFF'
        ]
        if args.python_path:
            python_library = glob.glob(
                os.path.join(args.python_path, 'libs', 'python??.lib'))
            if python_library:
                cmake_args += [
                    '-DPYTHON_LIBRARY=' + python_library[0],
                    '-DPYTHON_INCLUDE_DIR=' +
                    os.path.join(args.python_path, 'include')
                ]

    # TODO this works around a CMake bug https://gitlab.kitware.com/cmake/cmake/issues/20119
    cmake_args += ['-DBUILD_WITH_PCH=OFF']

    ide_revision = common.get_commit_SHA(paths.src)
    if ide_revision:
        cmake_args += [
            '-DIDE_REVISION=ON', '-DIDE_REVISION_STR=' + ide_revision,
            '-DIDE_REVISION_URL=https://code.qt.io/cgit/qt-creator/qt-creator.git/log/?id='
            + ide_revision
        ]

    cmake_args += args.config_args

    common.check_print_call(cmake_args + [paths.src], paths.build)
    build_args = ['cmake', '--build', '.']
    if args.make_args:
        build_args += ['--'] + args.make_args
    common.check_print_call(build_args, paths.build)
    if not args.no_docs:
        common.check_print_call(['cmake', '--build', '.', '--target', 'docs'],
                                paths.build)

    common.check_print_call(
        ['cmake', '--install', '.', '--prefix', paths.install, '--strip'],
        paths.build)
    common.check_print_call([
        'cmake', '--install', '.', '--prefix', paths.install, '--component',
        'Dependencies'
    ], paths.build)
    common.check_print_call([
        'cmake', '--install', '.', '--prefix', paths.dev_install,
        '--component', 'Devel'
    ], paths.build)
    if args.with_debug_info:
        common.check_print_call([
            'cmake', '--install', '.', '--prefix', paths.debug_install,
            '--component', 'DebugInfo'
        ], paths.build)
    if not args.no_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)
Esempio n. 14
0
def build(args, paths):
    if not os.path.exists(paths.build):
        os.makedirs(paths.build)
    if not os.path.exists(paths.result):
        os.makedirs(paths.result)
    prefix_paths = [os.path.abspath(fp) for fp in args.prefix_paths] + [paths.qt_creator, paths.qt]
    if common.is_mac_platform():
        # --qtc-path may be
        # "/path/Qt Creator.app/Contents/Resources",
        # "/path/Qt Creator.app", or
        # "/path",
        # so add some variants to the prefix path
        prefix_paths += [os.path.join(paths.qt_creator, 'Contents', 'Resources'),
                         os.path.join(paths.qt_creator, 'Qt Creator.app', 'Contents', 'Resources')]
    prefix_paths = [common.to_posix_path(fp) for fp in prefix_paths]
    separate_debug_info_option = 'ON' if args.with_debug_info else 'OFF'
    cmake_args = ['cmake',
                  '-DCMAKE_PREFIX_PATH=' + ';'.join(prefix_paths),
                  '-DCMAKE_BUILD_TYPE=' + args.build_type,
                  '-DQTC_SEPARATE_DEBUG_INFO=' + separate_debug_info_option,
                  '-DCMAKE_INSTALL_PREFIX=' + common.to_posix_path(paths.install),
                  '-G', 'Ninja']

    # force MSVC on Windows, because it looks for GCC in the PATH first,
    # even if MSVC is first mentioned in the PATH...
    # TODO would be nicer if we only did this if cl.exe is indeed first in the PATH
    if common.is_windows_platform():
        cmake_args += ['-DCMAKE_C_COMPILER=cl',
                       '-DCMAKE_CXX_COMPILER=cl']

    # 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]
        with open(os.path.join(paths.result, args.name + '.7z.git_sha'), 'w') as f:
            f.write(ide_revision)

    cmake_args += args.config_args
    common.check_print_call(cmake_args + [paths.src], paths.build)
    build_args = ['cmake', '--build', '.']
    if args.make_args:
        build_args += ['--'] + args.make_args
    common.check_print_call(build_args, 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'],
                                paths.build)
    common.check_print_call(['cmake', '--install', '.', '--prefix', paths.dev_install,
                             '--component', 'Devel'],
                            paths.build)
    if args.with_debug_info:
        common.check_print_call(['cmake', '--install', '.', '--prefix', paths.debug_install,
                                 '--component', 'DebugInfo'],
                                 paths.build)
Esempio n. 15
0
def build_qtcreator(args, paths):
    if args.no_qtcreator:
        return
    if not os.path.exists(paths.build):
        os.makedirs(paths.build)
    prefix_paths = [os.path.abspath(fp)
                    for fp in args.prefix_paths] + [paths.qt]
    if paths.llvm:
        prefix_paths += [paths.llvm]
    if paths.elfutils:
        prefix_paths += [paths.elfutils]
    prefix_paths = [common.to_posix_path(fp) for fp in prefix_paths]
    with_docs_str = 'OFF' if args.no_docs else 'ON'
    build_date_option = 'OFF' if args.no_build_date else 'ON'
    test_option = 'ON' if args.with_tests else 'OFF'
    cmake_args = [
        'cmake', '-DCMAKE_PREFIX_PATH=' + ';'.join(prefix_paths),
        '-DSHOW_BUILD_DATE=' + build_date_option,
        '-DWITH_DOCS=' + with_docs_str,
        '-DBUILD_DEVELOPER_DOCS=' + with_docs_str,
        '-DBUILD_EXECUTABLE_SDKTOOL=OFF',
        '-DCMAKE_INSTALL_PREFIX=' + common.to_posix_path(paths.install),
        '-DWITH_TESTS=' + test_option
    ]
    cmake_args += common_cmake_arguments(args)

    if common.is_windows_platform():
        cmake_args += [
            '-DBUILD_EXECUTABLE_WIN32INTERRUPT=OFF',
            '-DBUILD_EXECUTABLE_WIN64INTERRUPT=OFF',
            '-DBUILD_LIBRARY_QTCREATORCDBEXT=OFF'
        ]

    ide_revision = common.get_commit_SHA(paths.src)
    if ide_revision:
        cmake_args += [
            '-DIDE_REVISION=ON', '-DIDE_REVISION_STR=' + ide_revision,
            '-DIDE_REVISION_URL=https://code.qt.io/cgit/qt-creator/qt-creator.git/log/?id='
            + ide_revision
        ]

    cmake_args += args.config_args

    common.check_print_call(cmake_args + [paths.src], paths.build)
    build_args = ['cmake', '--build', '.']
    if args.make_args:
        build_args += ['--'] + args.make_args
    common.check_print_call(build_args, paths.build)
    if not args.no_docs:
        common.check_print_call(['cmake', '--build', '.', '--target', 'docs'],
                                paths.build)

    common.check_print_call(
        ['cmake', '--install', '.', '--prefix', paths.install, '--strip'],
        paths.build)
    common.check_print_call([
        'cmake', '--install', '.', '--prefix', paths.install, '--component',
        'Dependencies'
    ], paths.build)
    common.check_print_call([
        'cmake', '--install', '.', '--prefix', paths.dev_install,
        '--component', 'Devel'
    ], paths.build)
    if args.with_debug_info:
        common.check_print_call([
            'cmake', '--install', '.', '--prefix', paths.debug_install,
            '--component', 'DebugInfo'
        ], paths.build)
    if not args.no_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)
Esempio n. 16
0
            if python_library:
                cmake_args += ['-DPYTHON_LIBRARY=' + python_library[0],
                               '-DPYTHON_INCLUDE_DIR=' + os.path.join(args.python_path, 'include')]

    # TODO this works around a CMake bug https://gitlab.kitware.com/cmake/cmake/issues/20119
    cmake_args += ['-DBUILD_WITH_PCH=OFF']

    ide_revision = common.get_commit_SHA(paths.src)
    if ide_revision:
        cmake_args += ['-DIDE_REVISION=ON',
                       '-DIDE_REVISION_STR=' + ide_revision,
                       '-DIDE_REVISION_URL=https://code.qt.io/cgit/qt-creator/qt-creator.git/log/?id=' + ide_revision]

    cmake_args += args.config_args

    common.check_print_call(cmake_args + [paths.src], paths.build)
    build_args = ['cmake', '--build', '.']
    if args.make_args:
        build_args += ['--'] + args.make_args
    common.check_print_call(build_args, paths.build)
    if not args.no_docs:
        common.check_print_call(['cmake', '--build', '.', '--target', 'docs'], paths.build)

    common.check_print_call(['cmake', '--install', '.', '--prefix', paths.install, '--strip'],
                            paths.build)
    common.check_print_call(['cmake', '--install', '.', '--prefix', paths.dev_install,
                             '--component', 'Devel'],
                            paths.build)
    if not args.no_docs:
        common.check_print_call(['cmake', '--install', '.', '--prefix', paths.install,
                                 '--component', 'qch_docs'],
Esempio n. 17
0
def build(args, paths):
    if not os.path.exists(paths.build):
        os.makedirs(paths.build)
    if not os.path.exists(paths.result):
        os.makedirs(paths.result)
    prefix_paths = [os.path.abspath(fp)
                    for fp in args.prefix_paths] + [paths.qt]
    prefix_paths += qtcreator_prefix_path(paths.qt_creator)
    prefix_paths = [common.to_posix_path(fp) for fp in prefix_paths]
    separate_debug_info_option = 'ON' if args.with_debug_info else 'OFF'
    cmake_args = [
        'cmake', '-DCMAKE_PREFIX_PATH=' + ';'.join(prefix_paths),
        '-DCMAKE_BUILD_TYPE=' + args.build_type,
        '-DQTC_SEPARATE_DEBUG_INFO=' + separate_debug_info_option,
        '-DCMAKE_INSTALL_PREFIX=' + common.to_posix_path(paths.install), '-G',
        'Ninja'
    ]

    if args.module_paths:
        module_paths = [
            common.to_posix_path(os.path.abspath(fp))
            for fp in args.module_paths
        ]
        cmake_args += ['-DCMAKE_MODULE_PATH=' + ';'.join(module_paths)]

    # force MSVC on Windows, because it looks for GCC in the PATH first,
    # even if MSVC is first mentioned in the PATH...
    # TODO would be nicer if we only did this if cl.exe is indeed first in the PATH
    if common.is_windows_platform():
        cmake_args += ['-DCMAKE_C_COMPILER=cl', '-DCMAKE_CXX_COMPILER=cl']

    # TODO this works around a CMake bug https://gitlab.kitware.com/cmake/cmake/issues/20119
    cmake_args += ['-DBUILD_WITH_PCH=OFF']

    # work around QTBUG-89754
    # Qt otherwise adds dependencies on libGLX and libOpenGL
    cmake_args += ['-DOpenGL_GL_PREFERENCE=LEGACY']

    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]
        with open(os.path.join(paths.result, args.name + '.7z.git_sha'),
                  'w') as f:
            f.write(ide_revision)

    if not args.build_type.lower() == 'release' and args.sanitize_flags:
        cmake_args += [
            '-DWITH_SANITIZE=ON',
            '-DSANITIZE_FLAGS=' + ",".join(args.sanitize_flags)
        ]

    cmake_args += args.config_args
    common.check_print_call(cmake_args + [paths.src], paths.build)
    build_args = ['cmake', '--build', '.']
    if args.make_args:
        build_args += ['--'] + args.make_args
    common.check_print_call(build_args, 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'
        ], paths.build)
    common.check_print_call([
        'cmake', '--install', '.', '--prefix', paths.dev_install,
        '--component', 'Devel'
    ], paths.build)
    if args.with_debug_info:
        common.check_print_call([
            'cmake', '--install', '.', '--prefix', paths.debug_install,
            '--component', 'DebugInfo'
        ], paths.build)
Esempio n. 18
0
def package_qtcreator(args, paths):
    if not args.no_zip:
        common.check_print_call([
            '7z', 'a', '-mmt2',
            os.path.join(paths.result, 'qtcreator' + args.zip_infix + '.7z'),
            '*'
        ], paths.install)
        common.check_print_call([
            '7z', 'a', '-mmt2',
            os.path.join(paths.result,
                         'qtcreator' + args.zip_infix + '_dev.7z'), '*'
        ], paths.dev_install)
        if args.with_debug_info:
            common.check_print_call([
                '7z', 'a', '-mmt2',
                os.path.join(paths.result,
                             'qtcreator' + args.zip_infix + '-debug.7z'), '*'
            ], paths.debug_install)
        if common.is_windows_platform():
            common.check_print_call([
                '7z', 'a', '-mmt2',
                os.path.join(paths.result,
                             'wininterrupt' + args.zip_infix + '.7z'), '*'
            ], paths.wininterrupt_install)
            if not args.no_cdb:
                common.check_print_call([
                    '7z', 'a', '-mmt2',
                    os.path.join(paths.result, 'qtcreatorcdbext' +
                                 args.zip_infix + '.7z'), '*'
                ], paths.qtcreatorcdbext_install)

    if common.is_mac_platform():
        if args.keychain_unlock_script:
            common.check_print_call([args.keychain_unlock_script],
                                    paths.install)
        if not args.no_dmg:
            common.check_print_call([
                'python', '-u',
                os.path.join(paths.src, 'scripts', 'makedmg.py'),
                'qt-creator' + args.zip_infix + '.dmg', 'Qt Creator',
                paths.src, paths.install
            ], paths.result)
Esempio n. 19
0
def build_qtcreator(args, paths):
    def cmake_option(option):
        return 'ON' if option else 'OFF'

    if args.no_qtcreator:
        return
    if not os.path.exists(paths.build):
        os.makedirs(paths.build)
    build_qbs = (True if not args.no_qbs and os.path.exists(
        os.path.join(paths.src, 'src', 'shared', 'qbs', 'CMakeLists.txt')) else
                 False)
    prefix_paths = [os.path.abspath(fp)
                    for fp in args.prefix_paths] + [paths.qt]
    if paths.llvm:
        prefix_paths += [paths.llvm]
    if paths.elfutils:
        prefix_paths += [paths.elfutils]
    prefix_paths = [common.to_posix_path(fp) for fp in prefix_paths]
    cmake_args = [
        'cmake', '-DCMAKE_PREFIX_PATH=' + ';'.join(prefix_paths),
        '-DSHOW_BUILD_DATE=' + cmake_option(not args.no_build_date),
        '-DWITH_DOCS=' + cmake_option(not args.no_docs),
        '-DBUILD_QBS=' + cmake_option(build_qbs),
        '-DBUILD_DEVELOPER_DOCS=' + cmake_option(not args.no_docs),
        '-DBUILD_EXECUTABLE_SDKTOOL=OFF', '-DQTC_FORCE_XCB=ON',
        '-DCMAKE_INSTALL_PREFIX=' + common.to_posix_path(paths.install),
        '-DWITH_TESTS=' + cmake_option(args.with_tests)
    ]
    cmake_args += common_cmake_arguments(args)

    if common.is_windows_platform():
        cmake_args += [
            '-DBUILD_EXECUTABLE_WIN32INTERRUPT=OFF',
            '-DBUILD_EXECUTABLE_WIN64INTERRUPT=OFF',
            '-DBUILD_LIBRARY_QTCREATORCDBEXT=OFF'
        ]

    ide_revision = common.get_commit_SHA(paths.src)
    if ide_revision:
        cmake_args += [
            '-DIDE_REVISION=ON', '-DIDE_REVISION_STR=' + ide_revision[:10],
            '-DIDE_REVISION_URL=https://code.qt.io/cgit/qt-creator/qt-creator.git/log/?id='
            + ide_revision
        ]

    if not args.build_type.lower() == 'release' and args.sanitize_flags:
        cmake_args += [
            '-DWITH_SANITIZE=ON',
            '-DSANITIZE_FLAGS=' + ",".join(args.sanitize_flags)
        ]

    cmake_args += args.config_args

    common.check_print_call(cmake_args + [paths.src], paths.build)
    build_args = ['cmake', '--build', '.']
    if args.make_args:
        build_args += ['--'] + args.make_args
    common.check_print_call(build_args, paths.build)
    if not args.no_docs:
        common.check_print_call(['cmake', '--build', '.', '--target', 'docs'],
                                paths.build)

    common.check_print_call(
        ['cmake', '--install', '.', '--prefix', paths.install, '--strip'],
        paths.build)
    common.check_print_call([
        'cmake', '--install', '.', '--prefix', paths.install, '--component',
        'Dependencies'
    ], paths.build)
    common.check_print_call([
        'cmake', '--install', '.', '--prefix', paths.dev_install,
        '--component', 'Devel'
    ], paths.build)
    if args.with_debug_info:
        common.check_print_call([
            'cmake', '--install', '.', '--prefix', paths.debug_install,
            '--component', 'DebugInfo'
        ], paths.build)
    if not args.no_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)