2013/1/12 Rolf Eike Beer <[email protected]>:
> peterle oberwi wrote:
>> Hi,
>>
>> I want to use Boost library in my project. But there is one version
>> installed in the system, but not the version I want to use in my project.
>> Therefore I build the version and installed to a directory in my home. When
>> I want to use this version it's very anyoing, because cmake find the system
>> version. My solution is to give a path to the find_package command and use
>> my own modifed cmake module to use my version. Is there an easier solution
>> to use non-system libraries without modifying the cmake module or to set
>> specific variables e.g. there are libraries like qt which have no variables
>> which can be set.

I think you can set QTDIR in order to give a hint to find_package(Qt[3|4] ...)


>
> Set BOOST_ROOT to the root of your installing. You need to call this from a
> clean build directory.


I shall add that you can do that on the command line in order to
avoid bury such hint inside your CMakeLists.txt.


Note that you can usually find this piece of information in the module
documentation
(you can get it with
cmake --help-module FindBoost
)

see:
[...]
This module reads hints about search locations from variables:

BOOST_ROOT - Preferred installation prefix
(or BOOSTROOT)
BOOST_INCLUDEDIR - Preferred include directory e.g.
<prefix>/include
BOOST_LIBRARYDIR - Preferred library directory e.g. <prefix>/lib
Boost_NO_SYSTEM_PATHS - Set to ON to disable searching in
locations not
specified by these hint variables.
Default is OFF.
Boost_ADDITIONAL_VERSIONS
- List of Boost versions not known to
this module
(Boost install locations may contain
the version)
[...]






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.

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.

regards






--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to