Add FindMariaDB.cmake module and use it if MySQL is not found
Needs ReviewPublic

Authored by asturmlechner on Wed, Mar 25, 3:43 PM.

Details

Reviewers
heikobecker
wbauer
Group Reviewers
Amarok
Summary
  • Previously, MariaDB lib was only found w/ distro provided compat links
  • In fact both MySQL and MariaDB client libs can be installed side by side

FindMySQL.cmake: Split out MySQL Embedded detection into FindMySQLe.cmake

  • MySQLe is pretty much dead now
  • If MySQLe is not found, we will not attempt to link MYSQLE_LIBRARIES anymore
  • Move ZLIB detection behind MySQLe conditional
  • WITH_MYSQL_EMBEDDED is now obsolete
  • Drop superfluous set_package_properties if defined in Find*.cmake module

Drop superfluous ZLIB linking

  • Amarok builds fine without, according to CMakeLists.txt only required for MySQLe anyway.
Test Plan

Built fine against mysql-connector-c as well as mariadb-connector-c.
Unfortunately, MySQLe is long gone in Gentoo so I rely on sb. else's test.

Diff Detail

Repository
R181 Amarok
Branch
mysqle-split-for-phab
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 24232
Build 24250: arc lint + arc unit
asturmlechner created this revision.Wed, Mar 25, 3:43 PM
Restricted Application added a project: Amarok. · View Herald TranscriptWed, Mar 25, 3:43 PM
Restricted Application added a subscriber: amarok-devel. · View Herald Transcript
asturmlechner requested review of this revision.Wed, Mar 25, 3:43 PM

updated for the case when mysqle is shipped with mariadb

asturmlechner edited the summary of this revision. (Show Details)Wed, Mar 25, 6:39 PM

On openSUSE, it doesn't enable MySQLe anymore:

 -- Found MySQL: -L/usr/lib64 -lmariadb  
/usr/bin/mysql_config: unrecognized option '--libmysqld-libs'
-- Performing Test HAVE_MYSQL_OPT_EMBEDDED_CONNECTION
-- Performing Test HAVE_MYSQL_OPT_EMBEDDED_CONNECTION - Failed
-- Could NOT find MySQLe (missing: HAVE_MYSQL_OPT_EMBEDDED_CONNECTION)

See inline comment for the reason.

cmake/modules/FindMySQLe.cmake
83

set(CMAKE_REQUIRED_INCLUDES ${MYSQL_INCLUDE_DIR}) is missing here (it was present in the old FindMySQL.cmake).
Adding it makes the test succeed again here.

This comment was removed by wbauer.

re-add accidentally removed required includes to FindMySQLe.cmake

asturmlechner marked an inline comment as done.Wed, Mar 25, 8:07 PM