Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
prefer versioned qgispython SO, update SO versions for qgispython and…
… qgisanalyis

git-svn-id: http://svn.osgeo.org/qgis/trunk@11717 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Sep 27, 2009
1 parent 09f0854 commit 917a6c7
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 25 deletions.
4 changes: 0 additions & 4 deletions src/analysis/CMakeLists.txt
Expand Up @@ -59,10 +59,6 @@ ADD_LIBRARY(qgis_analysis SHARED ${QGIS_ANALYSIS_SRCS} ${QGIS_ANALYSIS_MOC_SRCS}

ADD_DEPENDENCIES(qgis_analysis qgis_core)

SET_TARGET_PROPERTIES(qgis_analysis PROPERTIES
VERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}
SOVERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR})

SET_TARGET_PROPERTIES(qgis_analysis PROPERTIES VERSION ${COMPLETE_VERSION} SOVERSION ${COMPLETE_VERSION})

# because of htonl
Expand Down
38 changes: 21 additions & 17 deletions src/app/qgisapp.cpp
Expand Up @@ -4773,33 +4773,38 @@ void QgisApp::loadPythonSupport()
#ifdef __MINGW32__
pythonlibName.prepend( "lib" );
#endif
QLibrary pythonlib( pythonlibName );
QString version = QString("%1.%2.%3" ).arg( QGis::QGIS_VERSION_INT / 10000 ).arg( QGis::QGIS_VERSION_INT / 100 % 100 ).arg( QGis::QGIS_VERSION_INT % 100 );
QgsDebugMsg( QString("load library %1 (%2)").arg( pythonlibName ).arg( version ) );
QLibrary pythonlib( pythonlibName, version );
// It's necessary to set these two load hints, otherwise Python library won't work correctly
// see http://lists.kde.org/?l=pykde&m=117190116820758&w=2
pythonlib.setLoadHints( QLibrary::ResolveAllSymbolsHint | QLibrary::ExportExternalSymbolsHint );
if ( pythonlib.load() )
if ( !pythonlib.load() )
{
//QgsDebugMsg("Python support library loaded successfully.");
typedef QgsPythonUtils*( *inst )();
inst pythonlib_inst = ( inst ) cast_to_fptr( pythonlib.resolve( "instance" ) );
if ( pythonlib_inst )
{
//QgsDebugMsg("Python support library's instance() symbol resolved.");
mPythonUtils = pythonlib_inst();
mPythonUtils->initPython( mQgisInterface );
}
else
//using stderr on purpose because we want end users to see this [TS]
QgsDebugMsg( "Couldn't load Python support library: " + pythonlib.errorString() );
pythonlib.setFileName( pythonlibName );
if ( !pythonlib.load() )
{
//using stderr on purpose because we want end users to see this [TS]
QgsDebugMsg( "Couldn't resolve python support library's instance() symbol." );
qWarning( "Couldn't load Python support library: %s", pythonlib.errorString().toUtf8().data() );
return;
}
}
else

//QgsDebugMsg("Python support library loaded successfully.");
typedef QgsPythonUtils*( *inst )();
inst pythonlib_inst = ( inst ) cast_to_fptr( pythonlib.resolve( "instance" ) );
if ( !pythonlib_inst )
{
//using stderr on purpose because we want end users to see this [TS]
QgsDebugMsg( "Couldn't load Python support library: " + pythonlib.errorString() );
QgsDebugMsg( "Couldn't resolve python support library's instance() symbol." );
return;
}

//QgsDebugMsg("Python support library's instance() symbol resolved.");
mPythonUtils = pythonlib_inst();
mPythonUtils->initPython( mQgisInterface );

if ( mPythonUtils && mPythonUtils->isEnabled() )
{
QgsPluginRegistry::instance()->setPythonUtils( mPythonUtils );
Expand All @@ -4811,7 +4816,6 @@ void QgisApp::loadPythonSupport()
mActionPluginSeparator2 = mPluginMenu->addSeparator();
mPluginMenu->addAction( mActionShowPythonDialog );
std::cout << "Python support ENABLED :-) " << std::endl; // OK

}
}

Expand Down
5 changes: 1 addition & 4 deletions src/python/CMakeLists.txt
Expand Up @@ -21,10 +21,7 @@ INCLUDE_DIRECTORIES(

ADD_LIBRARY (qgispython SHARED ${QGISPYTHON_SRCS})

SET_TARGET_PROPERTIES(qgispython PROPERTIES
VERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}
SOVERSION ${COMPLETE_VERSION})

SET_TARGET_PROPERTIES(qgispython PROPERTIES VERSION ${COMPLETE_VERSION} SOVERSION ${COMPLETE_VERSION})

TARGET_LINK_LIBRARIES(qgispython
${QT_QTCORE_LIBRARY}
Expand Down

0 comments on commit 917a6c7

Please sign in to comment.