@@ -50,6 +50,9 @@ QStringList ABISYM( QgsApplication::mDefaultSvgPaths );
50
50
QString ABISYM ( QgsApplication::mConfigPath );
51
51
bool ABISYM ( QgsApplication::mRunningFromBuildDir ) = false;
52
52
QString ABISYM ( QgsApplication::mBuildSourcePath );
53
+ #ifdef _MSC_VER
54
+ QString ABISYM ( QgsApplication::mCfgIntDir );
55
+ #endif
53
56
QString ABISYM ( QgsApplication::mBuildOutputPath );
54
57
QStringList ABISYM ( QgsApplication::mGdalSkipList );
55
58
@@ -81,14 +84,23 @@ void QgsApplication::init( QString customConfigPath )
81
84
82
85
// check if QGIS is run from build directory (not the install directory)
83
86
QDir appDir ( applicationDirPath () );
84
- if ( appDir.exists ( " source_path.txt" ) )
87
+ #ifndef _MSC_VER
88
+ #define SOURCE_PATH " source_path.txt"
89
+ #else
90
+ #define SOURCE_PATH " ../source_path.txt"
91
+ #endif
92
+ if ( appDir.exists ( SOURCE_PATH ) )
85
93
{
86
- QFile f ( applicationDirPath () + " /source_path.txt " );
94
+ QFile f ( applicationDirPath () + " /" + SOURCE_PATH );
87
95
if ( f.open ( QIODevice::ReadOnly ) )
88
96
{
89
97
ABISYM ( mRunningFromBuildDir ) = true ;
90
98
ABISYM ( mBuildSourcePath ) = f.readAll ();
91
- #if defined(Q_WS_MACX) || defined(Q_WS_WIN32) || defined(WIN32)
99
+ #if _MSC_VER
100
+ QStringList elems = applicationDirPath ().split ( " /" , QString::SkipEmptyParts );
101
+ ABISYM ( mCfgIntDir ) = elems.last ();
102
+ ABISYM ( mBuildOutputPath ) = applicationDirPath () + " /../.." ;
103
+ #elif defined(Q_WS_MACX)
92
104
ABISYM ( mBuildOutputPath ) = applicationDirPath ();
93
105
#else
94
106
ABISYM ( mBuildOutputPath ) = applicationDirPath () + " /.." ; // on linux
@@ -103,7 +115,11 @@ void QgsApplication::init( QString customConfigPath )
103
115
{
104
116
// we run from source directory - not installed to destination (specified prefix)
105
117
ABISYM ( mPrefixPath ) = QString (); // set invalid path
118
+ #ifdef _MSC_VER
119
+ setPluginPath ( ABISYM ( mBuildOutputPath ) + " /" + QString ( QGIS_PLUGIN_SUBDIR ) + " /" + ABISYM ( mCfgIntDir ) );
120
+ #else
106
121
setPluginPath ( ABISYM ( mBuildOutputPath ) + " /" + QString ( QGIS_PLUGIN_SUBDIR ) );
122
+ #endif
107
123
setPkgDataPath ( ABISYM ( mBuildSourcePath ) ); // directly source path - used for: doc, resources, svg
108
124
ABISYM ( mLibraryPath ) = ABISYM ( mBuildOutputPath ) + " /" + QGIS_LIB_SUBDIR + " /" ;
109
125
ABISYM ( mLibexecPath ) = ABISYM ( mBuildOutputPath ) + " /" + QGIS_LIBEXEC_SUBDIR + " /" ;
0 commit comments