[CMake] FIND_LIBRARY in FindBoost finds wrong library

Philip Lowman philip at yhbt.com
Mon Mar 22 08:08:24 EDT 2010


On Mon, Mar 22, 2010 at 4:05 AM, Marcel Loose <loose at astron.nl> wrote:
> Hi Chuck,
>
> Whatever way you look at it, problems will likely arise sooner or later
> with different Boost versions. I ran into this problem
> because /usr/lib/libboost_date_time-mt.so was found
> before /home/loose/boost-1.40.0/lib/libboost_date_time.so.
>
> My point in turning the loop inside out stems from the fact that there
> are dozens of FindXXX modules that may be vulnerable to the same
> problem. To name a few: FindGTK, FindLua50, FindPNG, FindWxWindows, etc.
>
> W.r.t. FindBoost, maybe it's wise to use BOOST_ROOT exclusively when
> specified. That would at least preclude the current problems.
>
> BTW: Is there a reason why I cannot specify options like
> NO_CMAKE_ENVIRONMENT_PATH, NO_SYSTEM_ENVIRONMENT_PATH, etc. with
> FIND_PACKAGE(), except when using config mode?

You could modify the FIND_PACKAGE() interface to support options like
these and then fix all of the CMake modules to handle the new options.
 Alternatively, there could be a global CMake property or variable for
enabling these.  A combination could also be used (if necessary,
property is set at start of find_package() and subsequently unset at
end).

-- 
Philip Lowman


More information about the CMake mailing list