-1

Trying to build a software, the cmake CMakeFileList.txt ask for MySQL. I am unable to find this files in my modules, neither in the uninstalled libraries.

Considering how popular is MySQL, I guess I am missing something.

Where to find FindMySQL.cmake for MySQL client development library?

Or

What is wrong, what changed, what is the cause of this library being unavailable?

Note: I am using Ubuntu 17.


Obvious tries to solve the issue:

  • Searching on the Ubuntu package search page.
  • Using apt-cache search
  • Searching for FindMySQL on the web

Edited for answering @Tsyvarev

The error is:

CMake Error at CMakeLists.txt:155 (message):
MySQL not found

Searching in /usr/share/cmake-3.7/Modules/

find . -iname "mysql"

I get no results, so FindMySQLConfig or Findmysql-config are not helping.

apt-get install libmysqlclient libmysql++-dev libmysql++3v5

Are installed and up to date.

Software usually declares dependencies, but don't includes other software inside. This is the common way.

Adrian Maire
  • 14,354
  • 9
  • 45
  • 85
  • 2
    For the guy who put that as off-topic: `software tools commonly used by programmers;` is acceptable. Being proactive, point 4. does not apply neither. – Adrian Maire Nov 07 '17 at 12:11
  • Provide **complete** error message you got. [It seems that you want to *generalize* the question, but your question becomes XY problem. You may ask *specific* question, obtain an answer, and only then attempt to generalize the question.] Script `FindMySQL.cmake` should be shipped with the project you build (until it will be shipped with CMake itself). As for `MySQLConfig.cmake` script, it could come with MySQL installation. – Tsyvarev Nov 07 '17 at 13:29
  • I added more details in case it bring more light. – Adrian Maire Nov 07 '17 at 14:06
  • 1
    Oh, simple "MySQL not found" may mean anything. What I have wrote before, it is for `find_package(MySQL)` and its standard output. Consult the project's README. Or try to determine from its `CMakeLists.txt` what is going wrong. – Tsyvarev Nov 07 '17 at 14:10
  • The CMakeLists.txt is unable to find FindMySQL.cmake, which seem for a client MySQL connector. Does this MySQL client library exists? and in case, which package does include it? (We are now back to the point when I wrote this question) – Adrian Maire Nov 07 '17 at 14:48
  • `The CMakeLists.txt is unable to find FindMySQL.cmake` - How do you deduce that? The error message itself doesn't note that. If you have deduced that from the `CMakeLists.txt`, show corresponded code. [Again, this looks like XY problem.] – Tsyvarev Nov 07 '17 at 17:16
  • Related: https://stackoverflow.com/questions/35068444/add-and-link-mysql-libraries-in-a-cmakelist-txt – Steve Lorimer Nov 07 '17 at 20:29

1 Answers1

2

Search on https://packages.ubuntu.com/ yields:

| File                                                                    | Packages                           |
|-------------------------------------------------------------------------|------------------------------------|
| /usr/lib/Wt/cmake/WtFindMysql.txt                                       | witty-examples                     |
| /usr/lib/aarch64-linux-gnu/cmake/KF5KDELibs4Support/FindMySQL.cmake     | libkf5kdelibs4support-dev [arm64]  |
| /usr/lib/arm-linux-gnueabihf/cmake/KF5KDELibs4Support/FindMySQL.cmake   | libkf5kdelibs4support-dev [armhf]  |
| /usr/lib/i386-linux-gnu/cmake/KF5KDELibs4Support/FindMySQL.cmake        | libkf5kdelibs4support-dev [i386]   |
| /usr/lib/powerpc64le-linux-gnu/cmake/KF5KDELibs4Support/FindMySQL.cmake | libkf5kdelibs4support-dev [ppc64el]|
| /usr/lib/s390x-linux-gnu/cmake/KF5KDELibs4Support/FindMySQL.cmake       | libkf5kdelibs4support-dev [s390x]  |
| /usr/lib/x86_64-linux-gnu/cmake/KF5KDELibs4Support/FindMySQL.cmake      | libkf5kdelibs4support-dev [amd64]  |
| /usr/lib/x86_64-linux-gnu/hhvm/CMake/FindMySQL.cmake                    | hhvm-dev [amd64]                   |
| /usr/share/kde4/apps/cmake/modules/FindMySQL.cmake                      | kdelibs5-dev                       |

Which means that the MySQL maintainers don't bother supporting CMake. But others who use mysql have actually written that configuration script (and it's not that hard to write since it mostly uses PkgConfig).

Velkan
  • 7,067
  • 6
  • 43
  • 87