Browse Source

- Use "Magick++-config --libs" to get linking libs instead of pkg-config because some distros (like Mandriva) do not provide ImageMagick++.pc

adaptive-webui-19844
Christophe Dumez 17 years ago
parent
commit
6918aba90c
  1. 12
      configure
  2. 12
      qcm/libmagick.qcm
  3. 2
      src/src.pro

12
configure vendored

@ -554,6 +554,7 @@ arg: with-libmagick-inc=[path], Path to libmagick++ include files @@ -554,6 +554,7 @@ arg: with-libmagick-inc=[path], Path to libmagick++ include files
arg: with-libmagick-lib=[path], Path to libmagick++ library files
-----END QCMOD-----
*/
#include <QProcess>
class qc_libmagick : public ConfObj
{
public:
@ -595,7 +596,6 @@ public: @@ -595,7 +596,6 @@ public:
if(!QFile::exists(s+QString("libMagick++.so"))){
return false;
}
conf->addLib(QString("-L") + s);
}else{
QStringList sl;
sl << "/usr/lib/";
@ -609,8 +609,16 @@ public: @@ -609,8 +609,16 @@ public:
}
if(!found)
return false;
conf->addLib(QString("-L") + s);
}
conf->addLib(QString("-L") + s);
QProcess magickConfig;
QStringList params;
params << "--libs";
magickConfig.start("Magick++-config", params, QIODevice::ReadOnly);
magickConfig.waitForStarted();
magickConfig.waitForFinished();
QByteArray result = magickConfig.readAll();
conf->addLib(result.data());
conf->addDefine("HAVE_MAGICK");
return true;
}

12
qcm/libmagick.qcm

@ -5,6 +5,7 @@ arg: with-libmagick-inc=[path], Path to libmagick++ include files @@ -5,6 +5,7 @@ arg: with-libmagick-inc=[path], Path to libmagick++ include files
arg: with-libmagick-lib=[path], Path to libmagick++ library files
-----END QCMOD-----
*/
#include <QProcess>
class qc_libmagick : public ConfObj
{
public:
@ -46,7 +47,6 @@ public: @@ -46,7 +47,6 @@ public:
if(!QFile::exists(s+QString("libMagick++.so"))){
return false;
}
conf->addLib(QString("-L") + s);
}else{
QStringList sl;
sl << "/usr/lib/";
@ -60,8 +60,16 @@ public: @@ -60,8 +60,16 @@ public:
}
if(!found)
return false;
conf->addLib(QString("-L") + s);
}
conf->addLib(QString("-L") + s);
QProcess magickConfig;
QStringList params;
params << "--libs";
magickConfig.start("Magick++-config", params, QIODevice::ReadOnly);
magickConfig.waitForStarted();
magickConfig.waitForFinished();
QByteArray result = magickConfig.readAll();
conf->addLib(result.data());
conf->addDefine("HAVE_MAGICK");
return true;
}

2
src/src.pro

@ -79,7 +79,7 @@ CONFIG += link_pkgconfig @@ -79,7 +79,7 @@ CONFIG += link_pkgconfig
PKGCONFIG += libtorrent libccext2 libccgnu2
contains(DEFINES, HAVE_MAGICK){
PKGCONFIG += ImageMagick++
#PKGCONFIG += ImageMagick++
}else{
message(ImageMagick disabled)
}

Loading…
Cancel
Save