From c6cf6f303ad64f3243c4541e3d4ab5957326ad38 Mon Sep 17 00:00:00 2001 From: Samuli Piippo Date: Thu, 25 Oct 2018 15:05:08 +0300 Subject: cmake: fix cmake configurations for QtCreator Include cmake and make as explicitly to the toolchain. Fix nativesdk-cmake compilation for mingw toolchain. Add CMake registration code to the QBSP installer scripts. Task-number: QTBUG-71315 Change-Id: If29e12d6ce24546ba8a834969b6f60e3216e6962 Reviewed-by: Mikko Gronoff --- ...dk-packagegroup-b2qt-embedded-toolchain-host.bb | 2 ++ .../recipes-devtools/cmake/cmake_%.bbappend | 36 ++++++++++++++++++++++ .../libarchive/libarchive_%.bbappend | 30 ++++++++++++++++++ .../recipes-support/curl/curl_%.bbappend | 31 +++++++++++++++++++ meta-boot2qt/classes/populate_b2qt_qt5_sdk.bbclass | 8 +++-- meta-boot2qt/files/configure-qtcreator.sh | 1 + meta-boot2qt/files/qbsp/toolchain_installscript.qs | 18 +++++++++++ 7 files changed, 123 insertions(+), 3 deletions(-) create mode 100644 meta-boot2qt-distro/recipes-devtools/cmake/cmake_%.bbappend create mode 100644 meta-boot2qt-distro/recipes-extended/libarchive/libarchive_%.bbappend create mode 100644 meta-boot2qt-distro/recipes-support/curl/curl_%.bbappend diff --git a/meta-boot2qt-distro/recipes-core/packagegroups/nativesdk-packagegroup-b2qt-embedded-toolchain-host.bb b/meta-boot2qt-distro/recipes-core/packagegroups/nativesdk-packagegroup-b2qt-embedded-toolchain-host.bb index 21552d7..c22a46c 100644 --- a/meta-boot2qt-distro/recipes-core/packagegroups/nativesdk-packagegroup-b2qt-embedded-toolchain-host.bb +++ b/meta-boot2qt-distro/recipes-core/packagegroups/nativesdk-packagegroup-b2qt-embedded-toolchain-host.bb @@ -43,6 +43,8 @@ python __anonymous() { RDEPENDS_${PN} = "\ nativesdk-gperf \ + nativesdk-cmake \ + nativesdk-make \ ${MACHINE_EXTRA_INSTALL_SDK_HOST} \ " diff --git a/meta-boot2qt-distro/recipes-devtools/cmake/cmake_%.bbappend b/meta-boot2qt-distro/recipes-devtools/cmake/cmake_%.bbappend new file mode 100644 index 0000000..d3603bf --- /dev/null +++ b/meta-boot2qt-distro/recipes-devtools/cmake/cmake_%.bbappend @@ -0,0 +1,36 @@ +############################################################################ +## +## Copyright (C) 2018 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the Boot to Qt meta layer. +## +## $QT_BEGIN_LICENSE:GPL$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 or (at your option) any later version +## approved by the KDE Free Qt Foundation. The licenses are as published by +## the Free Software Foundation and appearing in the file LICENSE.GPL3 +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################ + +DEPENDS_remove_mingw32 = "ncurses" + +cmake_do_generate_toolchain_file_append_mingw32() { + cat >> ${WORKDIR}/toolchain.cmake <> ${MACHINE_CMAKE} echo "set(CMAKE_CXX_COMPILER_ARG1 \"\${compiler_flags}\")" >> ${MACHINE_CMAKE} echo "set(OE_QMAKE_PATH_EXTERNAL_HOST_BINS ${SDKPATHNATIVE}${OE_QMAKE_PATH_HOST_BINS})" >> ${MACHINE_CMAKE} - mkdir -p ${D}${datadir}/cmake/OEToolchainConfig.cmake.d/ - install -m 0644 ${MACHINE_CMAKE} ${D}${datadir}/cmake/OEToolchainConfig.cmake.d/ +} + +create_sdk_files_append_sdkmingw32 () { + echo "set(OE_QMAKE_BIN_SUFFIX .exe)" >> ${MACHINE_CMAKE} } create_qtcreator_configure_script () { diff --git a/meta-boot2qt/files/configure-qtcreator.sh b/meta-boot2qt/files/configure-qtcreator.sh index 3e5db2d..a7ea288 100755 --- a/meta-boot2qt/files/configure-qtcreator.sh +++ b/meta-boot2qt/files/configure-qtcreator.sh @@ -152,6 +152,7 @@ ${SDKTOOL} addKit \ --mkspec "${MKSPEC}" \ --cmake "${BASEID}.cmake" \ --cmake-config "CMAKE_TOOLCHAIN_FILE:FILEPATH=${OECORE_NATIVE_SYSROOT}/usr/share/cmake/OEToolchainConfig.cmake" \ + --cmake-config "CMAKE_MAKE_PROGRAM:FILEPATH=$(type -p make)" \ --cmake-config "CMAKE_CXX_COMPILER:FILEPATH=$(type -p ${CXX})" \ --cmake-config "CMAKE_C_COMPILER:FILEPATH=$(type -p ${CC})" diff --git a/meta-boot2qt/files/qbsp/toolchain_installscript.qs b/meta-boot2qt/files/qbsp/toolchain_installscript.qs index 7cef6bc..feee04d 100644 --- a/meta-boot2qt/files/qbsp/toolchain_installscript.qs +++ b/meta-boot2qt/files/qbsp/toolchain_installscript.qs @@ -56,17 +56,22 @@ Component.prototype.createOperations = function() component.addOperation("Replace", path + "/sysroots/i686-pokysdk-mingw32/usr/bin/qt.conf", sdkPath, path); + component.addOperation("Replace", + path + "/sysroots/i686-pokysdk-mingw32/usr/share/cmake/OEToolchainConfig.cmake.d/" + device + ".cmake", + sdkPath, path); } var basecomponent = component.name.substring(0, component.name.lastIndexOf(".")); var toolchainId = "ProjectExplorer.ToolChain.Gcc:" + component.name; var debuggerId = basecomponent + ".gdb"; var qtId = basecomponent + ".qt"; + var cmakeId = basecomponent + ".cmake"; var icon = installer.value("B2QtDeviceIcon"); var executableExt = ""; var hostSysroot = "x86_64-pokysdk-linux"; if (systemInfo.kernelType === "winnt") { executableExt = ".exe"; hostSysroot = "i686-pokysdk-mingw32"; + toolchainId = "ProjectExplorer.ToolChain.Mingw:" + component.name; } component.addOperation("Execute", @@ -108,6 +113,14 @@ Component.prototype.createOperations = function() "UNDOEXECUTE", "@SDKToolBinary@", "rmQt", "--id", qtId]); + component.addOperation("Execute", + ["@SDKToolBinary@", "addCMake", + "--id", cmakeId, + "--name", "CMake (" + platform + " " + target + ")", + "--path", path + "/sysroots/" + hostSysroot + "/usr/bin/cmake" + executableExt, + "UNDOEXECUTE", + "@SDKToolBinary@", "rmCMake", "--id", cmakeId]); + component.addOperation("Execute", ["@SDKToolBinary@", "addKit", "--id", basecomponent, @@ -120,6 +133,11 @@ Component.prototype.createOperations = function() "--Ctoolchain", toolchainId + ".gcc", "--Cxxtoolchain", toolchainId + ".g++", "--icon", icon, + "--cmake", cmakeId, + "--cmake-config", "CMAKE_TOOLCHAIN_FILE:FILEPATH=" + path + "/sysroots/" + hostSysroot + "/usr/share/cmake/OEToolchainConfig.cmake", + "--cmake-config", "CMAKE_MAKE_PROGRAM:FILEPATH=" + path + "/sysroots/" + hostSysroot + "/usr/bin/make" + executableExt, + "--cmake-config", "CMAKE_CXX_COMPILER:FILEPATH=" + path + "/sysroots/" + hostSysroot + "/usr/bin/" + target_sys + "/" + target_sys + "-g++" + executableExt, + "--cmake-config", "CMAKE_C_COMPILER:FILEPATH=" + path + "/sysroots/" + hostSysroot + "/usr/bin/" + target_sys + "/" + target_sys + "-gcc" + executableExt, "UNDOEXECUTE", "@SDKToolBinary@", "rmKit", "--id", basecomponent]); } -- cgit v1.2.3-54-g00ecf