Do not build Qbs by default

Compiling Qbs takes time and is not strictly necessary for the Qbs
integration in Qt Creator.
We still want to build it for the release, but let's not build it by
default anymore.

[ChangeLog][Building from Sources] Qbs is not built anymore by default.
Pass -DBUILD_QBS=ON on the CMake command line to enable it.

Change-Id: Ic5793e26c7f6a7ac92931777e5d77cef2c8bf888
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This commit is contained in:
Eike Ziller
2021-09-07 13:13:30 +02:00
parent 1b723f6fd9
commit 8e652e1586
3 changed files with 14 additions and 14 deletions

View File

@@ -135,6 +135,9 @@ the first `cmake` call. If you want to build in release mode, change the build
type to `-DCMAKE_BUILD_TYPE=Release`. You can also build with release type to `-DCMAKE_BUILD_TYPE=Release`. You can also build with release
optimizations but debug information with `-DCMAKE_BUILD_TYPE=RelWithDebInfo`. optimizations but debug information with `-DCMAKE_BUILD_TYPE=RelWithDebInfo`.
You can find more options in the generated CMakeCache.txt file. For instance,
building of Qbs together with Qt Creator can be enabled with `-DBUILD_QBS=ON`.
Installation is not needed. It is however possible, using Installation is not needed. It is however possible, using
cmake --install . --prefix /path/to/qtcreator_install cmake --install . --prefix /path/to/qtcreator_install

View File

@@ -85,6 +85,7 @@ def get_arguments():
parser.add_argument('--no-cdb', parser.add_argument('--no-cdb',
help='Skip cdbextension and the python dependency packaging step (Windows)', help='Skip cdbextension and the python dependency packaging step (Windows)',
action='store_true', default=(not common.is_windows_platform())) action='store_true', default=(not common.is_windows_platform()))
parser.add_argument('--no-qbs', help='Skip building Qbs as part of Qt Creator', action='store_true', default=False);
parser.add_argument('--no-docs', help='Skip documentation generation', parser.add_argument('--no-docs', help='Skip documentation generation',
action='store_true', default=False) action='store_true', default=False)
parser.add_argument('--no-build-date', help='Does not show build date in about dialog, for reproducible builds', parser.add_argument('--no-build-date', help='Does not show build date in about dialog, for reproducible builds',
@@ -151,27 +152,29 @@ def common_cmake_arguments(args):
return cmake_args return cmake_args
def build_qtcreator(args, paths): def build_qtcreator(args, paths):
def cmake_option(option):
return 'ON' if option else 'OFF'
if args.no_qtcreator: if args.no_qtcreator:
return return
if not os.path.exists(paths.build): if not os.path.exists(paths.build):
os.makedirs(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] prefix_paths = [os.path.abspath(fp) for fp in args.prefix_paths] + [paths.qt]
if paths.llvm: if paths.llvm:
prefix_paths += [paths.llvm] prefix_paths += [paths.llvm]
if paths.elfutils: if paths.elfutils:
prefix_paths += [paths.elfutils] prefix_paths += [paths.elfutils]
prefix_paths = [common.to_posix_path(fp) for fp in prefix_paths] 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', cmake_args = ['cmake',
'-DCMAKE_PREFIX_PATH=' + ';'.join(prefix_paths), '-DCMAKE_PREFIX_PATH=' + ';'.join(prefix_paths),
'-DSHOW_BUILD_DATE=' + build_date_option, '-DSHOW_BUILD_DATE=' + cmake_option(not args.no_build_date),
'-DWITH_DOCS=' + with_docs_str, '-DWITH_DOCS=' + cmake_option(not args.no_docs),
'-DBUILD_DEVELOPER_DOCS=' + with_docs_str, '-DBUILD_QBS=' + cmake_option(build_qbs),
'-DBUILD_DEVELOPER_DOCS=' + cmake_option(not args.no_docs),
'-DBUILD_EXECUTABLE_SDKTOOL=OFF', '-DBUILD_EXECUTABLE_SDKTOOL=OFF',
'-DCMAKE_INSTALL_PREFIX=' + common.to_posix_path(paths.install), '-DCMAKE_INSTALL_PREFIX=' + common.to_posix_path(paths.install),
'-DWITH_TESTS=' + test_option] '-DWITH_TESTS=' + cmake_option(args.with_tests)]
cmake_args += common_cmake_arguments(args) cmake_args += common_cmake_arguments(args)
if common.is_windows_platform(): if common.is_windows_platform():

View File

@@ -9,13 +9,7 @@ add_subdirectory(registryaccess)
qtc_add_public_header(qtcreator_pch.h) qtc_add_public_header(qtcreator_pch.h)
qtc_add_public_header(qtcreator_gui_pch.h) qtc_add_public_header(qtcreator_gui_pch.h)
if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/qbs/CMakeLists.txt) option(BUILD_QBS "Build Qbs together with Qt Creator" OFF)
set(BUILD_QBS_DEFAULT YES)
else()
set(BUILD_QBS_DEFAULT FALSE)
endif()
option(BUILD_QBS "Build Qbs together with Qt Creator" ${BUILD_QBS_DEFAULT})
add_feature_info("Build Qbs" BUILD_QBS "") add_feature_info("Build Qbs" BUILD_QBS "")
if (BUILD_QBS) if (BUILD_QBS)