[amarok] cmake/modules: Revert "FindMySQLAmarok.cmake fix argumets when calling mysql_config"

Christophe Giboudeaux cgiboudeaux at gmx.com
Mon Dec 19 15:14:08 UTC 2011


On Monday 19 December 2011 00:38:47 =?utf-8?B?TWF0xJtq?= Laitl wrote:
> On 19. 12. 2011 Christophe Giboudeaux wrote:
> > On Sunday 18 December 2011 23:27:08 Matej Laitl wrote:
> > > Sorry about the incorrect fix, I will build with -Wmissing-include-dirs
> > > from now on. However I wonder how to fix the original problem.
> > 
> > Your commit doesn't mention the issue you're trying to fix. However,
> > having
> > the same directory included several times is not an issue (and I'm not
> > aware of any GCC flag that would throw a warning).
> 
> Ah, I tried to solve http://mail.kde.org/pipermail/amarok-devel/2011-
> December/009663.html
> 
> Specifically, the problem is that mysql_config (since at least 5.1.56)
> doesn't accept --variable=pkgincludedir - it accepts only --include
> argument which returns something like -I/usr/include/mysql

> -- Found MySQL: Usage: /usr/bin/mysql_config [OPTIONS]
[cut]

> So I guess we'll have to strip that -I out of `mysql_config --include`. Can
> we safely assume that it is only a single directory?
> 

ok, then it only exists in higher version (the option exists in 5.5.x). 

I see two solutions: 
- only rely on find_path(MYSQL_INCLUDE_DIR...), so move it outside the 
else(MYSQLCONFIG_EXECUTABLE) loop  [1]

- Drop FindMysqlAmarok.cmake and use FindAmarok.cmake from kdelibs instead 
(which worked fine here).

I prefer the second solution as the FindMysql from kdelibs is really cleaner 
than the Amarok copy:

- MYSQL_CFLAGS doesn't look that important

- the linked targets gathered with 'mysql_config --libs' are already 
explicitly added in the CMakeLists.txt files (./src/core-
impl/collections/db/sql/mysqlecollection/CMakeLists.txt, ./src/core-
impl/collections/db/sql/mysqlservercollection/CMakeLists.txt and some unit 
tests) and the output variable is different if mysql_config is not present:

  * with mysql_config, MYSQL_LIBRARIES="-L/usr/lib64 -lmysqlclient -lpthread -
lz -lm -lrt -lssl -lcrypto -ldl"
  * without it, MYSQL_LIBRARIES=/usr/lib64/libmysqlclient.so. The second one 
is enough

- the kdelibs FindAmarok has better chances to detect mysql.h under Windows,
- and it also uses a cleaner way to decide if mysqle is there.


The first solution is the easy one, the second one needs more testing on 
different platforms/distributions.

Christophe

[1] attached: fixMySQLAmarok.diff
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fixMySQLAmarok.diff
Type: text/x-patch
Size: 1707 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/amarok-devel/attachments/20111219/ba06dd2a/attachment.diff>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/amarok-devel/attachments/20111219/ba06dd2a/attachment.sig>


More information about the Amarok-devel mailing list