Skip to content
Permalink
Browse files
prefer versioned qgispython SO, update SO versions for qgispython and…
… qgisanalyis

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@11717 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Sep 27, 2009
1 parent 41bc931 commit 008541bf90ba370070bc7153b36c7afb443e39a6
Showing with 22 additions and 25 deletions.
  1. +0 −4 src/analysis/CMakeLists.txt
  2. +21 −17 src/app/qgisapp.cpp
  3. +1 −4 src/python/CMakeLists.txt
@@ -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
@@ -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 );
@@ -4811,7 +4816,6 @@ void QgisApp::loadPythonSupport()
mActionPluginSeparator2 = mPluginMenu->addSeparator();
mPluginMenu->addAction( mActionShowPythonDialog );
std::cout << "Python support ENABLED :-) " << std::endl; // OK

}
}

@@ -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}

0 comments on commit 008541b

Please sign in to comment.