Commit 3d94d3640d26ef73c3efb98a971c40195db47781
1 parent
283dec94
Handle case when OpenBR is a submodule
Showing
1 changed file
with
4 additions
and
1 deletions
openbr/core/plot.cpp
| @@ -91,7 +91,10 @@ struct RPlot | @@ -91,7 +91,10 @@ struct RPlot | ||
| 91 | if (!success) qFatal("Failed to open %s for writing.", qPrintable(file.fileName())); | 91 | if (!success) qFatal("Failed to open %s for writing.", qPrintable(file.fileName())); |
| 92 | 92 | ||
| 93 | // Copy plot_utils.R into output script with source() | 93 | // Copy plot_utils.R into output script with source() |
| 94 | - file.write(qPrintable(QString("source(\"%1\")\n\n").arg(Globals->sdkPath + "/share/openbr/plotting/plot_utils.R"))); | 94 | + QString plotUtilsPath = Globals->sdkPath + "/openbr/share/openbr/plotting/plot_utils.R"; // Handle case when OpenBR is a submodule |
| 95 | + if (!QFileInfo(plotUtilsPath).exists()) | ||
| 96 | + plotUtilsPath = Globals->sdkPath + "/share/openbr/plotting/plot_utils.R"; | ||
| 97 | + file.write(qPrintable(QString("source(\"%1\")\n\n").arg(plotUtilsPath))); | ||
| 95 | file.write("# Read CSVs\n" | 98 | file.write("# Read CSVs\n" |
| 96 | "data <- NULL\n"); | 99 | "data <- NULL\n"); |
| 97 | 100 |