From 75adba735bd85bb68b91923ce74762c2ca9be5f0 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Wed, 7 Oct 2020 13:31:13 +0200 Subject: [PATCH] CMake build: Build Qbs if the submodule is available Includes update of Qbs to current head of master, which enables this feature on the Qbs build system side. Fixes: QTCREATORBUG-23905 Change-Id: I9a537b640b7f7a753839ace3e44d174c8e0af526 Reviewed-by: Christian Kandeler Reviewed-by: Ivan Komissarov --- .github/workflows/build_cmake.yml | 4 +--- src/shared/CMakeLists.txt | 34 +++++++++++++++++++++++++++++++ src/shared/qbs | 2 +- 3 files changed, 36 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build_cmake.yml b/.github/workflows/build_cmake.yml index 42254415db5..7ab0201d974 100644 --- a/.github/workflows/build_cmake.yml +++ b/.github/workflows/build_cmake.yml @@ -48,9 +48,7 @@ jobs: - name: Checkout submodules run: | git submodule set-url -- perfparser https://code.qt.io/qt-creator/perfparser.git - git submodule update --init src/plugins/help/qlitehtml/litehtml - git submodule update --init src/tools/perfparser - git submodule update --init tests/unit/unittest/3rdparty/googletest + git submodule update --init - name: Download Ninja and CMake shell: cmake -P {0} diff --git a/src/shared/CMakeLists.txt b/src/shared/CMakeLists.txt index eeaad66af22..4d702e889d1 100644 --- a/src/shared/CMakeLists.txt +++ b/src/shared/CMakeLists.txt @@ -4,3 +4,37 @@ add_subdirectory(qtsingleapplication) add_subdirectory(qtlockedfile) add_subdirectory(help) add_subdirectory(registryaccess) + +if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/qbs/CMakeLists.txt) + set(BUILD_QBS_DEFAULT YES) +else() + set(BUILD_QBS_DEFAULT FALSE) +endif() + +option(BUILD_QBS "Build Qbs together with Qt Creator" ${BUILD_QBS_DEFAULT}) + +if (BUILD_QBS) + find_package(Qt5 COMPONENTS Script QUIET) + if (TARGET Qt5::Script) + set(ENABLE_BUILD_QBS YES) + endif() +else() + set(ENABLE_BUILD_QBS NO) +endif() + +add_feature_info("Build Qbs" ENABLE_BUILD_QBS "with CONDITION TARGET Qt5::Script") +if (ENABLE_BUILD_QBS) + file(RELATIVE_PATH _REL_PATH_TO_QTC "${CMAKE_BINARY_DIR}" "${PROJECT_BINARY_DIR}") + set(QBS_OUTPUT_PREFIX "${_REL_PATH_TO_QTC}/" CACHE STRING "" FORCE) + set(QBS_APP_INSTALL_DIR "${IDE_BIN_PATH}" CACHE STRING "" FORCE) + set(QBS_LIB_INSTALL_DIR "${IDE_LIBRARY_PATH}" CACHE STRING "" FORCE) + set(QBS_DLL_INSTALL_DIR "${IDE_BIN_PATH}" CACHE STRING "" FORCE) + set(QBS_LIBEXEC_INSTALL_DIR "${IDE_LIBEXEC_PATH}" CACHE STRING "" FORCE) + set(QBS_PLUGINS_INSTALL_BASE "${IDE_PLUGIN_PATH}" CACHE STRING "" FORCE) + set(QBS_RESOURCES_INSTALL_BASE "${IDE_DATA_PATH}/qbs" CACHE STRING "" FORCE) + set(QBS_HEADERS_INSTALL_DIR "${IDE_DATA_PATH}/qbs/include/qbs" CACHE STRING "" FORCE) + + set(INSTALL_PUBLIC_HEADERS OFF) + set(WITH_TESTS OFF) + add_subdirectory(qbs) +endif() diff --git a/src/shared/qbs b/src/shared/qbs index 1f2900f4181..0d5fdcee74b 160000 --- a/src/shared/qbs +++ b/src/shared/qbs @@ -1 +1 @@ -Subproject commit 1f2900f4181d44b53f2a36ee637b8570f611515f +Subproject commit 0d5fdcee74b76175e0b03269b12d9bd4b6eee9c4