I want to discuss policy of naming and keeping versions our libraries for
Qt4 and Qt5.
In most cases user have only one version of the Qt library, Qt4 or Qt5. But
some cases user can have both Qt4 and Qt5. And he may wants to have 2
version of our libs, for Qt4 and for Qt5.
For programmer which use our library, library is a 3 parts: headers files,
cmake files and .so librariy. I'm using qtxdg as example, but it's same for
all other our libs.
*1. The headers.*
With headers all is easy. Our API don't depending of Qt version so we have
only one instance of headers files.
*2. The .so file*
But ABI depending of Qt version. So we should to have 2 version of .so
files.
2.1 Should we allways add prefix or postfix for libraries, some like
libqtxdg_qt4.so and libqtxdg_qt5.so or something.
2.2 Or always to keep library in the subdirectory
(/usr/lib/qtxdg/qt4/libqtxdg.so)
2.3 Or we keep only one version in the standard directory
(/usr/lib/qtxdg/libqtxdg.so) for current version of the Qt. And if
programmer wants to get second version it should manually set different
directory (say /opt/lib or /usr/lib/qtxdg_qt5).
*3. The cmake files.*
If programmer's system have only one Qt, we can autodetect version of Qt (I
hope). But what we should to do if both Qt are installed?
3.1. How it now. We have hardcoded default version (say Qt4). If programmer
would to use different one, he should manually specify it, using variable.
find_package(qtxdg REQUIRED) # it may raise exception if Qt4 isn't
installed
include(${QTXDG_USE_FILE})
--------------
set(USE_QT5 true)
find_package(qtxdg REQUIRED) # it may raise exception if Qt5 isn't
installed
include(${QTXDG_USE_FILE})
3.2 We write auto detect, but programmer can specify version
find_package(qtxdg REQUIRED) # it always OK
include(${QTXDG_USE_FILE})
--------------
set(USE_QT4 true)
find_package(qtxdg REQUIRED) # it may raise exception if Qt4 isn't
installed
include(${QTXDG_USE_FILE})
--------------
set(USE_QT5 true)
find_package(qtxdg REQUIRED) # it may raise exception if Qt5 isn't
installed
include(${QTXDG_USE_FILE})
3.3 We have different packages.
find_package(qtxdg_qt4 REQUIRED)
include(${QTXDG_QT4_USE_FILE})
or
find_package(qtxdg_qt5 REQUIRED)
include(${QTXDG_QT5_USE_FILE})
I like 3.2. variant - It would be best if using of our cmake files would be
same for both Qt versions. But I don't know best way for .so files.
Any ideas.
--
Best regards,
Alexander.
------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60135991&iu=/4140/ostg.clktrk
_______________________________________________
Lxde-list mailing list
Lxde-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxde-list