Skip to content

Commit 008541b

Browse files
author
jef
committedSep 27, 2009
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

File tree

3 files changed

+22
-25
lines changed

3 files changed

+22
-25
lines changed
 

‎src/analysis/CMakeLists.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,6 @@ ADD_LIBRARY(qgis_analysis SHARED ${QGIS_ANALYSIS_SRCS} ${QGIS_ANALYSIS_MOC_SRCS}
5959

6060
ADD_DEPENDENCIES(qgis_analysis qgis_core)
6161

62-
SET_TARGET_PROPERTIES(qgis_analysis PROPERTIES
63-
VERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}
64-
SOVERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR})
65-
6662
SET_TARGET_PROPERTIES(qgis_analysis PROPERTIES VERSION ${COMPLETE_VERSION} SOVERSION ${COMPLETE_VERSION})
6763

6864
# because of htonl

‎src/app/qgisapp.cpp

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4773,33 +4773,38 @@ void QgisApp::loadPythonSupport()
47734773
#ifdef __MINGW32__
47744774
pythonlibName.prepend( "lib" );
47754775
#endif
4776-
QLibrary pythonlib( pythonlibName );
4776+
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 );
4777+
QgsDebugMsg( QString("load library %1 (%2)").arg( pythonlibName ).arg( version ) );
4778+
QLibrary pythonlib( pythonlibName, version );
47774779
// It's necessary to set these two load hints, otherwise Python library won't work correctly
47784780
// see http://lists.kde.org/?l=pykde&m=117190116820758&w=2
47794781
pythonlib.setLoadHints( QLibrary::ResolveAllSymbolsHint | QLibrary::ExportExternalSymbolsHint );
4780-
if ( pythonlib.load() )
4782+
if ( !pythonlib.load() )
47814783
{
4782-
//QgsDebugMsg("Python support library loaded successfully.");
4783-
typedef QgsPythonUtils*( *inst )();
4784-
inst pythonlib_inst = ( inst ) cast_to_fptr( pythonlib.resolve( "instance" ) );
4785-
if ( pythonlib_inst )
4786-
{
4787-
//QgsDebugMsg("Python support library's instance() symbol resolved.");
4788-
mPythonUtils = pythonlib_inst();
4789-
mPythonUtils->initPython( mQgisInterface );
4790-
}
4791-
else
4784+
//using stderr on purpose because we want end users to see this [TS]
4785+
QgsDebugMsg( "Couldn't load Python support library: " + pythonlib.errorString() );
4786+
pythonlib.setFileName( pythonlibName );
4787+
if ( !pythonlib.load() )
47924788
{
4793-
//using stderr on purpose because we want end users to see this [TS]
4794-
QgsDebugMsg( "Couldn't resolve python support library's instance() symbol." );
4789+
qWarning( "Couldn't load Python support library: %s", pythonlib.errorString().toUtf8().data() );
4790+
return;
47954791
}
47964792
}
4797-
else
4793+
4794+
//QgsDebugMsg("Python support library loaded successfully.");
4795+
typedef QgsPythonUtils*( *inst )();
4796+
inst pythonlib_inst = ( inst ) cast_to_fptr( pythonlib.resolve( "instance" ) );
4797+
if ( !pythonlib_inst )
47984798
{
47994799
//using stderr on purpose because we want end users to see this [TS]
4800-
QgsDebugMsg( "Couldn't load Python support library: " + pythonlib.errorString() );
4800+
QgsDebugMsg( "Couldn't resolve python support library's instance() symbol." );
4801+
return;
48014802
}
48024803

4804+
//QgsDebugMsg("Python support library's instance() symbol resolved.");
4805+
mPythonUtils = pythonlib_inst();
4806+
mPythonUtils->initPython( mQgisInterface );
4807+
48034808
if ( mPythonUtils && mPythonUtils->isEnabled() )
48044809
{
48054810
QgsPluginRegistry::instance()->setPythonUtils( mPythonUtils );
@@ -4811,7 +4816,6 @@ void QgisApp::loadPythonSupport()
48114816
mActionPluginSeparator2 = mPluginMenu->addSeparator();
48124817
mPluginMenu->addAction( mActionShowPythonDialog );
48134818
std::cout << "Python support ENABLED :-) " << std::endl; // OK
4814-
48154819
}
48164820
}
48174821

‎src/python/CMakeLists.txt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,7 @@ INCLUDE_DIRECTORIES(
2121

2222
ADD_LIBRARY (qgispython SHARED ${QGISPYTHON_SRCS})
2323

24-
SET_TARGET_PROPERTIES(qgispython PROPERTIES
25-
VERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}
26-
SOVERSION ${COMPLETE_VERSION})
27-
24+
SET_TARGET_PROPERTIES(qgispython PROPERTIES VERSION ${COMPLETE_VERSION} SOVERSION ${COMPLETE_VERSION})
2825

2926
TARGET_LINK_LIBRARIES(qgispython
3027
${QT_QTCORE_LIBRARY}

0 commit comments

Comments
 (0)
Please sign in to comment.