Merge topic 'FindBoost_bugfixes'

b8b9a32 FindBoost.cmake: Fix library search path glitch introduced in earlier commit
90c16d8 FindBoost.cmake: Implements 11160
95ff120 FindBoost.cmake: Fixes 10436
5cce138 FindBoost.cmake: Fixes 11121
0239041 FindBoost.cmake: Fixes 11246
d4900c2 FindBoost.cmake: Fix compiling against a boost source tree
6ed7d99 FindBoost.cmake: Add Boost_NO_SYSTEM_PATHS option
16b0eb5 FindBoost.cmake: Miscellaneous changes and refactoring
5e6f0f0 FindBoost.cmake fixes for issues 11204 & 8529
This commit is contained in:
Brad King 2010-09-21 10:53:57 -04:00 committed by CMake Topic Stage
commit 5970c0f947

View File

@ -17,8 +17,10 @@
# #
# == Using actual libraries from within Boost: == # == Using actual libraries from within Boost: ==
# #
# set(Boost_USE_STATIC_LIBS ON) # set(Boost_USE_STATIC_LIBS ON)
# set(Boost_USE_MULTITHREADED ON) # set(Boost_USE_MULTITHREADED ON)
# set(Boost_USE_STATIC_RUNTIME OFF)
# set(Boost_COMPAT_STATIC_RUNTIME OFF)
# find_package( Boost 1.36.0 COMPONENTS date_time filesystem system ... ) # find_package( Boost 1.36.0 COMPONENTS date_time filesystem system ... )
# #
# if(Boost_FOUND) # if(Boost_FOUND)
@ -84,6 +86,42 @@
# Boost_USE_STATIC_LIBS Can be set to ON to force the use of the static # Boost_USE_STATIC_LIBS Can be set to ON to force the use of the static
# boost libraries. Defaults to OFF. # boost libraries. Defaults to OFF.
# #
# Boost_NO_SYSTEM_PATHS Set to TRUE to suppress searching in system
# paths (or other locations outside of BOOST_ROOT
# or BOOST_INCLUDEDIR). Useful when specifying
# BOOST_ROOT. Defaults to OFF.
# [Since CMake 2.8.3]
#
# Boost_USE_STATIC_RUNTIME If enabled, searches for boost libraries
# linked against a static C++ standard library
# ('s' ABI tag). Defaults to OFF.
# [Since CMake 2.8.3]
#
# Boost_USE_DEBUG_PYTHON If enabled, searches for boost libraries
# compiled against a special debug build of
# Python ('y' ABI tag). Defaults to OFF.
# [Since CMake 2.8.3]
#
# Boost_USE_STLPORT If enabled, searches for boost libraries
# compiled against the STLPort standard
# library ('p' ABI tag). Defaults to OFF.
# [Since CMake 2.8.3]
#
# Boost_USE_STLPORT_DEPRECATED_NATIVE_IOSTREAMS
# If enabled, searches for boost libraries
# compiled against the deprecated STLPort
# "native iostreams" feature ('n' ABI tag).
# Defaults to OFF.
# [Since CMake 2.8.3]
#
# Boost_COMPAT_STATIC_RUNTIME Set to OFF to disable backwards compatible
# searching for libraries with the 's' ABI
# tag on WIN32 after normal searches. You
# should set this to OFF and also set
# Boost_USE_STATIC_RUNTIME appropriately.
# If not specified, defaults to ON.
# [Since CMake 2.8.3]
#
# Other Variables used by this module which you may want to set. # Other Variables used by this module which you may want to set.
# #
# Boost_ADDITIONAL_VERSIONS A list of version numbers to use for searching # Boost_ADDITIONAL_VERSIONS A list of version numbers to use for searching
@ -105,12 +143,38 @@
# Boost_COMPILER Set this to the compiler suffix used by Boost # Boost_COMPILER Set this to the compiler suffix used by Boost
# (e.g. "-gcc43") if FindBoost has problems finding # (e.g. "-gcc43") if FindBoost has problems finding
# the proper Boost installation # the proper Boost installation
#
# Boost_THREADAPI When building boost.thread, sometimes the name of the
# library contains an additional "pthread" or "win32"
# string known as the threadapi. This can happen when
# compiling against pthreads on Windows or win32 threads
# on Cygwin. You may specify this variable and if set
# when FindBoost searches for the Boost threading library
# it will first try to match the threadapi you specify.
# For Example: libboost_thread_win32-mgw45-mt-1_43.a
# 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]
#
# #
# These last three variables are available also as environment variables: # These last three variables are available also as environment variables:
# #
# BOOST_ROOT or BOOSTROOT The preferred installation prefix for searching for # BOOST_ROOT or BOOSTROOT The preferred installation prefix for searching for
# Boost. Set this if the module has problems finding # Boost. Set this if the module has problems finding
# the proper Boost installation. # the proper Boost installation. To prevent falling
# back on the system paths, set Boost_NO_SYSTEM_PATHS
# to true.
# #
# BOOST_INCLUDEDIR Set this to the include directory of Boost, if the # BOOST_INCLUDEDIR Set this to the include directory of Boost, if the
# module has problems finding the proper Boost installation # module has problems finding the proper Boost installation
@ -165,7 +229,7 @@
# Copyright 2007 Wengo # Copyright 2007 Wengo
# Copyright 2007 Mike Jackson # Copyright 2007 Mike Jackson
# Copyright 2008 Andreas Pakulat <apaku@gmx.de> # Copyright 2008 Andreas Pakulat <apaku@gmx.de>
# Copyright 2008-2009 Philip Lowman <philip@yhbt.com> # Copyright 2008-2010 Philip Lowman <philip@yhbt.com>
# #
# Distributed under the OSI-approved BSD License (the "License"); # Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details. # see accompanying file Copyright.txt for details.
@ -275,6 +339,28 @@ function(_Boost_MARK_COMPONENTS_FOUND _yes_or_no)
endforeach() endforeach()
endfunction() endfunction()
#
# Take a list of libraries with "thread" in it
# and prepend duplicates with "thread_${Boost_THREADAPI}"
# at the front of the list
#
function(_Boost_PREPEND_LIST_WITH_THREADAPI _output)
set(_orig_libnames ${ARGN})
string(REPLACE "thread" "thread_${Boost_THREADAPI}" _threadapi_libnames ${_orig_libnames})
set(${_output} ${_threadapi_libnames} ${_orig_libnames} PARENT_SCOPE)
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 # End functions/macros
# #
@ -286,6 +372,9 @@ endfunction()
IF(NOT DEFINED Boost_USE_MULTITHREADED) IF(NOT DEFINED Boost_USE_MULTITHREADED)
SET(Boost_USE_MULTITHREADED TRUE) SET(Boost_USE_MULTITHREADED TRUE)
ENDIF() ENDIF()
if(NOT DEFINED Boost_COMPAT_STATIC_RUNTIME)
set(Boost_COMPAT_STATIC_RUNTIME TRUE)
endif()
if(Boost_FIND_VERSION_EXACT) if(Boost_FIND_VERSION_EXACT)
# The version may appear in a directory with or without the patch # The version may appear in a directory with or without the patch
@ -366,7 +455,7 @@ IF (_boost_IN_CACHE)
if(Boost_DEBUG) if(Boost_DEBUG)
message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
"boost ${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION} " "boost ${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION} "
"is already in the cache. For debugging messages, please clear the cache.") "is already in the cache. To view debugging messages, please clear the cache.")
endif() endif()
ELSE (_boost_IN_CACHE) ELSE (_boost_IN_CACHE)
# Need to search for boost # Need to search for boost
@ -380,6 +469,12 @@ ELSE (_boost_IN_CACHE)
"Boost_USE_MULTITHREADED = ${Boost_USE_MULTITHREADED}") "Boost_USE_MULTITHREADED = ${Boost_USE_MULTITHREADED}")
message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
"Boost_USE_STATIC_LIBS = ${Boost_USE_STATIC_LIBS}") "Boost_USE_STATIC_LIBS = ${Boost_USE_STATIC_LIBS}")
message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
"Boost_USE_STATIC_RUNTIME = ${Boost_USE_STATIC_RUNTIME}")
message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
"Boost_ADDITIONAL_VERSIONS = ${Boost_ADDITIONAL_VERSIONS}")
message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
"Boost_NO_SYSTEM_PATHS = ${Boost_NO_SYSTEM_PATHS}")
endif() endif()
IF(WIN32) IF(WIN32)
@ -404,7 +499,7 @@ ELSE (_boost_IN_CACHE)
"-DBOOST_LIB_DIAGNOSTIC" CACHE STRING "Boost diagnostic define") "-DBOOST_LIB_DIAGNOSTIC" CACHE STRING "Boost diagnostic define")
ENDIF(WIN32) ENDIF(WIN32)
SET(_boost_INCLUDE_SEARCH_DIRS set(_boost_INCLUDE_SEARCH_DIRS_SYSTEM
C:/boost/include C:/boost/include
C:/boost C:/boost
"$ENV{ProgramFiles}/boost/include" "$ENV{ProgramFiles}/boost/include"
@ -412,6 +507,13 @@ ELSE (_boost_IN_CACHE)
/sw/local/include /sw/local/include
) )
# If Boost_ROOT was defined, gently correct the user
if(Boost_ROOT)
message("WARNING: Boost_ROOT was set which is incorrect and is being ignored. "
"You need to use BOOST_ROOT instead. "
"Also, we suggest setting Boost_NO_SYSTEM_PATHS.")
endif()
# If BOOST_ROOT was defined in the environment, use it. # If BOOST_ROOT was defined in the environment, use it.
if (NOT BOOST_ROOT AND NOT $ENV{BOOST_ROOT} STREQUAL "") if (NOT BOOST_ROOT AND NOT $ENV{BOOST_ROOT} STREQUAL "")
set(BOOST_ROOT $ENV{BOOST_ROOT}) set(BOOST_ROOT $ENV{BOOST_ROOT})
@ -449,18 +551,25 @@ ELSE (_boost_IN_CACHE)
"_boost_TEST_VERSIONS = ${_boost_TEST_VERSIONS}") "_boost_TEST_VERSIONS = ${_boost_TEST_VERSIONS}")
endif() endif()
IF( BOOST_ROOT ) if( Boost_NO_SYSTEM_PATHS)
SET(_boost_INCLUDE_SEARCH_DIRS set(_boost_FIND_OPTIONS NO_CMAKE_SYSTEM_PATH)
${BOOST_ROOT}/include else()
set(_boost_INCLUDE_SEARCH_DIRS ${_boost_INCLUDE_SEARCH_DIRS_SYSTEM})
endif()
if( BOOST_ROOT )
set(_boost_INCLUDE_SEARCH_DIRS
${BOOST_ROOT}/include
${BOOST_ROOT} ${BOOST_ROOT}
${_boost_INCLUDE_SEARCH_DIRS}) ${_boost_INCLUDE_SEARCH_DIRS})
ENDIF( BOOST_ROOT ) endif()
IF( BOOST_INCLUDEDIR ) # prepend BOOST_INCLUDEDIR to search path if specified
if( BOOST_INCLUDEDIR )
file(TO_CMAKE_PATH ${BOOST_INCLUDEDIR} BOOST_INCLUDEDIR) file(TO_CMAKE_PATH ${BOOST_INCLUDEDIR} BOOST_INCLUDEDIR)
SET(_boost_INCLUDE_SEARCH_DIRS set(_boost_INCLUDE_SEARCH_DIRS
${BOOST_INCLUDEDIR} ${_boost_INCLUDE_SEARCH_DIRS}) ${BOOST_INCLUDEDIR} ${_boost_INCLUDE_SEARCH_DIRS})
ENDIF( BOOST_INCLUDEDIR ) endif( BOOST_INCLUDEDIR )
# ------------------------------------------------------------------------ # ------------------------------------------------------------------------
# Search for Boost include DIR # Search for Boost include DIR
@ -486,10 +595,7 @@ ELSE (_boost_IN_CACHE)
ENDIF() ENDIF()
list(APPEND _boost_PATH_SUFFIXES "boost-${_boost_BOOSTIFIED_VERSION}") list(APPEND _boost_PATH_SUFFIXES "boost-${_boost_BOOSTIFIED_VERSION}")
if(WIN32) list(APPEND _boost_PATH_SUFFIXES "boost_${_boost_BOOSTIFIED_VERSION}")
# For BoostPro's underscores (and others?)
list(APPEND _boost_PATH_SUFFIXES "boost_${_boost_BOOSTIFIED_VERSION}")
endif()
ENDFOREACH(_boost_VER) ENDFOREACH(_boost_VER)
@ -507,6 +613,7 @@ ELSE (_boost_IN_CACHE)
NAMES boost/config.hpp NAMES boost/config.hpp
HINTS ${_boost_INCLUDE_SEARCH_DIRS} HINTS ${_boost_INCLUDE_SEARCH_DIRS}
PATH_SUFFIXES ${_boost_PATH_SUFFIXES} PATH_SUFFIXES ${_boost_PATH_SUFFIXES}
${_boost_FIND_OPTIONS}
) )
ENDIF( NOT Boost_INCLUDE_DIR ) ENDIF( NOT Boost_INCLUDE_DIR )
@ -637,7 +744,7 @@ ELSE (_boost_IN_CACHE)
endif() endif()
endif(Boost_COMPILER) endif(Boost_COMPILER)
SET (_boost_MULTITHREADED "-mt") set (_boost_MULTITHREADED "-mt")
if( NOT Boost_USE_MULTITHREADED ) if( NOT Boost_USE_MULTITHREADED )
set (_boost_MULTITHREADED "") set (_boost_MULTITHREADED "")
endif() endif()
@ -646,32 +753,67 @@ ELSE (_boost_IN_CACHE)
"_boost_MULTITHREADED = ${_boost_MULTITHREADED}") "_boost_MULTITHREADED = ${_boost_MULTITHREADED}")
endif() endif()
SET( _boost_STATIC_TAG "") #======================
set( _boost_ABI_TAG "") # Systematically build up the Boost ABI tag
IF (WIN32) # http://boost.org/doc/libs/1_41_0/more/getting_started/windows.html#library-naming
IF(MSVC OR "${CMAKE_CXX_COMPILER}" MATCHES "icl" set( _boost_RELEASE_ABI_TAG "-")
set( _boost_DEBUG_ABI_TAG "-")
# Key Use this library when:
# s linking statically to the C++ standard library and
# compiler runtime support libraries.
if(Boost_USE_STATIC_RUNTIME)
set( _boost_RELEASE_ABI_TAG "${_boost_RELEASE_ABI_TAG}s")
set( _boost_DEBUG_ABI_TAG "${_boost_DEBUG_ABI_TAG}s")
endif()
# g using debug versions of the standard and runtime
# support libraries
if(WIN32)
if(MSVC OR "${CMAKE_CXX_COMPILER}" MATCHES "icl"
OR "${CMAKE_CXX_COMPILER}" MATCHES "icpc") OR "${CMAKE_CXX_COMPILER}" MATCHES "icpc")
SET (_boost_ABI_TAG "g") set(_boost_DEBUG_ABI_TAG "${_boost_DEBUG_ABI_TAG}g")
ENDIF() endif()
IF( Boost_USE_STATIC_LIBS ) endif()
SET( _boost_STATIC_TAG "-s") # y using special debug build of python
ENDIF( Boost_USE_STATIC_LIBS ) if(Boost_USE_DEBUG_PYTHON)
ENDIF(WIN32) set(_boost_DEBUG_ABI_TAG "${_boost_DEBUG_ABI_TAG}y")
SET (_boost_ABI_TAG "${_boost_ABI_TAG}d") endif()
# d using a debug version of your code
set(_boost_DEBUG_ABI_TAG "${_boost_DEBUG_ABI_TAG}d")
# p using the STLport standard library rather than the
# default one supplied with your compiler
if(Boost_USE_STLPORT)
set( _boost_RELEASE_ABI_TAG "${_boost_RELEASE_ABI_TAG}p")
set( _boost_DEBUG_ABI_TAG "${_boost_DEBUG_ABI_TAG}p")
endif()
# n using the STLport deprecated "native iostreams" feature
if(Boost_USE_STLPORT_DEPRECATED_NATIVE_IOSTREAMS)
set( _boost_RELEASE_ABI_TAG "${_boost_RELEASE_ABI_TAG}n")
set( _boost_DEBUG_ABI_TAG "${_boost_DEBUG_ABI_TAG}n")
endif()
if(Boost_DEBUG) if(Boost_DEBUG)
message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
"_boost_STATIC_TAG = ${_boost_STATIC_TAG}") "_boost_RELEASE_ABI_TAG = ${_boost_RELEASE_ABI_TAG}")
message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
"_boost_ABI_TAG = ${_boost_ABI_TAG}") "_boost_DEBUG_ABI_TAG = ${_boost_DEBUG_ABI_TAG}")
endif() endif()
# ------------------------------------------------------------------------ # ------------------------------------------------------------------------
# Begin finding boost libraries # Begin finding boost libraries
# ------------------------------------------------------------------------ # ------------------------------------------------------------------------
SET(_boost_LIBRARIES_SEARCH_DIRS if(BOOST_ROOT)
set(_boost_LIBRARY_SEARCH_DIRS_ALWAYS
${BOOST_ROOT}/lib
${BOOST_ROOT}/stage/lib)
endif()
set(_boost_LIBRARY_SEARCH_DIRS_ALWAYS
${_boost_LIBRARY_SEARCH_DIRS_ALWAYS}
${Boost_INCLUDE_DIR}/lib ${Boost_INCLUDE_DIR}/lib
${Boost_INCLUDE_DIR}/../lib ${Boost_INCLUDE_DIR}/../lib
${Boost_INCLUDE_DIR}/stage/lib
)
set(_boost_LIBRARY_SEARCH_DIRS_SYSTEM
C:/boost/lib C:/boost/lib
C:/boost C:/boost
"$ENV{ProgramFiles}/boost/boost_${Boost_MAJOR_VERSION}_${Boost_MINOR_VERSION}_${Boost_SUBMINOR_VERSION}/lib" "$ENV{ProgramFiles}/boost/boost_${Boost_MAJOR_VERSION}_${Boost_MINOR_VERSION}_${Boost_SUBMINOR_VERSION}/lib"
@ -680,67 +822,146 @@ ELSE (_boost_IN_CACHE)
"$ENV{ProgramFiles}/boost" "$ENV{ProgramFiles}/boost"
/sw/local/lib /sw/local/lib
) )
IF( BOOST_ROOT ) set(_boost_LIBRARY_SEARCH_DIRS ${_boost_LIBRARY_SEARCH_DIRS_ALWAYS})
SET(_boost_LIBRARIES_SEARCH_DIRS if( Boost_NO_SYSTEM_PATHS )
${BOOST_ROOT}/lib set(_boost_FIND_OPTIONS NO_CMAKE_SYSTEM_PATH)
${BOOST_ROOT}/stage/lib else()
${_boost_LIBRARIES_SEARCH_DIRS}) list(APPEND _boost_LIBRARY_SEARCH_DIRS ${_boost_LIBRARY_SEARCH_DIRS_SYSTEM})
ENDIF( BOOST_ROOT ) endif()
IF( BOOST_LIBRARYDIR ) # prepend BOOST_LIBRARYDIR to search path if specified
if( BOOST_LIBRARYDIR )
file(TO_CMAKE_PATH ${BOOST_LIBRARYDIR} BOOST_LIBRARYDIR) file(TO_CMAKE_PATH ${BOOST_LIBRARYDIR} BOOST_LIBRARYDIR)
SET(_boost_LIBRARIES_SEARCH_DIRS set(_boost_LIBRARY_SEARCH_DIRS
${BOOST_LIBRARYDIR} ${_boost_LIBRARIES_SEARCH_DIRS}) ${BOOST_LIBRARYDIR} ${_boost_LIBRARY_SEARCH_DIRS})
ENDIF( BOOST_LIBRARYDIR ) endif()
if(Boost_DEBUG) if(Boost_DEBUG)
message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
"_boost_LIBRARIES_SEARCH_DIRS = ${_boost_LIBRARIES_SEARCH_DIRS}") "_boost_LIBRARY_SEARCH_DIRS = ${_boost_LIBRARY_SEARCH_DIRS}")
endif() endif()
FOREACH(COMPONENT ${Boost_FIND_COMPONENTS}) # Support preference of static libs by adjusting CMAKE_FIND_LIBRARY_SUFFIXES
STRING(TOUPPER ${COMPONENT} UPPERCOMPONENT) if( Boost_USE_STATIC_LIBS )
SET( Boost_${UPPERCOMPONENT}_LIBRARY "Boost_${UPPERCOMPONENT}_LIBRARY-NOTFOUND" ) set( _boost_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})
SET( Boost_${UPPERCOMPONENT}_LIBRARY_RELEASE "Boost_${UPPERCOMPONENT}_LIBRARY_RELEASE-NOTFOUND" ) if(WIN32)
SET( Boost_${UPPERCOMPONENT}_LIBRARY_DEBUG "Boost_${UPPERCOMPONENT}_LIBRARY_DEBUG-NOTFOUND") set(CMAKE_FIND_LIBRARY_SUFFIXES .lib .a ${CMAKE_FIND_LIBRARY_SUFFIXES})
else()
set(CMAKE_FIND_LIBRARY_SUFFIXES .a )
endif()
endif()
# Support preference of static libs by adjusting CMAKE_FIND_LIBRARY_SUFFIXES # We want to use the tag inline below without risking double dashes
IF( Boost_USE_STATIC_LIBS ) if(_boost_RELEASE_ABI_TAG)
SET( _boost_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES}) if(${_boost_RELEASE_ABI_TAG} STREQUAL "-")
IF(WIN32) set(_boost_RELEASE_ABI_TAG "")
SET(CMAKE_FIND_LIBRARY_SUFFIXES .lib .a ${CMAKE_FIND_LIBRARY_SUFFIXES}) endif()
ELSE(WIN32) endif()
SET(CMAKE_FIND_LIBRARY_SUFFIXES .a ${CMAKE_FIND_LIBRARY_SUFFIXES}) if(_boost_DEBUG_ABI_TAG)
ENDIF(WIN32) if(${_boost_DEBUG_ABI_TAG} STREQUAL "-")
ENDIF( Boost_USE_STATIC_LIBS ) set(_boost_DEBUG_ABI_TAG "")
endif()
endif()
FIND_LIBRARY(Boost_${UPPERCOMPONENT}_LIBRARY_RELEASE # The previous behavior of FindBoost when Boost_USE_STATIC_LIBS was enabled
NAMES ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}-${Boost_LIB_VERSION} # on WIN32 was to:
${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}${_boost_STATIC_TAG}-${Boost_LIB_VERSION} # 1. Search for static libs compiled against a SHARED C++ standard runtime library (use if found)
${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}-${Boost_LIB_VERSION} # 2. Search for static libs compiled against a STATIC C++ standard runtime library (use if found)
${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}${_boost_STATIC_TAG}-${Boost_LIB_VERSION} # We maintain this behavior since changing it could break people's builds.
${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED} # To disable the ambiguous behavior, the user can
${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}${_boost_STATIC_TAG} # set Boost_COMPAT_STATIC_RUNTIME to FALSE
${Boost_LIB_PREFIX}boost_${COMPONENT} set(_boost_STATIC_RUNTIME_WORKAROUND false)
HINTS ${_boost_LIBRARIES_SEARCH_DIRS} if(Boost_COMPAT_STATIC_RUNTIME AND WIN32 AND Boost_USE_STATIC_LIBS)
if(NOT Boost_USE_STATIC_RUNTIME)
set(_boost_STATIC_RUNTIME_WORKAROUND true)
endif()
endif()
foreach(COMPONENT ${Boost_FIND_COMPONENTS})
string(TOUPPER ${COMPONENT} UPPERCOMPONENT)
set( Boost_${UPPERCOMPONENT}_LIBRARY "Boost_${UPPERCOMPONENT}_LIBRARY-NOTFOUND" )
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
#
set(_boost_RELEASE_NAMES
${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}${_boost_RELEASE_ABI_TAG}-${Boost_LIB_VERSION}
${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}${_boost_RELEASE_ABI_TAG}
${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}${_boost_RELEASE_ABI_TAG}-${Boost_LIB_VERSION}
${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}${_boost_RELEASE_ABI_TAG}
${Boost_LIB_PREFIX}boost_${COMPONENT} )
if(_boost_STATIC_RUNTIME_WORKAROUND)
set(_boost_RELEASE_STATIC_ABI_TAG "-s${_boost_RELEASE_ABI_TAG}")
list(APPEND _boost_RELEASE_NAMES
${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}${_boost_RELEASE_STATIC_ABI_TAG}-${Boost_LIB_VERSION}
${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}${_boost_RELEASE_STATIC_ABI_TAG}
${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}${_boost_RELEASE_STATIC_ABI_TAG}-${Boost_LIB_VERSION}
${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}${_boost_RELEASE_STATIC_ABI_TAG} )
endif()
if(Boost_THREADAPI AND ${COMPONENT} STREQUAL "thread")
_Boost_PREPEND_LIST_WITH_THREADAPI(_boost_RELEASE_NAMES ${_boost_RELEASE_NAMES})
endif()
if(Boost_DEBUG)
message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
"Searching for ${UPPERCOMPONENT}_LIBRARY_RELEASE: ${_boost_RELEASE_NAMES}")
endif()
find_library(Boost_${UPPERCOMPONENT}_LIBRARY_RELEASE
NAMES ${_boost_RELEASE_NAMES}
HINTS ${_boost_LIBRARY_SEARCH_DIRS}
${_boost_FIND_OPTIONS}
DOC "${_boost_docstring_release}"
) )
FIND_LIBRARY(Boost_${UPPERCOMPONENT}_LIBRARY_DEBUG #
NAMES ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}-${_boost_ABI_TAG}-${Boost_LIB_VERSION} # Find DEBUG libraries
${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}${_boost_STATIC_TAG}${_boost_ABI_TAG}-${Boost_LIB_VERSION} #
${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}-${_boost_ABI_TAG}-${Boost_LIB_VERSION} set(_boost_DEBUG_NAMES
${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}${_boost_STATIC_TAG}${_boost_ABI_TAG}-${Boost_LIB_VERSION} ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}${_boost_DEBUG_ABI_TAG}-${Boost_LIB_VERSION}
${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}-${_boost_ABI_TAG} ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}${_boost_DEBUG_ABI_TAG}
${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}${_boost_STATIC_TAG}${_boost_ABI_TAG} ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}${_boost_DEBUG_ABI_TAG}-${Boost_LIB_VERSION}
${Boost_LIB_PREFIX}boost_${COMPONENT}-${_boost_ABI_TAG} ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}
HINTS ${_boost_LIBRARIES_SEARCH_DIRS} ${Boost_LIB_PREFIX}boost_${COMPONENT} )
if(_boost_STATIC_RUNTIME_WORKAROUND)
set(_boost_DEBUG_STATIC_ABI_TAG "-s${_boost_DEBUG_ABI_TAG}")
list(APPEND _boost_DEBUG_NAMES
${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}${_boost_DEBUG_STATIC_ABI_TAG}-${Boost_LIB_VERSION}
${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}${_boost_DEBUG_STATIC_ABI_TAG}
${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}${_boost_DEBUG_STATIC_ABI_TAG}-${Boost_LIB_VERSION}
${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}${_boost_DEBUG_STATIC_ABI_TAG} )
endif()
if(Boost_THREADAPI AND ${COMPONENT} STREQUAL "thread")
_Boost_PREPEND_LIST_WITH_THREADAPI(_boost_DEBUG_NAMES ${_boost_DEBUG_NAMES})
endif()
if(Boost_DEBUG)
message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
"Searching for ${UPPERCOMPONENT}_LIBRARY_DEBUG: ${_boost_DEBUG_NAMES}")
endif()
find_library(Boost_${UPPERCOMPONENT}_LIBRARY_DEBUG
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}) _Boost_ADJUST_LIB_VARS(${UPPERCOMPONENT})
IF( Boost_USE_STATIC_LIBS )
SET(CMAKE_FIND_LIBRARY_SUFFIXES ${_boost_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES}) endforeach(COMPONENT)
ENDIF( Boost_USE_STATIC_LIBS )
ENDFOREACH(COMPONENT) # Restore the original find library ordering
if( Boost_USE_STATIC_LIBS )
set(CMAKE_FIND_LIBRARY_SUFFIXES ${_boost_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES})
endif()
# ------------------------------------------------------------------------ # ------------------------------------------------------------------------
# End finding boost libraries # End finding boost libraries
# ------------------------------------------------------------------------ # ------------------------------------------------------------------------