Allow AppImages to pick out different location

Don't assume that libraries are located in the CMAKE lib install
directory as AppImage will relocate them based on the mount point
This commit is contained in:
Seth Hillbrand
2025-03-03 12:34:31 -08:00
parent a32c0a8687
commit 2afa67f946
+18 -4
View File
@@ -381,10 +381,24 @@ wxString PATHS::GetStockPlugins3DPath()
fn.AppendDir( wxT( "PlugIns" ) );
}
#else
// KICAD_PLUGINDIR = CMAKE_INSTALL_FULL_LIBDIR path is the absolute path
// corresponding to the install path used for constructing KICAD_USER_PLUGIN
wxString tfname = wxString::FromUTF8Unchecked( KICAD_PLUGINDIR );
fn.Assign( tfname, "" );
wxString envPath;
// AppImages have a different path to the plugins, otherwise we end up with host sytem
// plugins being loaded.
if( wxGetEnv( wxT( "APPIMAGE" ), nullptr ) && wxGetEnv( wxT( "APPDIR" ), &envPath ) )
{
fn.AssignDir( envPath );
fn.AppendDir( wxT( "usr" ) );
fn.AppendDir( wxT( "lib" ) );
}
else
{
// KICAD_PLUGINDIR = CMAKE_INSTALL_FULL_LIBDIR path is the absolute path
// corresponding to the install path used for constructing KICAD_USER_PLUGIN
wxString tfname = wxString::FromUTF8Unchecked( KICAD_PLUGINDIR );
fn.Assign( tfname, "" );
}
fn.AppendDir( wxT( "kicad" ) );
fn.AppendDir( wxT( "plugins" ) );
#endif