<html><head></head><body><div style="font-family: Verdana;font-size: 12.0px;"><div><br/><div name="quote" style="margin: 10px 5px 5px 10px; padding: 10px 0pt 10px 10px; border-left: 2px solid rgb(195, 217, 229); word-wrap: break-word;"><div name="quoted-content"><div style="font-family: Verdana; font-size: 12px;"><div>
<br/></div><div style="margin: 10px 5px 5px 10px; padding: 10px 0pt 10px 10px; border-left: 2px solid rgb(195, 217, 229);">
<div style="margin: 0pt 0pt 10px;">
<b></b><br/></div>
<div>
2013/1/12 Rolf Eike Beer <eike@sf-mail.de>:<br/>
> peterle oberwi wrote:<br/>
>> Hi,<br/>
>><br/>
>> I want to use Boost library in my project. But there is one version<br/>
>> installed in the system, but not the version I want to use in my project.<br/>
>> Therefore I build the version and installed to a directory in my home. When<br/>
>> I want to use this version it's very anyoing, because cmake find the system<br/>
>> version. My solution is to give a path to the find_package command and use<br/>
>> my own modifed cmake module to use my version. Is there an easier solution<br/>
>> to use non-system libraries without modifying the cmake module or to set<br/>
>> specific variables e.g. there are libraries like qt which have no variables<br/>
>> which can be set.<br/>
<br/>
I think you can set QTDIR in order to give a hint to find_package(Qt[3|4] ...)<br/>
<br/>
<br/>
><br/>
> Set BOOST_ROOT to the root of your installing. You need to call this from a<br/>
> clean build directory.<br/>
<br/>
<br/>
I shall add that you can do that on the command line in order to<br/>
avoid bury such hint inside your CMakeLists.txt.<br/>
<br/>
<br/>
Note that you can usually find this piece of information in the module<br/>
documentation<br/>
(you can get it with<br/>
cmake --help-module FindBoost<br/>
)<br/>
<br/>
see:<br/>
[...]<br/>
This module reads hints about search locations from variables:<br/>
<br/>
BOOST_ROOT - Preferred installation prefix<br/>
(or BOOSTROOT)<br/>
BOOST_INCLUDEDIR - Preferred include directory e.g.<br/>
<prefix>/include<br/>
BOOST_LIBRARYDIR - Preferred library directory e.g. <prefix>/lib<br/>
Boost_NO_SYSTEM_PATHS - Set to ON to disable searching in<br/>
locations not<br/>
specified by these hint variables.<br/>
Default is OFF.<br/>
Boost_ADDITIONAL_VERSIONS<br/>
- List of Boost versions not known to<br/>
this module<br/>
(Boost install locations may contain<br/>
the version)<br/>
[...]<br/>
<br/>
</div><br/></div><div><div><br/></div><br/></div><div><br/></div></div>
</div>
</div>
<br/></div><div><div>Thank
you for your answers. But my question is more in general. There
defintly some libraries, which don't provide environment variables or
other variables for the cmake module. I forgot to mention that I already
know the way to set some variables like BOOST_ROOT or whatever, sorry.<br/></div><div><br/></div><div>
Also if I install the library to /usr/local the problem is the same. As
long as there is a system installed library the command find_package
will use this version, as far as I tested it. If there is no way like
some special environment varibles or the possibility to force a special
version, the system library is used. What I'm looking for is a way like
it's done in configure scripts. I can use something like ./configure
--use_boost=/home/test/boost_dir. Is there the possiblity to do
something like this cmake --use_boost=/home/test/boost_dir. It should be
very easy to extend the find_package command.<br/></div><div><br/></div><div>regards <br/></div><div><br/></div><div>p <br/></div><div><br/></div><div><br/></div></div><div><br/></div><div><br/></div></div></body></html>