[CMake] Boost Library Search
assume_R
assurem at gmail.com
Wed Oct 6 19:55:14 EDT 2010
Hey all. So I noticed a possible bug with the way boost is searched in
findboost.cmake.
Essentially, if you have the boost static runtimes installed, that's what
Visual Studio will require. For example, using the thread library, it will
need libboost_thread*-sgd*
Yet the non-static-runtime versions are what are searched first, so it only
finds libboost_thread*-gd*, and visual studio will give you a link error.
The reason is that on lines 718 - 738 of findboost.cmake, it defines the
NAMES of the boost_STATIC_TAG after it already lists the same version
without the boost_STATIC_TAG.
So what needs to be done is instead of
FIND_LIBRARY(Boost_${UPPERCOMPONENT}_LIBRARY_RELEASE
${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}-${Boost_LIB_VERSION}
NAMES
${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}${_boost_STATIC_TAG}-${Boost_LIB_VERSION}
${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}-${Boost_LIB_VERSION}
${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}${_boost_STATIC_TAG}-${Boost_LIB_VERSION}
${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}
${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}${_boost_STATIC_TAG}
${Boost_LIB_PREFIX}boost_${COMPONENT}
HINTS ${_boost_LIBRARIES_SEARCH_DIRS}
)
it should be
FIND_LIBRARY(Boost_${UPPERCOMPONENT}_LIBRARY_RELEASE
NAMES
${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}${_boost_STATIC_TAG}-${Boost_LIB_VERSION}
${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}-${Boost_LIB_VERSION}
${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}${_boost_STATIC_TAG}-${Boost_LIB_VERSION}
${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}-${Boost_LIB_VERSION}
${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}${_boost_STATIC_TAG}
${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}
${Boost_LIB_PREFIX}boost_${COMPONENT}
HINTS ${_boost_LIBRARIES_SEARCH_DIRS}
)
Anybody know who the maintainer is??
-assumeR
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20101006/282df9a8/attachment-0001.htm>
More information about the CMake
mailing list