diff options
author | Philip Lowman <philip@yhbt.com> | 2010-09-18 15:57:42 (GMT) |
---|---|---|
committer | Philip Lowman <philip@yhbt.com> | 2010-09-18 15:57:42 (GMT) |
commit | 90c16d84bee64719d4bf3c4c2ee561a8dec54b3c (patch) | |
tree | 1691bd739e4ba14a8a92d3d8103c62aee2cfcb45 /Modules/FindBoost.cmake | |
parent | 95ff12091dd1bfed6207021c1a64803c9fcc5e44 (diff) | |
download | CMake-90c16d84bee64719d4bf3c4c2ee561a8dec54b3c.zip CMake-90c16d84bee64719d4bf3c4c2ee561a8dec54b3c.tar.gz CMake-90c16d84bee64719d4bf3c4c2ee561a8dec54b3c.tar.bz2 |
FindBoost.cmake: Implements 11160
Add Boost_REALPATH option for people packaging Boost with their app:
Boost_REALPATH Resolves symbolic links for discovered boost libraries
to assist with packaging. For example, instead of
Boost_SYSTEM_LIBRARY_RELEASE being resolved to
"/usr/lib/libboost_system.so" it would be
"/usr/lib/libboost_system.so.1.42.0" instead.
This does not affect linking and should not be
enabled unless the user needs this information.
Diffstat (limited to 'Modules/FindBoost.cmake')
-rw-r--r-- | Modules/FindBoost.cmake | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/Modules/FindBoost.cmake b/Modules/FindBoost.cmake index ff3e17b..7acd31a 100644 --- a/Modules/FindBoost.cmake +++ b/Modules/FindBoost.cmake @@ -155,7 +155,16 @@ # might be found if you specified "win32" here before # falling back on libboost_thread-mgw45-mt-1_43.a. # [Since CMake 2.8.3] - +# +# Boost_REALPATH Resolves symbolic links for discovered boost libraries +# to assist with packaging. For example, instead of +# Boost_SYSTEM_LIBRARY_RELEASE being resolved to +# "/usr/lib/libboost_system.so" it would be +# "/usr/lib/libboost_system.so.1.42.0" instead. +# This does not affect linking and should not be +# enabled unless the user needs this information. +# [Since CMake 2.8.3] +# # @@ -342,6 +351,17 @@ function(_Boost_PREPEND_LIST_WITH_THREADAPI _output) endfunction() # +# If a library is found, replace its cache entry with its REALPATH +# +function(_Boost_SWAP_WITH_REALPATH _library _docstring) + if(${_library}) + get_filename_component(_boost_filepathreal ${${_library}} REALPATH) + unset(${_library} CACHE) + set(${_library} ${_boost_filepathreal} CACHE FILEPATH "${_docstring}") + endif() +endfunction() + +# # End functions/macros # #------------------------------------------------------------------------------- @@ -863,6 +883,9 @@ ELSE (_boost_IN_CACHE) set( Boost_${UPPERCOMPONENT}_LIBRARY_RELEASE "Boost_${UPPERCOMPONENT}_LIBRARY_RELEASE-NOTFOUND" ) set( Boost_${UPPERCOMPONENT}_LIBRARY_DEBUG "Boost_${UPPERCOMPONENT}_LIBRARY_DEBUG-NOTFOUND") + set( _boost_docstring_release "Boost ${COMPONENT} library (release)") + set( _boost_docstring_debug "Boost ${COMPONENT} library (debug)") + # # Find RELEASE libraries # @@ -891,6 +914,7 @@ ELSE (_boost_IN_CACHE) NAMES ${_boost_RELEASE_NAMES} HINTS ${_boost_LIBRARY_SEARCH_DIRS} ${_boost_FIND_OPTIONS} + DOC "${_boost_docstring_release}" ) # @@ -921,9 +945,16 @@ ELSE (_boost_IN_CACHE) NAMES ${_boost_DEBUG_NAMES} HINTS ${_boost_LIBRARY_SEARCH_DIRS} ${_boost_FIND_OPTIONS} + DOC "${_boost_docstring_debug}" ) + if(Boost_REALPATH) + _Boost_SWAP_WITH_REALPATH(Boost_${UPPERCOMPONENT}_LIBRARY_RELEASE "${_boost_docstring_release}") + _Boost_SWAP_WITH_REALPATH(Boost_${UPPERCOMPONENT}_LIBRARY_DEBUG "${_boost_docstring_debug}" ) + endif() + _Boost_ADJUST_LIB_VARS(${UPPERCOMPONENT}) + endforeach(COMPONENT) # Restore the original find library ordering |