One specifies find_library( name PATHS path1..pathn)
My question is how does find_library match name to the library file (on Windows and Linux)?
For example, I am unable to have find_library identify the MagicK and MagicK++ dll files in the provided windows binary installation of GraphicsMagicK:
The files is: CORE_RL_magick_.dll
Searching for the queries:
magick CORE_RL_magick
does not work.
You might want to take a look at this documentation links:
http://www.cmake.org/cmake/help/v2.8.10/cmake.html#command:find_library
http://www.cmake.org/cmake/help/v2.8.10/cmake.html#variable:CMAKE_FIND_LIBRARY_PREFIXES
http://www.cmake.org/cmake/help/v2.8.10/cmake.html#variable:CMAKE_FIND_LIBRARY_SUFFIXES
find_library may accept one or more library names. Those names get the value of CMAKE_FIND_LIBRARY_PREFIXES prepended and CMAKE_FIND_LIBRARY_SUFFIXES appended. This two variables should be set for each OS depending on how the librares are prefixed or suffixed there.
In your case I'd write for Windows
and for Linux
and then write
EDIT:
CMAKE_FIND_LIBRARY_PREFIXES
andCMAKE_FIND_LIBRARY_SUFIXES
are set automatically byproject()
command so calling it first andfind_library()
after that point is a better solution than setting the variables manually.Why not use
find_file()
instead offind_library()
if you want to find a .dll.