Showing with 14 additions and 1 deletion.
  1. +8 −0 CMakeLists.txt
  2. +6 −1 src/app/qgspluginregistry.cpp
8 changes: 8 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -623,6 +623,14 @@ ENDIF (ENABLE_TESTS)
IF (APPLE)
# must be last for install, so install_name_tool can do its work
ADD_SUBDIRECTORY(mac)

# make hard link to embedded app bundle binary (symlink won't work)
# allows QGIS to be run directly from build directory
IF (EXISTS "${CMAKE_BINARY_DIR}/output/bin/QGIS.app/Contents/MacOS/QGIS")
EXECUTE_PROCESS(COMMAND /bin/ln -f
"${CMAKE_BINARY_DIR}/output/bin/QGIS.app/Contents/MacOS/QGIS"
"${CMAKE_BINARY_DIR}/output/bin/QGIS")
ENDIF ()
ENDIF (APPLE)

# manual page - makes sense only on unix systems
Expand Down
7 changes: 6 additions & 1 deletion src/app/qgspluginregistry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -434,17 +434,20 @@ void QgsPluginRegistry::restoreSessionPlugins( QString thePluginDirString )
{
QString packageName = pluginList[i];

// TODO: apply better solution for #5879
// start - temporary fix for issue #5879
if ( QgsApplication::isRunningFromBuildDir() )
{
if ( corePlugins.contains( packageName ) )
{
QgsApplication::setPkgDataPath( QgsApplication::buildOutputPath() );
QgsApplication::setPkgDataPath( QString("") );
}
else
{
QgsApplication::setPkgDataPath( QgsApplication::buildSourcePath() );
}
}
// end - temporary fix for issue #5879, more below

if ( checkPythonPlugin( packageName ) )
{
Expand All @@ -456,10 +459,12 @@ void QgsPluginRegistry::restoreSessionPlugins( QString thePluginDirString )
}
}
}
// start - temporary fix for issue #5879, more above
if ( QgsApplication::isRunningFromBuildDir() )
{
QgsApplication::setPkgDataPath( QgsApplication::buildSourcePath() );
}
// end - temporary fix for issue #5879
}

QgsDebugMsg( "Plugin loading completed" );
Expand Down