diff options
author | Eike Ziller <eike.ziller@qt.io> | 2020-10-07 13:31:13 +0200 |
---|---|---|
committer | Eike Ziller <eike.ziller@qt.io> | 2020-10-09 14:27:54 +0000 |
commit | 75adba735bd85bb68b91923ce74762c2ca9be5f0 (patch) | |
tree | a5d84ae6c16f339ef8a4e231d255ec000422ef25 | |
parent | a722b7a09353bd34ca826888658ddf22437e40ff (diff) |
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 <christian.kandeler@qt.io>
Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
-rw-r--r-- | .github/workflows/build_cmake.yml | 4 | ||||
-rw-r--r-- | src/shared/CMakeLists.txt | 34 | ||||
m--------- | src/shared/qbs | 0 |
3 files changed, 35 insertions, 3 deletions
diff --git a/.github/workflows/build_cmake.yml b/.github/workflows/build_cmake.yml index 42254415db..7ab0201d97 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 eeaad66af2..4d702e889d 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 -Subproject 1f2900f4181d44b53f2a36ee637b8570f611515 +Subproject 0d5fdcee74b76175e0b03269b12d9bd4b6eee9c |