From b2eb047a036b300cf4d9744a64f0847b7ebc007c Mon Sep 17 00:00:00 2001 From: Mathias Froehlich Date: Sat, 12 Nov 2011 19:48:27 +0100 Subject: [PATCH] fgviewer: add license header, adapt to cmake. --- utils/fgviewer/fgviewer.cxx | 33 +++++++++++++++++++++++++++------ 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/utils/fgviewer/fgviewer.cxx b/utils/fgviewer/fgviewer.cxx index 222bb9ded..fa39f7879 100644 --- a/utils/fgviewer/fgviewer.cxx +++ b/utils/fgviewer/fgviewer.cxx @@ -1,3 +1,25 @@ +// fgviewer.cxx -- alternative flightgear viewer application +// +// Copyright (C) 2009 - 2011 Mathias Froehlich +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License as +// published by the Free Software Foundation; either version 2 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +#ifdef HAVE_CONFIG_H +#include +#endif + #include #include @@ -95,24 +117,23 @@ main(int argc, char** argv) } else if (const char *fg_root_env = std::getenv("FG_ROOT")) { fg_root = fg_root_env; } else { -#if defined(PKGDATADIR) - fg_root = PKGDATADIR; +#if defined(PKGLIBDIR) + fg_root = PKGLIBDIR; #else fg_root = "."; #endif } std::string fg_scenery; - string_list path_list; if (arguments.read("--fg-scenery", fg_scenery)) { - path_list.push_back(fg_scenery); } else if (const char *fg_scenery_env = std::getenv("FG_SCENERY")) { - path_list = sgPathSplit(fg_scenery_env); + fg_scenery = fg_scenery_env; } else { SGPath path(fg_root); path.append("Scenery"); - path_list.push_back(path.str()); + fg_scenery = path.str(); } + string_list path_list = sgPathSplit(fg_scenery); osgDB::FilePathList filePathList; filePathList.push_back(fg_root); for (unsigned i = 0; i < path_list.size(); ++i) {