[CMake] Find preferentially in /usr/local/lib not working
Stephen Collyer
scollyer at netspinner.co.uk
Fri Mar 28 06:47:43 EDT 2008
Stephen Collyer wrote:
> Right. So, if I understand correctly, I force FIND_PATH to look in
> /usr/local with, say:
>
> FIND_PATH(IDIR NAMES curl/curl.h PATHS /usr/local/include NO_DEFAULT_PATH)
>
> If that succeeds, the following FIND_PATH is a no-op, whereas if
> it fails then the default paths are searched ?
>
OK, I have the following in the appropriate FindCURL.cmake file:
> # Look for the header file.
>
> FIND_PATH(CURL_INCLUDE_DIR NAMES curl/curl.h PATHS /usr/local/include NO_DEFAULT_PATH)
> FIND_PATH(CURL_INCLUDE_DIR NAMES curl/curl.h PATHS /usr/local/include)
>
> MESSAGE(STATUS "CURL include dir: ${CURL_INCLUDE_DIR}")
>
> MARK_AS_ADVANCED(CURL_INCLUDE_DIR)
>
> # Look for the library.
>
> FIND_LIBRARY(CURL_LIBRARY NAMES curl libcurl PATHS /usr/local/lib NO_DEFAULT_PATH)
> FIND_LIBRARY(CURL_LIBRARY NAMES curl libcurl PATHS /usr/local/lib)
>
> MESSAGE(STATUS "CURL libraries : ${CURL_LIBRARY}")
>
> MARK_AS_ADVANCED(CURL_LIBRARY)
and this emits:
> -- CURL include dir: /usr/include
> -- CURL libraries : /usr/lib/libcurl.so
The contents of /usr/local/include and /usr/local/lib are:
> stephen at opensuse $ ls -l /usr/local/include/curl/
> total 108
> -rw-r--r-- 1 root root 66039 2008-03-27 15:16 curl.h
> -rw-r--r-- 1 root root 2799 2008-03-27 15:16 curlver.h
> -rw-r--r-- 1 root root 2919 2008-03-27 15:16 easy.h
> -rw-r--r-- 1 root root 2787 2008-03-27 15:16 mprintf.h
> -rw-r--r-- 1 root root 13043 2008-03-27 15:16 multi.h
> -rw-r--r-- 1 root root 1383 2008-03-27 15:16 stdcheaders.h
> -rw-r--r-- 1 root root 15 2008-03-27 15:16 types.h
> stephen at opensuse $ ls -l /usr/local/lib/
> total 5624
> -rw-r--r-- 1 root root 2843546 2008-03-27 15:16 libcurl.a
> -rwxr-xr-x 1 root root 905 2008-03-27 15:16 libcurl.la*
> lrwxrwxrwx 1 root root 16 2008-03-27 15:16 libcurl.so -> libcurl.so.4.0.1*
> lrwxrwxrwx 1 root root 16 2008-03-27 15:16 libcurl.so.4 -> libcurl.so.4.0.1*
> -rwxr-xr-x 1 root root 1631316 2008-03-27 15:16 libcurl.so.4.0.1*
> -rw-r--r-- 1 root root 752942 2008-03-27 13:47 libssh2.a
> -rwxr-xr-x 1 root root 843 2008-03-27 13:47 libssh2.la*
> lrwxrwxrwx 1 root root 16 2008-03-27 13:47 libssh2.so -> libssh2.so.1.0.0*
> lrwxrwxrwx 1 root root 16 2008-03-27 13:47 libssh2.so.1 -> libssh2.so.1.0.0*
> -rwxr-xr-x 1 root root 492501 2008-03-27 13:47 libssh2.so.1.0.0*
> drwxr-xr-x 2 root root 4096 2008-03-27 15:16 pkgconfig/
Once again it's failing to find the stuff in /usr/include.
Any suggestions ?
--
Regards
Steve Collyer
Netspinner Ltd
More information about the CMake
mailing list