[QGIS Commit] r11717 - in trunk/qgis/src: analysis app python

svn_qgis at osgeo.org svn_qgis at osgeo.org
Sat Sep 26 21:17:30 EDT 2009


Author: jef
Date: 2009-09-26 21:17:24 -0400 (Sat, 26 Sep 2009)
New Revision: 11717

Modified:
   trunk/qgis/src/analysis/CMakeLists.txt
   trunk/qgis/src/app/qgisapp.cpp
   trunk/qgis/src/python/CMakeLists.txt
Log:
prefer versioned qgispython SO, update SO versions for qgispython and qgisanalyis

Modified: trunk/qgis/src/analysis/CMakeLists.txt
===================================================================
--- trunk/qgis/src/analysis/CMakeLists.txt	2009-09-26 21:27:20 UTC (rev 11716)
+++ trunk/qgis/src/analysis/CMakeLists.txt	2009-09-27 01:17:24 UTC (rev 11717)
@@ -59,10 +59,6 @@
 
 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

Modified: trunk/qgis/src/app/qgisapp.cpp
===================================================================
--- trunk/qgis/src/app/qgisapp.cpp	2009-09-26 21:27:20 UTC (rev 11716)
+++ trunk/qgis/src/app/qgisapp.cpp	2009-09-27 01:17:24 UTC (rev 11717)
@@ -4773,33 +4773,38 @@
 #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 )
+    //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() )
     {
-      //QgsDebugMsg("Python support library's instance() symbol resolved.");
-      mPythonUtils = pythonlib_inst();
-      mPythonUtils->initPython( mQgisInterface );
+      qWarning( "Couldn't load Python support library: %s", pythonlib.errorString().toUtf8().data() );
+      return;
     }
-    else
-    {
-      //using stderr on purpose because we want end users to see this [TS]
-      QgsDebugMsg( "Couldn't resolve python support library's instance() symbol." );
-    }
   }
-  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 @@
     mActionPluginSeparator2 = mPluginMenu->addSeparator();
     mPluginMenu->addAction( mActionShowPythonDialog );
     std::cout << "Python support ENABLED :-) " << std::endl; // OK
-
   }
 }
 

Modified: trunk/qgis/src/python/CMakeLists.txt
===================================================================
--- trunk/qgis/src/python/CMakeLists.txt	2009-09-26 21:27:20 UTC (rev 11716)
+++ trunk/qgis/src/python/CMakeLists.txt	2009-09-27 01:17:24 UTC (rev 11717)
@@ -21,11 +21,8 @@
 
 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} 
   ${QT_QTGUI_LIBRARY} 



More information about the QGIS-commit mailing list