[CMake] telling find_package exactly where to find a package

Philip Lowman philip at yhbt.com
Fri Jan 30 01:11:13 EST 2009


On Fri, Jan 30, 2009 at 12:08 AM, Tyler Roscoe <tyler at cryptio.net> wrote:

> I'll spend some more time reading FindQt4.cmake at work tomorrow, but I
> wanted to post this while I'm thinking about it.
>
> I would like to tell find_package where my third-party libraries are (Qt
> specifically). Since I know where the libraries are, I could manually
> add paths to INCLUDE_DIRS and LINK_LIBRARIES, but FindQt4 already knows
> how to do all of that so why duplicate the effort?
>
> This is for an internal build system, so I want to use a specific
> version of Qt installed on a networked filesystem to prevent any
> weirdness caused by a developer compiling against some random Qt that
> she might have on her dev machine.
>
> This seems like a common situation, so surely there's a CMake way to
> handle it? I was hoping the PATHS parameter would do what I want but
> it's for specifying the path to the FindXXX modules.


Read the documentation for the find_path() and find_library() commands.
Setting the variable CMAKE_PREFIX_PATH (or environment variable) will likely
be of tremendous help to you.

-- 
Philip Lowman
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20090130/bc781f8e/attachment.htm>


More information about the CMake mailing list