diff --git a/utils/fgviewer/Makefile.am b/utils/fgviewer/Makefile.am index c0384d803..9d9b18534 100644 --- a/utils/fgviewer/Makefile.am +++ b/utils/fgviewer/Makefile.am @@ -1,3 +1,6 @@ + +AM_CXXFLAGS = -DPKGDATADIR=\"$(pkgdatadir)\" + bin_PROGRAMS = fgviewer fgviewer_SOURCES = fgviewer.cxx diff --git a/utils/fgviewer/fgviewer.cxx b/utils/fgviewer/fgviewer.cxx index 6851dbd5f..42f2104ca 100644 --- a/utils/fgviewer/fgviewer.cxx +++ b/utils/fgviewer/fgviewer.cxx @@ -81,7 +81,11 @@ main(int argc, char** argv) if (fg_root_env) fg_root = fg_root_env; else +#if defined(PKGDATADIR) + fg_root = PKGDATADIR; +#else fg_root = "."; +#endif osgDB::FilePathList filePathList; filePathList.push_back(fg_root);