On 19. 12. 2011 Christophe Giboudeaux wrote: > On Monday 19 December 2011 00:38:47 Matěj Laitl wrote: > > I tried to solve http://mail.kde.org/pipermail/amarok-devel/2011- > > December/009663.html > > > > Specifically, the problem is that mysql_config (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] > > 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
Hmm, I've tried dropping FindMySQLAmarok.cmake, but using kdelibs one doesn't work for me (you probably don't build tests): Linking CXX executable ../../../../testsqlcollection /usr/lib64/mysql/libmysqld.so: undefined reference to `DH_new' /usr/lib64/mysql/libmysqld.so: undefined reference to `SSL_get_current_cipher' /usr/lib64/mysql/libmysqld.so: undefined reference to `SSL_CIPHER_get_name' (...) I don't know why core mysqlcollection builds fine (probably something else pulls OpenSSL? AFAIK undefined symbols are allowed in shared libs, but not final executables), but apparently the additional entries in MYSQL_LIBRARIES are needed. (and I really don't feel like hard-coding them in Amarok) So I will commit your patch if no-one disagrees. Matěj _______________________________________________ Amarok-devel mailing list Amarok-devel@kde.org https://mail.kde.org/mailman/listinfo/amarok-devel