[CMake] find_library doesn't find .dll on windows

Romain LEGUAY romain.leguay at gmail.com
Fri Jun 1 10:53:33 EDT 2018


Hi everyone,

I try to find MYSQL dynamic library on windows.
For this, I use the following command:

set(_PF86 "ProgramFiles(x86)")
find_library( MYSQL_LIBRARY
NAME "libmysql.dll"
PATHS "$ENV{PROGRAMFILES}/MySQL/*/lib"
  "$ENV{${_PF86}}/MySQL/*/lib"
  "$ENV{SYSTEMDRIVE}/MySQL/*/lib"
  NO_DEFAULT_PATH)

This command doesn't work on my computer (Windows 10 Pro x64, CMake 3.11.3).
If I remove the .dll extension, find_library find libmysql.lib which is in
the same folder as libmysql.dll.

How to say to CMake to use the name I chosen?

Thank you!
Romain
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://cmake.org/pipermail/cmake/attachments/20180601/883e5e45/attachment.html>


More information about the CMake mailing list