diff --git a/src/Main/options.cxx b/src/Main/options.cxx index 4c536e576..20674f2b9 100644 --- a/src/Main/options.cxx +++ b/src/Main/options.cxx @@ -2933,9 +2933,14 @@ string_list Options::extractOptions() const void Options::setupRoot(int argc, char **argv) { - SGPath root; + SGPath root(globals->get_fg_root()); bool usingDefaultRoot = false; + // root has already been set, so skip the fg_root setting and validation. + if (!root.isNull()) { + return; + } + if (isOptionSet("fg-root")) { root = SGPath::fromLocal8Bit(valueForOption("fg-root").c_str()); // easy! SG_LOG(SG_GENERAL, SG_INFO, "set from command-line argument: fg_root = " << root );