[CMake] Add search paths for FIND_PACKAGE ?

Andreas Pakulat apaku at gmx.de
Mon Nov 19 14:44:08 EST 2007


On 19.11.07 19:39:45, Stephen Collyer wrote:
> David Cole wrote:
> > So for the specific case you ask about, FindCURL.cmake, you would set the
> > following advanced variables during ccmake / CMakeSetup configure through
> > the cmake GUI:CURL_INCLUDE_DIR
> > CURL_LIBRARY
> > 
> > Then, with those set, the next FIND_PACKAGE(CURL) will "find" CURL because
> > you've told it exactly where it is.
> > 
> > If you do it all with cmake without a GUI, then you would specify those
> > variables on the first cmake command line with -D.
> > 
> > 
> > Does that help?
> > David
> 
> I guess that solves the problem, but it seems like a hack,
> rather than a solution. It seems to me that the problem
> is that FindCURL.make does this:
> 
> FIND_PATH(CURL_INCLUDE_DIR NAMES curl/curl.h)
> 
> i.e. it hard-codes the assumption that curl.h lives in
> a directory called curl. In my case, it doesn't: it lives
> in a directory called include and no amount of adding to
> or subtracting from the default directories that FIND_PATH
> search from will fix this problem. Hence your hack: tell
> cmake explicitly where to look and all is well.

Usually this indicates a lack of cross-platform tests for the library in
question. You should open a bugreport with Kitware to get this fixed.
Unless of course you're not using the official sources or official
binaries for Curl (or hacked the sources for the install location you
got)

Andreas

-- 
You shall be rewarded for a dastardly deed.


More information about the CMake mailing list