1
0
Fork 0

fgviewer: add license header, adapt to cmake.

This commit is contained in:
Mathias Froehlich 2011-11-12 19:48:27 +01:00
parent 42fb9b8e9f
commit b2eb047a03

View file

@ -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 <config.h>
#endif
#include <iostream>
#include <cstdlib>
@ -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) {