FindBoost: Remove extra indentation level

A large portion of the file was still indented for historical reasons.
This commit is contained in:
Brad King 2012-09-24 11:08:51 -04:00
parent 66759eea5e
commit 531612d370

View File

@ -561,7 +561,7 @@ endif()
# Boost. # Boost.
set(Boost_ERROR_REASON) set(Boost_ERROR_REASON)
if(Boost_DEBUG) if(Boost_DEBUG)
# Output some of their choices # Output some of their choices
message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
"_boost_TEST_VERSIONS = ${_boost_TEST_VERSIONS}") "_boost_TEST_VERSIONS = ${_boost_TEST_VERSIONS}")
@ -575,9 +575,9 @@ set(Boost_ERROR_REASON)
"Boost_ADDITIONAL_VERSIONS = ${Boost_ADDITIONAL_VERSIONS}") "Boost_ADDITIONAL_VERSIONS = ${Boost_ADDITIONAL_VERSIONS}")
message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
"Boost_NO_SYSTEM_PATHS = ${Boost_NO_SYSTEM_PATHS}") "Boost_NO_SYSTEM_PATHS = ${Boost_NO_SYSTEM_PATHS}")
endif() endif()
if(WIN32) if(WIN32)
# In windows, automatic linking is performed, so you do not have # In windows, automatic linking is performed, so you do not have
# to specify the libraries. If you are linking to a dynamic # to specify the libraries. If you are linking to a dynamic
# runtime, then you can choose to link to either a static or a # runtime, then you can choose to link to either a static or a
@ -597,50 +597,50 @@ set(Boost_ERROR_REASON)
# for linking. # for linking.
set(Boost_LIB_DIAGNOSTIC_DEFINITIONS set(Boost_LIB_DIAGNOSTIC_DEFINITIONS
"-DBOOST_LIB_DIAGNOSTIC" CACHE STRING "Boost diagnostic define") "-DBOOST_LIB_DIAGNOSTIC" CACHE STRING "Boost diagnostic define")
endif() endif()
set(_boost_INCLUDE_SEARCH_DIRS_SYSTEM set(_boost_INCLUDE_SEARCH_DIRS_SYSTEM
C:/boost/include C:/boost/include
C:/boost C:/boost
"$ENV{ProgramFiles}/boost/include" "$ENV{ProgramFiles}/boost/include"
"$ENV{ProgramFiles}/boost" "$ENV{ProgramFiles}/boost"
/sw/local/include /sw/local/include
) )
_Boost_CHECK_SPELLING(Boost_ROOT) _Boost_CHECK_SPELLING(Boost_ROOT)
_Boost_CHECK_SPELLING(Boost_LIBRARYDIR) _Boost_CHECK_SPELLING(Boost_LIBRARYDIR)
_Boost_CHECK_SPELLING(Boost_INCLUDEDIR) _Boost_CHECK_SPELLING(Boost_INCLUDEDIR)
# 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_DIR} STREQUAL "") if (NOT BOOST_ROOT AND NOT $ENV{Boost_DIR} STREQUAL "")
set(BOOST_ROOT $ENV{Boost_DIR}) set(BOOST_ROOT $ENV{Boost_DIR})
endif() 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})
endif() endif()
# If BOOSTROOT was defined in the environment, use it. # If BOOSTROOT was defined in the environment, use it.
if (NOT BOOST_ROOT AND NOT $ENV{BOOSTROOT} STREQUAL "") if (NOT BOOST_ROOT AND NOT $ENV{BOOSTROOT} STREQUAL "")
set(BOOST_ROOT $ENV{BOOSTROOT}) set(BOOST_ROOT $ENV{BOOSTROOT})
endif() endif()
# If BOOST_INCLUDEDIR was defined in the environment, use it. # If BOOST_INCLUDEDIR was defined in the environment, use it.
if( NOT $ENV{BOOST_INCLUDEDIR} STREQUAL "" ) if( NOT $ENV{BOOST_INCLUDEDIR} STREQUAL "" )
set(BOOST_INCLUDEDIR $ENV{BOOST_INCLUDEDIR}) set(BOOST_INCLUDEDIR $ENV{BOOST_INCLUDEDIR})
endif() endif()
# If BOOST_LIBRARYDIR was defined in the environment, use it. # If BOOST_LIBRARYDIR was defined in the environment, use it.
if( NOT $ENV{BOOST_LIBRARYDIR} STREQUAL "" ) if( NOT $ENV{BOOST_LIBRARYDIR} STREQUAL "" )
set(BOOST_LIBRARYDIR $ENV{BOOST_LIBRARYDIR}) set(BOOST_LIBRARYDIR $ENV{BOOST_LIBRARYDIR})
endif() endif()
if( BOOST_ROOT ) if( BOOST_ROOT )
file(TO_CMAKE_PATH ${BOOST_ROOT} BOOST_ROOT) file(TO_CMAKE_PATH ${BOOST_ROOT} BOOST_ROOT)
endif() 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} ] "
"Declared as CMake or Environmental Variables:") "Declared as CMake or Environmental Variables:")
message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
@ -651,34 +651,34 @@ set(Boost_ERROR_REASON)
" BOOST_LIBRARYDIR = ${BOOST_LIBRARYDIR}") " BOOST_LIBRARYDIR = ${BOOST_LIBRARYDIR}")
message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
"_boost_TEST_VERSIONS = ${_boost_TEST_VERSIONS}") "_boost_TEST_VERSIONS = ${_boost_TEST_VERSIONS}")
endif() endif()
if( Boost_NO_SYSTEM_PATHS) if( Boost_NO_SYSTEM_PATHS)
set(_boost_FIND_OPTIONS NO_CMAKE_SYSTEM_PATH) set(_boost_FIND_OPTIONS NO_CMAKE_SYSTEM_PATH)
else() else()
set(_boost_INCLUDE_SEARCH_DIRS ${_boost_INCLUDE_SEARCH_DIRS_SYSTEM}) set(_boost_INCLUDE_SEARCH_DIRS ${_boost_INCLUDE_SEARCH_DIRS_SYSTEM})
endif() endif()
if( BOOST_ROOT ) if( BOOST_ROOT )
set(_boost_INCLUDE_SEARCH_DIRS set(_boost_INCLUDE_SEARCH_DIRS
${BOOST_ROOT}/include ${BOOST_ROOT}/include
${BOOST_ROOT} ${BOOST_ROOT}
${_boost_INCLUDE_SEARCH_DIRS}) ${_boost_INCLUDE_SEARCH_DIRS})
endif() endif()
# prepend BOOST_INCLUDEDIR to search path if specified # prepend BOOST_INCLUDEDIR to search path if specified
if( BOOST_INCLUDEDIR ) 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() endif()
# ------------------------------------------------------------------------ # ------------------------------------------------------------------------
# Search for Boost include DIR # Search for Boost include DIR
# ------------------------------------------------------------------------ # ------------------------------------------------------------------------
# Try to find Boost by stepping backwards through the Boost versions # Try to find Boost by stepping backwards through the Boost versions
# we know about. # we know about.
if( NOT Boost_INCLUDE_DIR ) if( NOT Boost_INCLUDE_DIR )
# Build a list of path suffixes for each version. # Build a list of path suffixes for each version.
set(_boost_PATH_SUFFIXES) set(_boost_PATH_SUFFIXES)
foreach(_boost_VER ${_boost_TEST_VERSIONS}) foreach(_boost_VER ${_boost_TEST_VERSIONS})
@ -717,13 +717,13 @@ set(Boost_ERROR_REASON)
PATH_SUFFIXES ${_boost_PATH_SUFFIXES} PATH_SUFFIXES ${_boost_PATH_SUFFIXES}
${_boost_FIND_OPTIONS} ${_boost_FIND_OPTIONS}
) )
endif() endif()
# ------------------------------------------------------------------------ # ------------------------------------------------------------------------
# Extract version information from version.hpp # Extract version information from version.hpp
# ------------------------------------------------------------------------ # ------------------------------------------------------------------------
if(Boost_INCLUDE_DIR) if(Boost_INCLUDE_DIR)
# Extract Boost_VERSION and Boost_LIB_VERSION from version.hpp # Extract Boost_VERSION and Boost_LIB_VERSION from version.hpp
# Read the whole file: # Read the whole file:
# #
@ -755,28 +755,28 @@ set(Boost_ERROR_REASON)
"version.hpp reveals boost " "version.hpp reveals boost "
"${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}") "${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}")
endif() endif()
else() else()
set(Boost_ERROR_REASON set(Boost_ERROR_REASON
"${Boost_ERROR_REASON}Unable to find the Boost header files. Please set BOOST_ROOT to the root directory containing Boost or BOOST_INCLUDEDIR to the directory containing Boost's headers.") "${Boost_ERROR_REASON}Unable to find the Boost header files. Please set BOOST_ROOT to the root directory containing Boost or BOOST_INCLUDEDIR to the directory containing Boost's headers.")
endif() endif()
# ------------------------------------------------------------------------ # ------------------------------------------------------------------------
# Suffix initialization and compiler suffix detection. # Suffix initialization and compiler suffix detection.
# ------------------------------------------------------------------------ # ------------------------------------------------------------------------
# Setting some more suffixes for the library # Setting some more suffixes for the library
set(Boost_LIB_PREFIX "") set(Boost_LIB_PREFIX "")
if ( WIN32 AND Boost_USE_STATIC_LIBS AND NOT CYGWIN) if ( WIN32 AND Boost_USE_STATIC_LIBS AND NOT CYGWIN)
set(Boost_LIB_PREFIX "lib") set(Boost_LIB_PREFIX "lib")
endif() endif()
if (Boost_COMPILER) if (Boost_COMPILER)
set(_boost_COMPILER ${Boost_COMPILER}) set(_boost_COMPILER ${Boost_COMPILER})
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} ] "
"using user-specified Boost_COMPILER = ${_boost_COMPILER}") "using user-specified Boost_COMPILER = ${_boost_COMPILER}")
endif() endif()
else() else()
# Attempt to guess the compiler suffix # Attempt to guess the compiler suffix
# NOTE: this is not perfect yet, if you experience any issues # NOTE: this is not perfect yet, if you experience any issues
# please report them and use the Boost_COMPILER variable # please report them and use the Boost_COMPILER variable
@ -786,78 +786,78 @@ set(Boost_ERROR_REASON)
message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
"guessed _boost_COMPILER = ${_boost_COMPILER}") "guessed _boost_COMPILER = ${_boost_COMPILER}")
endif() endif()
endif() endif()
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()
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_MULTITHREADED = ${_boost_MULTITHREADED}") "_boost_MULTITHREADED = ${_boost_MULTITHREADED}")
endif() endif()
#====================== #======================
# Systematically build up the Boost ABI tag # Systematically build up the Boost ABI tag
# http://boost.org/doc/libs/1_41_0/more/getting_started/windows.html#library-naming # http://boost.org/doc/libs/1_41_0/more/getting_started/windows.html#library-naming
set( _boost_RELEASE_ABI_TAG "-") set( _boost_RELEASE_ABI_TAG "-")
set( _boost_DEBUG_ABI_TAG "-") set( _boost_DEBUG_ABI_TAG "-")
# Key Use this library when: # Key Use this library when:
# s linking statically to the C++ standard library and # s linking statically to the C++ standard library and
# compiler runtime support libraries. # compiler runtime support libraries.
if(Boost_USE_STATIC_RUNTIME) if(Boost_USE_STATIC_RUNTIME)
set( _boost_RELEASE_ABI_TAG "${_boost_RELEASE_ABI_TAG}s") set( _boost_RELEASE_ABI_TAG "${_boost_RELEASE_ABI_TAG}s")
set( _boost_DEBUG_ABI_TAG "${_boost_DEBUG_ABI_TAG}s") set( _boost_DEBUG_ABI_TAG "${_boost_DEBUG_ABI_TAG}s")
endif() endif()
# g using debug versions of the standard and runtime # g using debug versions of the standard and runtime
# support libraries # support libraries
if(WIN32) if(WIN32)
if(MSVC OR "${CMAKE_CXX_COMPILER}" MATCHES "icl" if(MSVC OR "${CMAKE_CXX_COMPILER}" MATCHES "icl"
OR "${CMAKE_CXX_COMPILER}" MATCHES "icpc") OR "${CMAKE_CXX_COMPILER}" MATCHES "icpc")
set(_boost_DEBUG_ABI_TAG "${_boost_DEBUG_ABI_TAG}g") set(_boost_DEBUG_ABI_TAG "${_boost_DEBUG_ABI_TAG}g")
endif() endif()
endif() endif()
# y using special debug build of python # y using special debug build of python
if(Boost_USE_DEBUG_PYTHON) if(Boost_USE_DEBUG_PYTHON)
set(_boost_DEBUG_ABI_TAG "${_boost_DEBUG_ABI_TAG}y") set(_boost_DEBUG_ABI_TAG "${_boost_DEBUG_ABI_TAG}y")
endif() endif()
# d using a debug version of your code # d using a debug version of your code
set(_boost_DEBUG_ABI_TAG "${_boost_DEBUG_ABI_TAG}d") set(_boost_DEBUG_ABI_TAG "${_boost_DEBUG_ABI_TAG}d")
# p using the STLport standard library rather than the # p using the STLport standard library rather than the
# default one supplied with your compiler # default one supplied with your compiler
if(Boost_USE_STLPORT) if(Boost_USE_STLPORT)
set( _boost_RELEASE_ABI_TAG "${_boost_RELEASE_ABI_TAG}p") set( _boost_RELEASE_ABI_TAG "${_boost_RELEASE_ABI_TAG}p")
set( _boost_DEBUG_ABI_TAG "${_boost_DEBUG_ABI_TAG}p") set( _boost_DEBUG_ABI_TAG "${_boost_DEBUG_ABI_TAG}p")
endif() endif()
# n using the STLport deprecated "native iostreams" feature # n using the STLport deprecated "native iostreams" feature
if(Boost_USE_STLPORT_DEPRECATED_NATIVE_IOSTREAMS) if(Boost_USE_STLPORT_DEPRECATED_NATIVE_IOSTREAMS)
set( _boost_RELEASE_ABI_TAG "${_boost_RELEASE_ABI_TAG}n") set( _boost_RELEASE_ABI_TAG "${_boost_RELEASE_ABI_TAG}n")
set( _boost_DEBUG_ABI_TAG "${_boost_DEBUG_ABI_TAG}n") set( _boost_DEBUG_ABI_TAG "${_boost_DEBUG_ABI_TAG}n")
endif() 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_RELEASE_ABI_TAG = ${_boost_RELEASE_ABI_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_DEBUG_ABI_TAG = ${_boost_DEBUG_ABI_TAG}") "_boost_DEBUG_ABI_TAG = ${_boost_DEBUG_ABI_TAG}")
endif() endif()
# ------------------------------------------------------------------------ # ------------------------------------------------------------------------
# Begin finding boost libraries # Begin finding boost libraries
# ------------------------------------------------------------------------ # ------------------------------------------------------------------------
if(BOOST_ROOT) if(BOOST_ROOT)
set(_boost_LIBRARY_SEARCH_DIRS_ALWAYS set(_boost_LIBRARY_SEARCH_DIRS_ALWAYS
${BOOST_ROOT}/lib ${BOOST_ROOT}/lib
${BOOST_ROOT}/stage/lib) ${BOOST_ROOT}/stage/lib)
endif() endif()
set(_boost_LIBRARY_SEARCH_DIRS_ALWAYS set(_boost_LIBRARY_SEARCH_DIRS_ALWAYS
${_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 ${Boost_INCLUDE_DIR}/stage/lib
) )
set(_boost_LIBRARY_SEARCH_DIRS_SYSTEM 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"
@ -865,71 +865,71 @@ set(Boost_ERROR_REASON)
"$ENV{ProgramFiles}/boost/lib" "$ENV{ProgramFiles}/boost/lib"
"$ENV{ProgramFiles}/boost" "$ENV{ProgramFiles}/boost"
/sw/local/lib /sw/local/lib
) )
set(_boost_LIBRARY_SEARCH_DIRS ${_boost_LIBRARY_SEARCH_DIRS_ALWAYS}) set(_boost_LIBRARY_SEARCH_DIRS ${_boost_LIBRARY_SEARCH_DIRS_ALWAYS})
if( Boost_NO_SYSTEM_PATHS ) if( Boost_NO_SYSTEM_PATHS )
set(_boost_FIND_OPTIONS NO_CMAKE_SYSTEM_PATH) set(_boost_FIND_OPTIONS NO_CMAKE_SYSTEM_PATH)
else() else()
list(APPEND _boost_LIBRARY_SEARCH_DIRS ${_boost_LIBRARY_SEARCH_DIRS_SYSTEM}) list(APPEND _boost_LIBRARY_SEARCH_DIRS ${_boost_LIBRARY_SEARCH_DIRS_SYSTEM})
endif() endif()
# prepend BOOST_LIBRARYDIR to search path if specified # prepend BOOST_LIBRARYDIR to search path if specified
if( BOOST_LIBRARYDIR ) if( BOOST_LIBRARYDIR )
file(TO_CMAKE_PATH ${BOOST_LIBRARYDIR} BOOST_LIBRARYDIR) file(TO_CMAKE_PATH ${BOOST_LIBRARYDIR} BOOST_LIBRARYDIR)
set(_boost_LIBRARY_SEARCH_DIRS set(_boost_LIBRARY_SEARCH_DIRS
${BOOST_LIBRARYDIR} ${_boost_LIBRARY_SEARCH_DIRS}) ${BOOST_LIBRARYDIR} ${_boost_LIBRARY_SEARCH_DIRS})
endif() 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_LIBRARY_SEARCH_DIRS = ${_boost_LIBRARY_SEARCH_DIRS}") "_boost_LIBRARY_SEARCH_DIRS = ${_boost_LIBRARY_SEARCH_DIRS}")
endif() endif()
# Support preference of static libs by adjusting CMAKE_FIND_LIBRARY_SUFFIXES # Support preference of static libs by adjusting CMAKE_FIND_LIBRARY_SUFFIXES
if( Boost_USE_STATIC_LIBS ) if( Boost_USE_STATIC_LIBS )
set( _boost_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES}) set( _boost_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})
if(WIN32) if(WIN32)
set(CMAKE_FIND_LIBRARY_SUFFIXES .lib .a ${CMAKE_FIND_LIBRARY_SUFFIXES}) set(CMAKE_FIND_LIBRARY_SUFFIXES .lib .a ${CMAKE_FIND_LIBRARY_SUFFIXES})
else() else()
set(CMAKE_FIND_LIBRARY_SUFFIXES .a ) set(CMAKE_FIND_LIBRARY_SUFFIXES .a )
endif() endif()
endif() endif()
# We want to use the tag inline below without risking double dashes # We want to use the tag inline below without risking double dashes
if(_boost_RELEASE_ABI_TAG) if(_boost_RELEASE_ABI_TAG)
if(${_boost_RELEASE_ABI_TAG} STREQUAL "-") if(${_boost_RELEASE_ABI_TAG} STREQUAL "-")
set(_boost_RELEASE_ABI_TAG "") set(_boost_RELEASE_ABI_TAG "")
endif() endif()
endif() endif()
if(_boost_DEBUG_ABI_TAG) if(_boost_DEBUG_ABI_TAG)
if(${_boost_DEBUG_ABI_TAG} STREQUAL "-") if(${_boost_DEBUG_ABI_TAG} STREQUAL "-")
set(_boost_DEBUG_ABI_TAG "") set(_boost_DEBUG_ABI_TAG "")
endif() endif()
endif() endif()
# The previous behavior of FindBoost when Boost_USE_STATIC_LIBS was enabled # The previous behavior of FindBoost when Boost_USE_STATIC_LIBS was enabled
# on WIN32 was to: # on WIN32 was to:
# 1. Search for static libs compiled against a SHARED C++ standard runtime library (use if found) # 1. Search for static libs compiled against a SHARED C++ standard runtime library (use if found)
# 2. Search for static libs compiled against a STATIC C++ standard runtime library (use if found) # 2. Search for static libs compiled against a STATIC C++ standard runtime library (use if found)
# We maintain this behavior since changing it could break people's builds. # We maintain this behavior since changing it could break people's builds.
# To disable the ambiguous behavior, the user need only # To disable the ambiguous behavior, the user need only
# set Boost_USE_STATIC_RUNTIME either ON or OFF. # set Boost_USE_STATIC_RUNTIME either ON or OFF.
set(_boost_STATIC_RUNTIME_WORKAROUND false) set(_boost_STATIC_RUNTIME_WORKAROUND false)
if(WIN32 AND Boost_USE_STATIC_LIBS) if(WIN32 AND Boost_USE_STATIC_LIBS)
if(NOT DEFINED Boost_USE_STATIC_RUNTIME) if(NOT DEFINED Boost_USE_STATIC_RUNTIME)
set(_boost_STATIC_RUNTIME_WORKAROUND true) set(_boost_STATIC_RUNTIME_WORKAROUND true)
endif() endif()
endif() endif()
# On versions < 1.35, remove the System library from the considered list # On versions < 1.35, remove the System library from the considered list
# since it wasn't added until 1.35. # since it wasn't added until 1.35.
if(Boost_VERSION AND Boost_FIND_COMPONENTS) if(Boost_VERSION AND Boost_FIND_COMPONENTS)
if(Boost_VERSION LESS 103500) if(Boost_VERSION LESS 103500)
list(REMOVE_ITEM Boost_FIND_COMPONENTS system) list(REMOVE_ITEM Boost_FIND_COMPONENTS system)
endif() endif()
endif() endif()
foreach(COMPONENT ${Boost_FIND_COMPONENTS}) foreach(COMPONENT ${Boost_FIND_COMPONENTS})
string(TOUPPER ${COMPONENT} UPPERCOMPONENT) string(TOUPPER ${COMPONENT} UPPERCOMPONENT)
set( Boost_${UPPERCOMPONENT}_LIBRARY "Boost_${UPPERCOMPONENT}_LIBRARY-NOTFOUND" ) set( Boost_${UPPERCOMPONENT}_LIBRARY "Boost_${UPPERCOMPONENT}_LIBRARY-NOTFOUND" )
set( Boost_${UPPERCOMPONENT}_LIBRARY_RELEASE "Boost_${UPPERCOMPONENT}_LIBRARY_RELEASE-NOTFOUND" ) set( Boost_${UPPERCOMPONENT}_LIBRARY_RELEASE "Boost_${UPPERCOMPONENT}_LIBRARY_RELEASE-NOTFOUND" )
@ -1008,30 +1008,30 @@ set(Boost_ERROR_REASON)
_Boost_ADJUST_LIB_VARS(${UPPERCOMPONENT}) _Boost_ADJUST_LIB_VARS(${UPPERCOMPONENT})
endforeach() endforeach()
# Restore the original find library ordering # Restore the original find library ordering
if( Boost_USE_STATIC_LIBS ) if( Boost_USE_STATIC_LIBS )
set(CMAKE_FIND_LIBRARY_SUFFIXES ${_boost_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES}) set(CMAKE_FIND_LIBRARY_SUFFIXES ${_boost_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES})
endif() endif()
# ------------------------------------------------------------------------ # ------------------------------------------------------------------------
# End finding boost libraries # End finding boost libraries
# ------------------------------------------------------------------------ # ------------------------------------------------------------------------
# ------------------------------------------------------------------------ # ------------------------------------------------------------------------
# Begin long process of determining Boost_FOUND, starting with version # Begin long process of determining Boost_FOUND, starting with version
# number checks, followed by # number checks, followed by
# TODO: Ideally the version check logic should happen prior to searching # TODO: Ideally the version check logic should happen prior to searching
# for libraries... # for libraries...
# ------------------------------------------------------------------------ # ------------------------------------------------------------------------
set(Boost_INCLUDE_DIRS set(Boost_INCLUDE_DIRS
${Boost_INCLUDE_DIR} ${Boost_INCLUDE_DIR}
) )
set(Boost_FOUND FALSE) set(Boost_FOUND FALSE)
if(Boost_INCLUDE_DIR) if(Boost_INCLUDE_DIR)
set( Boost_FOUND TRUE ) set( Boost_FOUND TRUE )
if(Boost_MAJOR_VERSION LESS "${Boost_FIND_VERSION_MAJOR}" ) if(Boost_MAJOR_VERSION LESS "${Boost_FIND_VERSION_MAJOR}" )
@ -1163,15 +1163,15 @@ set(Boost_ERROR_REASON)
endif() endif()
else() else()
set( Boost_FOUND FALSE) set( Boost_FOUND FALSE)
endif() endif()
# ------------------------------------------------------------------------ # ------------------------------------------------------------------------
# Notification to end user about what was found # Notification to end user about what was found
# ------------------------------------------------------------------------ # ------------------------------------------------------------------------
if(Boost_FOUND) if(Boost_FOUND)
if(NOT Boost_FIND_QUIETLY) if(NOT Boost_FIND_QUIETLY)
message(STATUS "Boost version: ${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}") message(STATUS "Boost version: ${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}")
if(Boost_FIND_COMPONENTS) if(Boost_FIND_COMPONENTS)
@ -1187,7 +1187,7 @@ set(Boost_ERROR_REASON)
set(Boost_LIBRARIES ${Boost_LIBRARIES} ${Boost_${UPPERCOMPONENT}_LIBRARY}) set(Boost_LIBRARIES ${Boost_LIBRARIES} ${Boost_${UPPERCOMPONENT}_LIBRARY})
endif() endif()
endforeach() endforeach()
else() else()
if(Boost_FIND_REQUIRED) if(Boost_FIND_REQUIRED)
message(SEND_ERROR "Unable to find the requested Boost libraries.\n${Boost_ERROR_REASON}") message(SEND_ERROR "Unable to find the requested Boost libraries.\n${Boost_ERROR_REASON}")
else() else()
@ -1203,10 +1203,10 @@ set(Boost_ERROR_REASON)
endif() endif()
endif() endif()
endif() endif()
endif() endif()
# show the Boost_INCLUDE_DIRS AND Boost_LIBRARIES variables only in the advanced view # show the Boost_INCLUDE_DIRS AND Boost_LIBRARIES variables only in the advanced view
mark_as_advanced(Boost_INCLUDE_DIR mark_as_advanced(Boost_INCLUDE_DIR
Boost_INCLUDE_DIRS Boost_INCLUDE_DIRS
Boost_LIBRARY_DIRS Boost_LIBRARY_DIRS
) )