[CMake] Win32: unable to find Curl library with FIND_LIBRARY

Pau Garcia i Quiles pgquiles at elpauer.org
Tue Nov 20 07:49:23 EST 2007


Quoting Stephen Collyer <scollyer at netspinner.co.uk>:

> I'm modifying FindCURL.cmake to match my local Win32 installation
> of a development tree for Curl, which is installed as follows:
>
> c:\Program Files\curl\libcurl.dll
> c:\Program Files\curl\include\curl\curl.h
>
> I've managed to find the include directory by changing the
> code as follows:
>
> FIND_PATH(CURL_INCLUDE_DIR NAMES curl/curl.h curl/include/curl/curl.h)
>
> The final path matches the layout and CURL_INCLUDE_DIR is set.
> However, I can't get FIND_LIBRARY to find the libcurl.dll file.
> The original code was:
>
> FIND_LIBRARY(CURL_LIBRARY NAMES curl)
>
> which failed. I was assuming that it wasn't looking for libcurl
> so I changed it to:
>
> FIND_LIBRARY(CURL_LIBRARY NAMES curl libcurl)
>
> which also failed.
>
> I then wondered if it was failing to look in the curl dir
> at all so I've currently got:
>
> FIND_LIBRARY(CURL_LIBRARY NAMES curl libcurl PATHS curl
> "$ENV{ProgramFiles}/curl)
>
> and that fails too. I'm now pretty much out of ideas. Any
> got any suggestions ?
>
> Is it possible to get any verbose o/p from cmake when it runs
> these searches ? It would give me some idea of what it was trying
> to do behind the scenes.

You don't need to modify FindCURL.cmake. Just add c:\Program  
Files\curl to CMAKE_LIBRARY_PATH and c:\Program Files\curl\include to  
CMAKE_INCLUDE_PATH in your CMakeLists.txt.

-- 
Pau Garcia i Quiles
http://www.elpauer.org
(Due to my workload, I may need 10 days to answer)



More information about the CMake mailing list