Updated Palette config to search in applications resources folder for palettes. Palette, lua scripts, and documentation files are now packaged into MacOSX DragNDrop package.

This commit is contained in:
mjbudd77 2021-06-26 00:16:53 -04:00
parent 941da60ecb
commit fa3b135a44
3 changed files with 44 additions and 3 deletions

View File

@ -20,6 +20,13 @@ echo "Number of Processors: $NPROC";
INSTALL_PREFIX=/tmp/fceux
# Clean build and packaging directories
sudo rm -rf build;
sudo rm -rf $INSTALL_PREFIX/fceux.app;
# Remove windows specific DLLs so that they don't get installed
find output -name *.dll -exec rm -f {} \;
gcc --version
echo '****************************************'

View File

@ -554,8 +554,11 @@ install( TARGETS ${APP_NAME}
# Use \$ to defer expansion until install script is called; CPack will call it with its own CMAKE_INSTALL_PREFIX
set(APP \${CMAKE_INSTALL_PREFIX}/${APP_NAME}.app)
install( DIRECTORY ${CMAKE_SOURCE_DIR}/output/.
DESTINATION ${APP_NAME}.app/Contents/Resources COMPONENT Extra )
set(CPACK_PACKAGE_ICON ${CMAKE_SOURCE_DIR}/fceux.icns )
set(CPACK_GENERATOR "DRAGNDROP")
set(CPACK_GENERATOR "DragNDrop")
include(CPACK)
# macdeployqt tool that comes with Qt: https://doc.qt.io/qt-5/macos-deployment.html#macdeploy

View File

@ -488,7 +488,7 @@ void PaletteConfDialog_t::openPaletteFile(void)
urls << QUrl::fromLocalFile(QDir(FCEUI_GetBaseDirectory()).absolutePath());
if (exePath[0] != 0)
{
{ // This is where the windows build expects the palettes to be
d.setPath(QString(exePath) + "/../palettes");
if (d.exists())
@ -496,11 +496,42 @@ void PaletteConfDialog_t::openPaletteFile(void)
urls << QUrl::fromLocalFile(d.absolutePath());
iniPath = d.absolutePath().toStdString();
}
#ifdef __APPLE__
// Search for MacOSX DragNDrop Resources
d.setPath(QString(exePath) + "/../Resources/palettes");
//printf("Looking for: '%s'\n", d.path().toStdString().c_str());
if (d.exists())
{
urls << QUrl::fromLocalFile(d.absolutePath());
iniPath = d.absolutePath().toStdString();
}
#endif
}
#ifdef WIN32
#else
d.setPath("/usr/share/fceux/palettes");
// Linux and MacOSX (homebrew) expect shared data folder to be relative to bin/fceux executable.
if (exePath[0] != 0)
{
d.setPath(QString(exePath) + "/../share/fceux/palettes");
}
else
{
d.setPath(QString("/usr/local/share/fceux/palettes"));
}
if (!d.exists())
{
d.setPath(QString("/usr/local/share/fceux/palettes"));
}
if (!d.exists())
{
d.setPath(QString("/usr/share/fceux/palettes"));
}
//printf("Looking for: '%s'\n", d.path().toStdString().c_str());
if (d.exists())
{