diff options
author | Samuli Piippo <samuli.piippo@qt.io> | 2018-10-25 15:05:08 +0300 |
---|---|---|
committer | Samuli Piippo <samuli.piippo@qt.io> | 2018-10-30 08:12:14 +0000 |
commit | c6cf6f303ad64f3243c4541e3d4ab5957326ad38 (patch) | |
tree | 7c890bbeaf522003bfe518eaa33b56dca1cb3e1c | |
parent | da8985fae240e7cf189a1376a6c7593656a024da (diff) | |
download | meta-boot2qt-c6cf6f303ad64f3243c4541e3d4ab5957326ad38.tar.gz |
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 <mikko.gronoff@qt.io>
7 files changed, 123 insertions, 3 deletions
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() { | |||
43 | 43 | ||
44 | RDEPENDS_${PN} = "\ | 44 | RDEPENDS_${PN} = "\ |
45 | nativesdk-gperf \ | 45 | nativesdk-gperf \ |
46 | nativesdk-cmake \ | ||
47 | nativesdk-make \ | ||
46 | ${MACHINE_EXTRA_INSTALL_SDK_HOST} \ | 48 | ${MACHINE_EXTRA_INSTALL_SDK_HOST} \ |
47 | " | 49 | " |
48 | 50 | ||
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 @@ | |||
1 | ############################################################################ | ||
2 | ## | ||
3 | ## Copyright (C) 2018 The Qt Company Ltd. | ||
4 | ## Contact: https://www.qt.io/licensing/ | ||
5 | ## | ||
6 | ## This file is part of the Boot to Qt meta layer. | ||
7 | ## | ||
8 | ## $QT_BEGIN_LICENSE:GPL$ | ||
9 | ## Commercial License Usage | ||
10 | ## Licensees holding valid commercial Qt licenses may use this file in | ||
11 | ## accordance with the commercial license agreement provided with the | ||
12 | ## Software or, alternatively, in accordance with the terms contained in | ||
13 | ## a written agreement between you and The Qt Company. For licensing terms | ||
14 | ## and conditions see https://www.qt.io/terms-conditions. For further | ||
15 | ## information use the contact form at https://www.qt.io/contact-us. | ||
16 | ## | ||
17 | ## GNU General Public License Usage | ||
18 | ## Alternatively, this file may be used under the terms of the GNU | ||
19 | ## General Public License version 3 or (at your option) any later version | ||
20 | ## approved by the KDE Free Qt Foundation. The licenses are as published by | ||
21 | ## the Free Software Foundation and appearing in the file LICENSE.GPL3 | ||
22 | ## included in the packaging of this file. Please review the following | ||
23 | ## information to ensure the GNU General Public License requirements will | ||
24 | ## be met: https://www.gnu.org/licenses/gpl-3.0.html. | ||
25 | ## | ||
26 | ## $QT_END_LICENSE$ | ||
27 | ## | ||
28 | ############################################################################ | ||
29 | |||
30 | DEPENDS_remove_mingw32 = "ncurses" | ||
31 | |||
32 | cmake_do_generate_toolchain_file_append_mingw32() { | ||
33 | cat >> ${WORKDIR}/toolchain.cmake <<EOF | ||
34 | set( CMAKE_SYSTEM_NAME Windows ) | ||
35 | EOF | ||
36 | } | ||
diff --git a/meta-boot2qt-distro/recipes-extended/libarchive/libarchive_%.bbappend b/meta-boot2qt-distro/recipes-extended/libarchive/libarchive_%.bbappend new file mode 100644 index 0000000..937c746 --- /dev/null +++ b/meta-boot2qt-distro/recipes-extended/libarchive/libarchive_%.bbappend | |||
@@ -0,0 +1,30 @@ | |||
1 | ############################################################################ | ||
2 | ## | ||
3 | ## Copyright (C) 2018 The Qt Company Ltd. | ||
4 | ## Contact: https://www.qt.io/licensing/ | ||
5 | ## | ||
6 | ## This file is part of the Boot to Qt meta layer. | ||
7 | ## | ||
8 | ## $QT_BEGIN_LICENSE:GPL$ | ||
9 | ## Commercial License Usage | ||
10 | ## Licensees holding valid commercial Qt licenses may use this file in | ||
11 | ## accordance with the commercial license agreement provided with the | ||
12 | ## Software or, alternatively, in accordance with the terms contained in | ||
13 | ## a written agreement between you and The Qt Company. For licensing terms | ||
14 | ## and conditions see https://www.qt.io/terms-conditions. For further | ||
15 | ## information use the contact form at https://www.qt.io/contact-us. | ||
16 | ## | ||
17 | ## GNU General Public License Usage | ||
18 | ## Alternatively, this file may be used under the terms of the GNU | ||
19 | ## General Public License version 3 or (at your option) any later version | ||
20 | ## approved by the KDE Free Qt Foundation. The licenses are as published by | ||
21 | ## the Free Software Foundation and appearing in the file LICENSE.GPL3 | ||
22 | ## included in the packaging of this file. Please review the following | ||
23 | ## information to ensure the GNU General Public License requirements will | ||
24 | ## be met: https://www.gnu.org/licenses/gpl-3.0.html. | ||
25 | ## | ||
26 | ## $QT_END_LICENSE$ | ||
27 | ## | ||
28 | ############################################################################ | ||
29 | |||
30 | EXTRA_OECONF_append_mingw32 = " --without-cng" | ||
diff --git a/meta-boot2qt-distro/recipes-support/curl/curl_%.bbappend b/meta-boot2qt-distro/recipes-support/curl/curl_%.bbappend new file mode 100644 index 0000000..6545343 --- /dev/null +++ b/meta-boot2qt-distro/recipes-support/curl/curl_%.bbappend | |||
@@ -0,0 +1,31 @@ | |||
1 | ############################################################################ | ||
2 | ## | ||
3 | ## Copyright (C) 2018 The Qt Company Ltd. | ||
4 | ## Contact: https://www.qt.io/licensing/ | ||
5 | ## | ||
6 | ## This file is part of the Boot to Qt meta layer. | ||
7 | ## | ||
8 | ## $QT_BEGIN_LICENSE:GPL$ | ||
9 | ## Commercial License Usage | ||
10 | ## Licensees holding valid commercial Qt licenses may use this file in | ||
11 | ## accordance with the commercial license agreement provided with the | ||
12 | ## Software or, alternatively, in accordance with the terms contained in | ||
13 | ## a written agreement between you and The Qt Company. For licensing terms | ||
14 | ## and conditions see https://www.qt.io/terms-conditions. For further | ||
15 | ## information use the contact form at https://www.qt.io/contact-us. | ||
16 | ## | ||
17 | ## GNU General Public License Usage | ||
18 | ## Alternatively, this file may be used under the terms of the GNU | ||
19 | ## General Public License version 3 or (at your option) any later version | ||
20 | ## approved by the KDE Free Qt Foundation. The licenses are as published by | ||
21 | ## the Free Software Foundation and appearing in the file LICENSE.GPL3 | ||
22 | ## included in the packaging of this file. Please review the following | ||
23 | ## information to ensure the GNU General Public License requirements will | ||
24 | ## be met: https://www.gnu.org/licenses/gpl-3.0.html. | ||
25 | ## | ||
26 | ## $QT_END_LICENSE$ | ||
27 | ## | ||
28 | ############################################################################ | ||
29 | |||
30 | PACKAGECONFIG_remove_class-nativesdk_mingw32 = "ssl" | ||
31 | RRECOMMENDS_lib${BPN}_remove_mingw32 = "ca-certificates" | ||
diff --git a/meta-boot2qt/classes/populate_b2qt_qt5_sdk.bbclass b/meta-boot2qt/classes/populate_b2qt_qt5_sdk.bbclass index ee1a25f..1f7b3c2 100644 --- a/meta-boot2qt/classes/populate_b2qt_qt5_sdk.bbclass +++ b/meta-boot2qt/classes/populate_b2qt_qt5_sdk.bbclass | |||
@@ -1,6 +1,6 @@ | |||
1 | ############################################################################ | 1 | ############################################################################ |
2 | ## | 2 | ## |
3 | ## Copyright (C) 2016 The Qt Company Ltd. | 3 | ## Copyright (C) 2018 The Qt Company Ltd. |
4 | ## Contact: https://www.qt.io/licensing/ | 4 | ## Contact: https://www.qt.io/licensing/ |
5 | ## | 5 | ## |
6 | ## This file is part of the Boot to Qt meta layer. | 6 | ## This file is part of the Boot to Qt meta layer. |
@@ -88,8 +88,10 @@ EOF | |||
88 | echo "set(CMAKE_C_COMPILER_ARG1 \"\${compiler_flags}\")" >> ${MACHINE_CMAKE} | 88 | echo "set(CMAKE_C_COMPILER_ARG1 \"\${compiler_flags}\")" >> ${MACHINE_CMAKE} |
89 | echo "set(CMAKE_CXX_COMPILER_ARG1 \"\${compiler_flags}\")" >> ${MACHINE_CMAKE} | 89 | echo "set(CMAKE_CXX_COMPILER_ARG1 \"\${compiler_flags}\")" >> ${MACHINE_CMAKE} |
90 | echo "set(OE_QMAKE_PATH_EXTERNAL_HOST_BINS ${SDKPATHNATIVE}${OE_QMAKE_PATH_HOST_BINS})" >> ${MACHINE_CMAKE} | 90 | echo "set(OE_QMAKE_PATH_EXTERNAL_HOST_BINS ${SDKPATHNATIVE}${OE_QMAKE_PATH_HOST_BINS})" >> ${MACHINE_CMAKE} |
91 | mkdir -p ${D}${datadir}/cmake/OEToolchainConfig.cmake.d/ | 91 | } |
92 | install -m 0644 ${MACHINE_CMAKE} ${D}${datadir}/cmake/OEToolchainConfig.cmake.d/ | 92 | |
93 | create_sdk_files_append_sdkmingw32 () { | ||
94 | echo "set(OE_QMAKE_BIN_SUFFIX .exe)" >> ${MACHINE_CMAKE} | ||
93 | } | 95 | } |
94 | 96 | ||
95 | create_qtcreator_configure_script () { | 97 | 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 \ | |||
152 | --mkspec "${MKSPEC}" \ | 152 | --mkspec "${MKSPEC}" \ |
153 | --cmake "${BASEID}.cmake" \ | 153 | --cmake "${BASEID}.cmake" \ |
154 | --cmake-config "CMAKE_TOOLCHAIN_FILE:FILEPATH=${OECORE_NATIVE_SYSROOT}/usr/share/cmake/OEToolchainConfig.cmake" \ | 154 | --cmake-config "CMAKE_TOOLCHAIN_FILE:FILEPATH=${OECORE_NATIVE_SYSROOT}/usr/share/cmake/OEToolchainConfig.cmake" \ |
155 | --cmake-config "CMAKE_MAKE_PROGRAM:FILEPATH=$(type -p make)" \ | ||
155 | --cmake-config "CMAKE_CXX_COMPILER:FILEPATH=$(type -p ${CXX})" \ | 156 | --cmake-config "CMAKE_CXX_COMPILER:FILEPATH=$(type -p ${CXX})" \ |
156 | --cmake-config "CMAKE_C_COMPILER:FILEPATH=$(type -p ${CC})" | 157 | --cmake-config "CMAKE_C_COMPILER:FILEPATH=$(type -p ${CC})" |
157 | 158 | ||
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() | |||
56 | component.addOperation("Replace", | 56 | component.addOperation("Replace", |
57 | path + "/sysroots/i686-pokysdk-mingw32/usr/bin/qt.conf", | 57 | path + "/sysroots/i686-pokysdk-mingw32/usr/bin/qt.conf", |
58 | sdkPath, path); | 58 | sdkPath, path); |
59 | component.addOperation("Replace", | ||
60 | path + "/sysroots/i686-pokysdk-mingw32/usr/share/cmake/OEToolchainConfig.cmake.d/" + device + ".cmake", | ||
61 | sdkPath, path); | ||
59 | } | 62 | } |
60 | var basecomponent = component.name.substring(0, component.name.lastIndexOf(".")); | 63 | var basecomponent = component.name.substring(0, component.name.lastIndexOf(".")); |
61 | var toolchainId = "ProjectExplorer.ToolChain.Gcc:" + component.name; | 64 | var toolchainId = "ProjectExplorer.ToolChain.Gcc:" + component.name; |
62 | var debuggerId = basecomponent + ".gdb"; | 65 | var debuggerId = basecomponent + ".gdb"; |
63 | var qtId = basecomponent + ".qt"; | 66 | var qtId = basecomponent + ".qt"; |
67 | var cmakeId = basecomponent + ".cmake"; | ||
64 | var icon = installer.value("B2QtDeviceIcon"); | 68 | var icon = installer.value("B2QtDeviceIcon"); |
65 | var executableExt = ""; | 69 | var executableExt = ""; |
66 | var hostSysroot = "x86_64-pokysdk-linux"; | 70 | var hostSysroot = "x86_64-pokysdk-linux"; |
67 | if (systemInfo.kernelType === "winnt") { | 71 | if (systemInfo.kernelType === "winnt") { |
68 | executableExt = ".exe"; | 72 | executableExt = ".exe"; |
69 | hostSysroot = "i686-pokysdk-mingw32"; | 73 | hostSysroot = "i686-pokysdk-mingw32"; |
74 | toolchainId = "ProjectExplorer.ToolChain.Mingw:" + component.name; | ||
70 | } | 75 | } |
71 | 76 | ||
72 | component.addOperation("Execute", | 77 | component.addOperation("Execute", |
@@ -109,6 +114,14 @@ Component.prototype.createOperations = function() | |||
109 | "@SDKToolBinary@", "rmQt", "--id", qtId]); | 114 | "@SDKToolBinary@", "rmQt", "--id", qtId]); |
110 | 115 | ||
111 | component.addOperation("Execute", | 116 | component.addOperation("Execute", |
117 | ["@SDKToolBinary@", "addCMake", | ||
118 | "--id", cmakeId, | ||
119 | "--name", "CMake (" + platform + " " + target + ")", | ||
120 | "--path", path + "/sysroots/" + hostSysroot + "/usr/bin/cmake" + executableExt, | ||
121 | "UNDOEXECUTE", | ||
122 | "@SDKToolBinary@", "rmCMake", "--id", cmakeId]); | ||
123 | |||
124 | component.addOperation("Execute", | ||
112 | ["@SDKToolBinary@", "addKit", | 125 | ["@SDKToolBinary@", "addKit", |
113 | "--id", basecomponent, | 126 | "--id", basecomponent, |
114 | "--name", platform + " " + target, | 127 | "--name", platform + " " + target, |
@@ -120,6 +133,11 @@ Component.prototype.createOperations = function() | |||
120 | "--Ctoolchain", toolchainId + ".gcc", | 133 | "--Ctoolchain", toolchainId + ".gcc", |
121 | "--Cxxtoolchain", toolchainId + ".g++", | 134 | "--Cxxtoolchain", toolchainId + ".g++", |
122 | "--icon", icon, | 135 | "--icon", icon, |
136 | "--cmake", cmakeId, | ||
137 | "--cmake-config", "CMAKE_TOOLCHAIN_FILE:FILEPATH=" + path + "/sysroots/" + hostSysroot + "/usr/share/cmake/OEToolchainConfig.cmake", | ||
138 | "--cmake-config", "CMAKE_MAKE_PROGRAM:FILEPATH=" + path + "/sysroots/" + hostSysroot + "/usr/bin/make" + executableExt, | ||
139 | "--cmake-config", "CMAKE_CXX_COMPILER:FILEPATH=" + path + "/sysroots/" + hostSysroot + "/usr/bin/" + target_sys + "/" + target_sys + "-g++" + executableExt, | ||
140 | "--cmake-config", "CMAKE_C_COMPILER:FILEPATH=" + path + "/sysroots/" + hostSysroot + "/usr/bin/" + target_sys + "/" + target_sys + "-gcc" + executableExt, | ||
123 | "UNDOEXECUTE", | 141 | "UNDOEXECUTE", |
124 | "@SDKToolBinary@", "rmKit", "--id", basecomponent]); | 142 | "@SDKToolBinary@", "rmKit", "--id", basecomponent]); |
125 | } | 143 | } |