Use QStringList to avoid false matches against a partial path

Signed-off-by: AMZN-Phil <pconroy@amazon.com>
This commit is contained in:
AMZN-Phil
2021-11-22 08:31:12 -08:00
parent def5b3a65d
commit c2145a6387
2 changed files with 4 additions and 2 deletions
@@ -25,7 +25,8 @@ namespace O3DE::ProjectManager
// Add that path for the command line process so that it will be able to locate
// a home-brew installed version of CMake
QString pathEnv = qEnvironmentVariable("PATH");
if (!pathEnv.contains("/usr/local/bin"))
QStringList pathEnvList = pathEnv.split(":");
if (!pathEnvList.contains("/usr/local/bin"))
{
pathEnv += ":/usr/local/bin";
qputenv("PATH", pathEnv.toStdString().c_str());
@@ -37,7 +37,8 @@ namespace O3DE::ProjectManager
QDir cmakePath(engineInfo.m_path);
cmakePath.cd("cmake/runtime/bin");
QString pathEnv = qEnvironmentVariable("Path");
if (!pathEnv.contains(cmakePath.path()))
QStringList pathEnvList = pathEnv.split(";");
if (!pathEnvList.contains(cmakePath.path()))
{
pathEnv += ";" + cmakePath.path();
qputenv("Path", pathEnv.toStdString().c_str());