forked from qt-creator/qt-creator
McuSupport: Use env variable as package's primary value
Use env variable value as primary source before values from settings and fallback value from JSON. Change-Id: I0c0a4c2cdac65a075d9f38aa1557a9d303b30a5e Reviewed-by: Yasser Grimes <yasser.grimes@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Dawid Śliwa <dawid.sliwa@qt.io> Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -75,7 +75,11 @@ McuPackage::McuPackage(const SettingsHandler::Ptr &settingsHandler,
|
|||||||
, m_downloadUrl(downloadUrl)
|
, m_downloadUrl(downloadUrl)
|
||||||
, m_addToSystemPath(addToSystemPath)
|
, m_addToSystemPath(addToSystemPath)
|
||||||
{
|
{
|
||||||
m_path = this->settingsHandler->getPath(settingsKey, QSettings::UserScope, m_defaultPath);
|
m_path = FilePath::fromString(
|
||||||
|
qEnvironmentVariable(m_environmentVariableName.toStdString().c_str()));
|
||||||
|
if (!m_path.exists()) {
|
||||||
|
m_path = this->settingsHandler->getPath(settingsKey, QSettings::UserScope, m_defaultPath);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QString McuPackage::label() const
|
QString McuPackage::label() const
|
||||||
@@ -125,7 +129,7 @@ FilePath McuPackage::path() const
|
|||||||
|
|
||||||
FilePath McuPackage::defaultPath() const
|
FilePath McuPackage::defaultPath() const
|
||||||
{
|
{
|
||||||
return m_defaultPath;
|
return m_defaultPath.cleanPath();
|
||||||
}
|
}
|
||||||
|
|
||||||
FilePath McuPackage::detectionPath() const
|
FilePath McuPackage::detectionPath() const
|
||||||
|
@@ -81,7 +81,7 @@ constexpr auto armgcc_nxp_1050_json = R"({
|
|||||||
"label": "CMake Toolchain File",
|
"label": "CMake Toolchain File",
|
||||||
"cmakeVar": "CMAKE_TOOLCHAIN_FILE",
|
"cmakeVar": "CMAKE_TOOLCHAIN_FILE",
|
||||||
"type": "file",
|
"type": "file",
|
||||||
"defaultValue": "/opt/qtformcu/2.2/lib/cmake/Qul/toolchain/armgcc.cmake",
|
"defaultValue": "$Qul_ROOT//lib/cmake/Qul/toolchain/armgcc.cmake",
|
||||||
"visible": false,
|
"visible": false,
|
||||||
"optional": false
|
"optional": false
|
||||||
}
|
}
|
||||||
@@ -109,6 +109,7 @@ constexpr auto armgcc_nxp_1050_json = R"({
|
|||||||
"id": "NXP_FREERTOS_DIR",
|
"id": "NXP_FREERTOS_DIR",
|
||||||
"label": "FreeRTOS SDK for MIMXRT1050-EVK",
|
"label": "FreeRTOS SDK for MIMXRT1050-EVK",
|
||||||
"cmakeVar": "FREERTOS_DIR",
|
"cmakeVar": "FREERTOS_DIR",
|
||||||
|
"envVar": "IMXRT1050_FREERTOS_DIR",
|
||||||
"defaultValue": "$QUL_BOARD_SDK_DIR/rtos/freertos/freertos_kernel",
|
"defaultValue": "$QUL_BOARD_SDK_DIR/rtos/freertos/freertos_kernel",
|
||||||
"type": "path",
|
"type": "path",
|
||||||
"optional": false
|
"optional": false
|
||||||
|
Reference in New Issue
Block a user