[Cmake-commits] [cmake-commits] dgregor committed FindBoost.cmake 1.8 1.9

cmake-commits at cmake.org cmake-commits at cmake.org
Thu Jul 3 15:49:44 EDT 2008


Update of /cvsroot/CMake/CMake/Modules
In directory public:/mounts/ram/cvs-serv20301

Modified Files:
	FindBoost.cmake 
Log Message:
ENH: Cleanup FindBoost module, fixing several small bugs and providing better diagnostic information when things go wrong


Index: FindBoost.cmake
===================================================================
RCS file: /cvsroot/CMake/CMake/Modules/FindBoost.cmake,v
retrieving revision 1.8
retrieving revision 1.9
diff -C 2 -d -r1.8 -r1.9
*** FindBoost.cmake	10 May 2008 01:26:57 -0000	1.8
--- FindBoost.cmake	3 Jul 2008 19:49:41 -0000	1.9
***************
*** 42,46 ****
  #                                strings, where each string contains a number, i.e.
  #                                SET(Boost_ADDITIONAL_VERSIONS "0.99.0" "1.35.0")
! #  BOOST_ROOT                    Preferred installation prefix for searching for Boost,
  #                                set this if the module has problems finding the proper Boost installation
  #  BOOST_INCLUDEDIR              Set this to the include directory of Boost, if the
--- 42,46 ----
  #                                strings, where each string contains a number, i.e.
  #                                SET(Boost_ADDITIONAL_VERSIONS "0.99.0" "1.35.0")
! #  BOOST_ROOT or BOOSTROOT       Preferred installation prefix for searching for Boost,
  #                                set this if the module has problems finding the proper Boost installation
  #  BOOST_INCLUDEDIR              Set this to the include directory of Boost, if the
***************
*** 92,109 ****
  #  For details see the accompanying COPYING-CMAKE-SCRIPTS file.
  #
  
! # this module required CMake 2.5 for the Boost_FIND_VERSION stuff
! 
! # this must not be done in find modules, it changes the policy settings, which may have been
! # set in the projects cmake files.
! # beside that this module comes with cmake, so the cmake version is always correct, Alex
! # CMAKE_MINIMUM_REQUIRED(VERSION "2.6" FATAL_ERROR)
! 
! # MESSAGE(STATUS "Finding Boost libraries.... ")
! 
! OPTION(Boost_USE_MULTITHREADED "Use the multithreaded versions of the boost libraries" ON)
! 
! SET( _boost_TEST_VERSIONS ${Boost_ADDITIONAL_VERSIONS} "1.36.1" "1.36.0" "1.35.1" "1.35.0" "1.35" "1.34.1" "1.34.0" "1.34" "1.33.1" "1.33.0" "1.33" )
  
  
  ############################################
--- 92,117 ----
  #  For details see the accompanying COPYING-CMAKE-SCRIPTS file.
  #
+ OPTION(Boost_USE_MULTITHREADED 
+   "Use the multithreaded versions of the Boost libraries" ON)
  
! if (Boost_FIND_VERSION_EXACT)
!   if (Boost_FIND_VERSION_PATCH)
!     set( _boost_TEST_VERSIONS 
!       "${Boost_FIND_VERSION_MAJOR}.${Boost_FIND_VERSION_MINOR}.${Boost_FIND_VERSION_PATCH}")
!   else (Boost_FIND_VERSION_PATCH)
!     set( _boost_TEST_VERSIONS 
!       "${Boost_FIND_VERSION_MAJOR}.${Boost_FIND_VERSION_MINOR}.0"
!       "${Boost_FIND_VERSION_MAJOR}.${Boost_FIND_VERSION_MINOR}")
!   endif (Boost_FIND_VERSION_PATCH)
! else (Boost_FIND_VERSION_EXACT)
!   set( _boost_TEST_VERSIONS ${Boost_ADDITIONAL_VERSIONS} 
!     "1.36.1" "1.36.0" "1.35.1" "1.35.0" "1.35" "1.34.1" "1.34.0" "1.34" "1.33.1"
!     "1.33.0" "1.33" )
! endif (Boost_FIND_VERSION_EXACT)
  
+ # The reason that we failed to find Boost. This will be set to a
+ # user-friendly message when we fail to find some necessary piece of
+ # Boost.
+ set(Boost_ERROR_REASON)
  
  ############################################
***************
*** 120,125 ****
  MACRO (_Boost_ADJUST_LIB_VARS basename)
    IF (Boost_INCLUDE_DIR )
-     #MESSAGE(STATUS "Adjusting ${basename} ")
- 
      IF (Boost_${basename}_LIBRARY_DEBUG AND Boost_${basename}_LIBRARY_RELEASE)
        # if the generator supports configuration types then set
--- 128,131 ----
***************
*** 153,157 ****
        GET_FILENAME_COMPONENT(Boost_LIBRARY_DIRS "${Boost_${basename}_LIBRARY}" PATH)
        SET(Boost_LIBRARY_DIRS ${Boost_LIBRARY_DIRS} CACHE FILEPATH "Boost library directory")
!       SET(Boost_${basename}_FOUND ON CACHE INTERNAL "Was the boost boost ${basename} library found")
      ENDIF (Boost_${basename}_LIBRARY)
  
--- 159,163 ----
        GET_FILENAME_COMPONENT(Boost_LIBRARY_DIRS "${Boost_${basename}_LIBRARY}" PATH)
        SET(Boost_LIBRARY_DIRS ${Boost_LIBRARY_DIRS} CACHE FILEPATH "Boost library directory")
!       SET(Boost_${basename}_FOUND ON CACHE INTERNAL "Whether the Boost ${basename} library found")
      ENDIF (Boost_${basename}_LIBRARY)
  
***************
*** 198,224 ****
  
    IF(WIN32)
!     # In windows, automatic linking is performed, so you do not have to specify the libraries.
!     # If you are linking to a dynamic runtime, then you can choose to link to either a static or a
!     # dynamic Boost library, the default is to do a static link.  You can alter this for a specific
!     # library "whatever" by defining BOOST_WHATEVER_DYN_LINK to force Boost library "whatever" to
!     # be linked dynamically.  Alternatively you can force all Boost libraries to dynamic link by
!     # defining BOOST_ALL_DYN_LINK.
    
!     # This feature can be disabled for Boost library "whatever" by defining BOOST_WHATEVER_NO_LIB,
!     # or for all of Boost by defining BOOST_ALL_NO_LIB.
    
!     # If you want to observe which libraries are being linked against then defining
!     # BOOST_LIB_DIAGNOSTIC will cause the auto-linking code to emit a #pragma message each time
!     # a library is selected for linking.
!     SET(Boost_LIB_DIAGNOSTIC_DEFINITIONS "-DBOOST_LIB_DIAGNOSTIC" CACHE STRING "Boost diagnostic define")
    ENDIF(WIN32)
  
- 
    SET(_boost_INCLUDE_SEARCH_DIRS
      C:/boost/include
!     "C:/Program Files/boost/boost_${Boost_FIND_VERSION_MAJOR}_${Boost_FIND_VERSION_MINOR}_${Boost_FIND_VERSION_PATCH}"
!     # D: is very often the cdrom drive, IF you don't have a
!     # cdrom inserted it will popup a very annoying dialog
!     #D:/boost/include
      /sw/local/include
    )
--- 204,231 ----
  
    IF(WIN32)
!     # In windows, automatic linking is performed, so you do not have
!     # to specify the libraries.  If you are linking to a dynamic
!     # runtime, then you can choose to link to either a static or a
!     # dynamic Boost library, the default is to do a static link.  You
!     # can alter this for a specific library "whatever" by defining
!     # BOOST_WHATEVER_DYN_LINK to force Boost library "whatever" to be
!     # linked dynamically.  Alternatively you can force all Boost
!     # libraries to dynamic link by defining BOOST_ALL_DYN_LINK.
    
!     # This feature can be disabled for Boost library "whatever" by
!     # defining BOOST_WHATEVER_NO_LIB, or for all of Boost by defining
!     # BOOST_ALL_NO_LIB.
    
!     # If you want to observe which libraries are being linked against
!     # then defining BOOST_LIB_DIAGNOSTIC will cause the auto-linking
!     # code to emit a #pragma message each time a library is selected
!     # for linking.
!     SET(Boost_LIB_DIAGNOSTIC_DEFINITIONS 
!       "-DBOOST_LIB_DIAGNOSTIC" CACHE STRING "Boost diagnostic define")
    ENDIF(WIN32)
  
    SET(_boost_INCLUDE_SEARCH_DIRS
      C:/boost/include
!     "${ENV}{ProgramFiles}/boost/boost_${Boost_FIND_VERSION_MAJOR}_${Boost_FIND_VERSION_MINOR}_${Boost_FIND_VERSION_PATCH}"
      /sw/local/include
    )
***************
*** 226,286 ****
    SET(_boost_LIBRARIES_SEARCH_DIRS
      C:/boost/lib
!     "C:/Program Files/boost/boost_${Boost_FIND_VERSION_MAJOR}_${Boost_FIND_VERSION_MINOR}_${Boost_FIND_VERSION_PATCH}/lib"
      /sw/local/lib
    )
  
!   IF( NOT $ENV{BOOST_ROOT} STREQUAL "" )
!     SET(_boost_INCLUDE_SEARCH_DIRS $ENV{BOOST_ROOT}/include ${_boost_INCLUDE_SEARCH_DIRS})
!     SET(_boost_LIBRARIES_SEARCH_DIRS $ENV{BOOST_ROOT}/lib ${_boost_INCLUDE_SEARCH_DIRS})
!   ENDIF( NOT $ENV{BOOST_ROOT} STREQUAL "" )
  
    IF( NOT $ENV{BOOST_INCLUDEDIR} STREQUAL "" )
!     SET(_boost_INCLUDE_SEARCH_DIRS $ENV{BOOST_INCLUDEDIR} ${_boost_INCLUDE_SEARCH_DIRS})
    ENDIF( NOT $ENV{BOOST_INCLUDEDIR} STREQUAL "" )
  
    IF( NOT $ENV{BOOST_LIBRARYDIR} STREQUAL "" )
!     SET(_boost_LIBRARIES_SEARCH_DIRS $ENV{BOOST_LIBRARYDIR} ${_boost_INCLUDE_SEARCH_DIRS})
    ENDIF( NOT $ENV{BOOST_LIBRARYDIR} STREQUAL "" )
  
    IF( BOOST_ROOT )
!     IF( WIN32 )
!       SET(_boost_INCLUDE_SEARCH_DIRS ${BOOST_ROOT} ${_boost_INCLUDE_SEARCH_DIRS})
!     ELSE( WIN32 )
!       SET(_boost_INCLUDE_SEARCH_DIRS ${BOOST_ROOT}/include ${_boost_INCLUDE_SEARCH_DIRS})
!     ENDIF( WIN32 )
!     SET(_boost_LIBRARIES_SEARCH_DIRS ${BOOST_ROOT}/lib ${_boost_LIBRARIES_SEARCH_DIRS})
    ENDIF( BOOST_ROOT )
  
    IF( BOOST_INCLUDEDIR )
!     SET(_boost_INCLUDE_SEARCH_DIRS ${BOOST_INCLUDEDIR} ${_boost_INCLUDE_SEARCH_DIRS})
    ENDIF( BOOST_INCLUDEDIR )
  
    IF( BOOST_LIBRARYDIR )
!     SET(_boost_LIBRARIES_SEARCH_DIRS ${BOOST_LIBRARYDIR} ${_boost_LIBRARIES_SEARCH_DIRS})
    ENDIF( BOOST_LIBRARYDIR )
  
!   #Try first in our own include search paths (e.g. BOOST_ROOT)
    FOREACH(_boost_VER ${_boost_TEST_VERSIONS})
      IF( NOT Boost_INCLUDE_DIR )
! 
!       # Add in a path suffix, based on the required version, ideally we could
!       # read this from version.hpp, but for that to work we'd need to know the include
!       # dir already
!       SET(_boost_PATH_SUFFIX
!         boost-${_boost_VER}
!       )
  
        IF(_boost_PATH_SUFFIX MATCHES "[0-9]+\\.[0-9]+\\.[0-9]+")
!           STRING(REGEX REPLACE "([0-9]+)\\.([0-9]+)\\.([0-9]+)" "\\1_\\2_\\3" _boost_PATH_SUFFIX ${_boost_PATH_SUFFIX})
        ELSEIF(_boost_PATH_SUFFIX MATCHES "[0-9]+\\.[0-9]+")
!           STRING(REGEX REPLACE "([0-9]+)\\.([0-9]+)" "\\1_\\2" _boost_PATH_SUFFIX ${_boost_PATH_SUFFIX})
        ENDIF(_boost_PATH_SUFFIX MATCHES "[0-9]+\\.[0-9]+\\.[0-9]+")
  
- 
        FIND_PATH(Boost_INCLUDE_DIR
            NAMES         boost/config.hpp
!           PATHS         ${_boost_INCLUDE_SEARCH_DIRS}
            PATH_SUFFIXES ${_boost_PATH_SUFFIX}
-           NO_DEFAULT_PATH
        )
  
--- 233,309 ----
    SET(_boost_LIBRARIES_SEARCH_DIRS
      C:/boost/lib
!     "${ENV}{ProgramFiles}/boost/boost_${Boost_FIND_VERSION_MAJOR}_${Boost_FIND_VERSION_MINOR}_${Boost_FIND_VERSION_PATCH}/lib"
      /sw/local/lib
    )
  
!   # If BOOST_ROOT was defined in the environment, use it.
!   if (NOT BOOST_ROOT AND NOT $ENV{BOOST_ROOT} STREQUAL "")
!     set(BOOST_ROOT $ENV{BOOST_ROOT})
!   endif(NOT BOOST_ROOT AND NOT $ENV{BOOST_ROOT} STREQUAL "")
  
+   # If BOOSTROOT was defined in the environment, use it.
+   if (NOT BOOST_ROOT AND NOT $ENV{BOOSTROOT} STREQUAL "")
+     set(BOOST_ROOT $ENV{BOOSTROOT})
+   endif(NOT BOOST_ROOT AND NOT $ENV{BOOSTROOT} STREQUAL "")
+ 
+   # If BOOST_INCLUDEDIR was defined in the environment, use it.
    IF( NOT $ENV{BOOST_INCLUDEDIR} STREQUAL "" )
!     set(BOOST_INCLUDEDIR $ENV{BOOST_INCLUDEDIR})
    ENDIF( NOT $ENV{BOOST_INCLUDEDIR} STREQUAL "" )
  
+   # If BOOST_LIBRARYDIR was defined in the environment, use it.
    IF( NOT $ENV{BOOST_LIBRARYDIR} STREQUAL "" )
!     set(BOOST_LIBRARYDIR $ENV{BOOST_LIBRARYDIR})
    ENDIF( NOT $ENV{BOOST_LIBRARYDIR} STREQUAL "" )
  
    IF( BOOST_ROOT )
!     file(TO_CMAKE_PATH ${BOOST_ROOT} BOOST_ROOT)
!     SET(_boost_INCLUDE_SEARCH_DIRS 
!       ${BOOST_ROOT}/include 
!       ${BOOST_ROOT}
!       ${_boost_INCLUDE_SEARCH_DIRS})
!     SET(_boost_LIBRARIES_SEARCH_DIRS 
!       ${BOOST_ROOT}/lib 
!       ${BOOST_ROOT}/stage/lib 
!       ${_boost_LIBRARIES_SEARCH_DIRS})
    ENDIF( BOOST_ROOT )
  
    IF( BOOST_INCLUDEDIR )
!     file(TO_CMAKE_PATH ${BOOST_INCLUDEDIR} BOOST_INCLUDEDIR)
!     SET(_boost_INCLUDE_SEARCH_DIRS 
!       ${BOOST_INCLUDEDIR} ${_boost_INCLUDE_SEARCH_DIRS})
    ENDIF( BOOST_INCLUDEDIR )
  
    IF( BOOST_LIBRARYDIR )
!     file(TO_CMAKE_PATH ${BOOST_LIBRARYDIR} BOOST_LIBRARYDIR)
!     SET(_boost_LIBRARIES_SEARCH_DIRS 
!       ${BOOST_LIBRARYDIR} ${_boost_LIBRARIES_SEARCH_DIRS})
    ENDIF( BOOST_LIBRARYDIR )
  
!   # Try to find Boost by stepping backwards through the Boost versions
!   # we know about.
    FOREACH(_boost_VER ${_boost_TEST_VERSIONS})
      IF( NOT Boost_INCLUDE_DIR )
!       # Add in a path suffix, based on the required version, ideally
!       # we could read this from version.hpp, but for that to work we'd
!       # need to know the include dir already
!       if (WIN32 AND NOT CYGWIN)
!         set(_boost_PATH_SUFFIX boost_${_boost_VER})
!       else (WIN32 AND NOT CYGWIN)
!         set(_boost_PATH_SUFFIX boost-${_boost_VER})
!       endif (WIN32 AND NOT CYGWIN)
  
        IF(_boost_PATH_SUFFIX MATCHES "[0-9]+\\.[0-9]+\\.[0-9]+")
!           STRING(REGEX REPLACE "([0-9]+)\\.([0-9]+)\\.([0-9]+)" "\\1_\\2_\\3" 
!             _boost_PATH_SUFFIX ${_boost_PATH_SUFFIX})
        ELSEIF(_boost_PATH_SUFFIX MATCHES "[0-9]+\\.[0-9]+")
!           STRING(REGEX REPLACE "([0-9]+)\\.([0-9]+)" "\\1_\\2" 
!             _boost_PATH_SUFFIX ${_boost_PATH_SUFFIX})
        ENDIF(_boost_PATH_SUFFIX MATCHES "[0-9]+\\.[0-9]+\\.[0-9]+")
  
        FIND_PATH(Boost_INCLUDE_DIR
            NAMES         boost/config.hpp
!           HINTS         ${_boost_INCLUDE_SEARCH_DIRS}
            PATH_SUFFIXES ${_boost_PATH_SUFFIX}
        )
  
***************
*** 288,315 ****
    ENDFOREACH(_boost_VER)
  
-   # If nothing is found search again using system default paths
-   FOREACH(_boost_VER ${_boost_TEST_VERSIONS})
-     IF( NOT Boost_INCLUDE_DIR )
- 
-       # Add in a path suffix, based on the required version, ideally we could
-       # read this from version.hpp, but for that to work we'd need to know the include
-       # dir already
-       SET(_boost_PATH_SUFFIX
-         boost-${_boost_VER}
-       )
- 
-       IF(_boost_PATH_SUFFIX MATCHES "[0-9]+\\.[0-9]+\\.[0-9]+")
-           STRING(REGEX REPLACE "([0-9]+)\\.([0-9]+)\\.([0-9]+)" "\\1_\\2_\\3" _boost_PATH_SUFFIX ${_boost_PATH_SUFFIX})
-       ELSEIF(_boost_PATH_SUFFIX MATCHES "[0-9]+\\.[0-9]+")
-           STRING(REGEX REPLACE "([0-9]+)\\.([0-9]+)" "\\1_\\2" _boost_PATH_SUFFIX ${_boost_PATH_SUFFIX})
-       ENDIF(_boost_PATH_SUFFIX MATCHES "[0-9]+\\.[0-9]+\\.[0-9]+")
- 
-       FIND_PATH(Boost_INCLUDE_DIR
-           NAMES         boost/config.hpp
-           PATH_SUFFIXES ${_boost_PATH_SUFFIX}
-       )
-  
-     ENDIF( NOT Boost_INCLUDE_DIR )
-   ENDFOREACH(_boost_VER)
    IF(Boost_INCLUDE_DIR)
      # Extract Boost_VERSION and Boost_LIB_VERSION from version.hpp
--- 311,314 ----
***************
*** 330,339 ****
        MATH(EXPR Boost_MINOR_VERSION "${Boost_VERSION} / 100 % 1000")
        MATH(EXPR Boost_SUBMINOR_VERSION "${Boost_VERSION} % 100")
!   
      ENDIF(NOT "${Boost_VERSION}" STREQUAL "0")
    ENDIF(Boost_INCLUDE_DIR)
  
! 
!   #Setting some more suffixes for the library
    SET (Boost_LIB_PREFIX "")
    IF ( WIN32 AND Boost_USE_STATIC_LIBS )
--- 329,342 ----
        MATH(EXPR Boost_MINOR_VERSION "${Boost_VERSION} / 100 % 1000")
        MATH(EXPR Boost_SUBMINOR_VERSION "${Boost_VERSION} % 100")
! 
!       set(Boost_ERROR_REASON
!           "${Boost_ERROR_REASON}Boost version: ${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}\nBoost include path: ${Boost_INCLUDE_DIR}")
      ENDIF(NOT "${Boost_VERSION}" STREQUAL "0")
+   ELSE(Boost_INCLUDE_DIR)
+     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.")
    ENDIF(Boost_INCLUDE_DIR)
  
!   # Setting some more suffixes for the library
    SET (Boost_LIB_PREFIX "")
    IF ( WIN32 AND Boost_USE_STATIC_LIBS )
***************
*** 341,379 ****
    ENDIF ( WIN32 AND Boost_USE_STATIC_LIBS )
    SET (_boost_COMPILER "-gcc")
-   IF (MSVC71)
-     SET (_boost_COMPILER "-vc71")
-   ENDIF(MSVC71)
-   IF (MSVC80)
-     SET (_boost_COMPILER "-vc80")
-   ENDIF(MSVC80)
    IF (MSVC90)
      SET (_boost_COMPILER "-vc90")
!   ENDIF (MSVC90)
    IF (MINGW)
      EXEC_PROGRAM(${CMAKE_CXX_COMPILER}
!       ARGS --version
        OUTPUT_VARIABLE _boost_COMPILER_VERSION
        )
!     STRING(REGEX REPLACE ".* ([0-9])\\.([0-9])\\.[0-9] .*" "\\1\\2"
        _boost_COMPILER_VERSION ${_boost_COMPILER_VERSION})
      SET (_boost_COMPILER "-mgw${_boost_COMPILER_VERSION}")
    ENDIF(MINGW)
-   IF (CYGWIN)
-     SET (_boost_COMPILER "-gcc")
-   ENDIF (CYGWIN)
    IF (UNIX)
      IF (APPLE)
!         SET (_boost_COMPILER "")
      ELSE (APPLE)
        IF (NOT CMAKE_COMPILER_IS_GNUCC)
!         # This is for the intel compiler
          SET (_boost_COMPILER "-il")
        ELSE (NOT CMAKE_COMPILER_IS_GNUCC)
!         #find out the version of gcc being used.
          EXEC_PROGRAM(${CMAKE_CXX_COMPILER}
!             ARGS --version
              OUTPUT_VARIABLE _boost_COMPILER_VERSION
          )
!         STRING(REGEX REPLACE ".* ([0-9])\\.([0-9])\\.[0-9] .*" "\\1\\2"
                 _boost_COMPILER_VERSION ${_boost_COMPILER_VERSION})
          SET (_boost_COMPILER "-gcc${_boost_COMPILER_VERSION}")
--- 344,379 ----
    ENDIF ( WIN32 AND Boost_USE_STATIC_LIBS )
    SET (_boost_COMPILER "-gcc")
    IF (MSVC90)
      SET (_boost_COMPILER "-vc90")
!   ELSEIF (MSVC80)
!     SET (_boost_COMPILER "-vc80")
!   ELSEIF (MSVC71)
!     SET (_boost_COMPILER "-vc71")
!   ENDIF(MSVC90)
    IF (MINGW)
      EXEC_PROGRAM(${CMAKE_CXX_COMPILER}
!       ARGS -dumpversion
        OUTPUT_VARIABLE _boost_COMPILER_VERSION
        )
!     STRING(REGEX REPLACE "([0-9])\\.([0-9])\\.[0-9]" "\\1\\2"
        _boost_COMPILER_VERSION ${_boost_COMPILER_VERSION})
      SET (_boost_COMPILER "-mgw${_boost_COMPILER_VERSION}")
    ENDIF(MINGW)
    IF (UNIX)
      IF (APPLE)
!       # Due to a quirk in Boost.Build, there is no compiler name
!       # mangled into library names on Mac OS X/Darwin.
!       SET (_boost_COMPILER "")
      ELSE (APPLE)
        IF (NOT CMAKE_COMPILER_IS_GNUCC)
!         # We assume that we have the Intel compiler.
          SET (_boost_COMPILER "-il")
        ELSE (NOT CMAKE_COMPILER_IS_GNUCC)
!         # Determine which version of GCC we have.
          EXEC_PROGRAM(${CMAKE_CXX_COMPILER}
!             ARGS -dumpversion
              OUTPUT_VARIABLE _boost_COMPILER_VERSION
          )
!         STRING(REGEX REPLACE "([0-9])\\.([0-9])\\.[0-9]" "\\1\\2"
                 _boost_COMPILER_VERSION ${_boost_COMPILER_VERSION})
          SET (_boost_COMPILER "-gcc${_boost_COMPILER_VERSION}")
***************
*** 424,441 ****
                 ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}${_boost_STATIC_TAG}
                 ${Boost_LIB_PREFIX}boost_${COMPONENT}
!         PATHS  ${_boost_LIBRARIES_SEARCH_DIRS}
!         NO_DEFAULT_PATH
      )
  
-     IF( NOT ${Boost_${UPPERCOMPONENT}_LIBRARY_RELEASE} )
-       FIND_LIBRARY(Boost_${UPPERCOMPONENT}_LIBRARY_RELEASE
-           NAMES  ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}-${Boost_LIB_VERSION}
-                  ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_COMPILER}${_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}
-       )
-     ENDIF( NOT ${Boost_${UPPERCOMPONENT}_LIBRARY_RELEASE} )
- 
      FIND_LIBRARY(Boost_${UPPERCOMPONENT}_LIBRARY_DEBUG
          NAMES  ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}-${_boost_ABI_TAG}-${Boost_LIB_VERSION}
--- 424,430 ----
                 ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}${_boost_STATIC_TAG}
                 ${Boost_LIB_PREFIX}boost_${COMPONENT}
!         HINTS  ${_boost_LIBRARIES_SEARCH_DIRS}
      )
  
      FIND_LIBRARY(Boost_${UPPERCOMPONENT}_LIBRARY_DEBUG
          NAMES  ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}-${_boost_ABI_TAG}-${Boost_LIB_VERSION}
***************
*** 444,460 ****
                 ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}${_boost_STATIC_TAG}${_boost_ABI_TAG}
                 ${Boost_LIB_PREFIX}boost_${COMPONENT}-${_boost_ABI_TAG}
!         PATHS  ${_boost_LIBRARIES_SEARCH_DIRS}
!         NO_DEFAULT_PATH
      )
  
-     IF( NOT ${Boost_${UPPERCOMPONENT}_LIBRARY_DEBUG} )
-       FIND_LIBRARY(Boost_${UPPERCOMPONENT}_LIBRARY_DEBUG
-           NAMES  ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}-${_boost_ABI_TAG}-${Boost_LIB_VERSION}
-                ${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_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}${_boost_STATIC_TAG}${_boost_ABI_TAG}
-                ${Boost_LIB_PREFIX}boost_${COMPONENT}-${_boost_ABI_TAG}
-       )
-     ENDIF( NOT ${Boost_${UPPERCOMPONENT}_LIBRARY_DEBUG} )
      _Boost_ADJUST_LIB_VARS(${UPPERCOMPONENT})
      IF( Boost_USE_STATIC_LIBS )
--- 433,439 ----
                 ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}${_boost_STATIC_TAG}${_boost_ABI_TAG}
                 ${Boost_LIB_PREFIX}boost_${COMPONENT}-${_boost_ABI_TAG}
!         HINTS  ${_boost_LIBRARIES_SEARCH_DIRS}
      )
  
      _Boost_ADJUST_LIB_VARS(${UPPERCOMPONENT})
      IF( Boost_USE_STATIC_LIBS )
***************
*** 470,500 ****
    )
  
-   # MESSAGE(STATUS "Boost_INCLUDE_DIRS: ${Boost_INCLUDE_DIRS}")
-   # MESSAGE(STATUS "Boost_LIBRARIES: ${Boost_LIBRARIES}")
- 
    SET(Boost_FOUND FALSE)
    IF(Boost_INCLUDE_DIR)
      SET( Boost_FOUND TRUE )
!     IF( Boost_FIND_VERSION_MAJOR AND Boost_MAJOR_VERSION LESS "${Boost_FIND_VERSION_MAJOR}" )
!       SET( Boost_FOUND FALSE )
!     ELSE( Boost_FIND_VERSION_MAJOR AND Boost_MAJOR_VERSION LESS "${Boost_FIND_VERSION_MAJOR}" )
!       IF( Boost_FIND_VERSION_MINOR AND Boost_MINOR_VERSION LESS "${Boost_FIND_VERSION_MINOR}" )
!         SET( Boost_FOUND FALSE )
!       ELSE( Boost_FIND_VERSION_MINOR AND Boost_MINOR_VERSION LESS "${Boost_FIND_VERSION_MINOR}" )
!         IF( Boost_FIND_VERSION_PATCH AND Boost_SUBMINOR_VERSION LESS "${Boost_FIND_VERSION_PATCH}" )
!           SET( Boost_FOUND FALSE )
!         ENDIF( Boost_FIND_VERSION_PATCH AND Boost_SUBMINOR_VERSION LESS "${Boost_FIND_VERSION_PATCH}" )
!       ENDIF( Boost_FIND_VERSION_MINOR AND Boost_MINOR_VERSION LESS "${Boost_FIND_VERSION_MINOR}" )
!     ENDIF( Boost_FIND_VERSION_MAJOR AND Boost_MAJOR_VERSION LESS "${Boost_FIND_VERSION_MAJOR}" )
!     set(_boost_CHECKED_COMPONENT FALSE)
!     FOREACH(COMPONENT ${Boost_FIND_COMPONENTS})
!       STRING(TOUPPER ${COMPONENT} COMPONENT)
!       set(_boost_CHECKED_COMPONENT TRUE)
!       IF(NOT Boost_${COMPONENT}_FOUND)
!         SET( Boost_FOUND FALSE)
!       ENDIF(NOT Boost_${COMPONENT}_FOUND)
!     ENDFOREACH(COMPONENT)
      IF( NOT Boost_LIBRARY_DIRS AND NOT _boost_CHECKED_COMPONENT )
!       # Compatibility Code for backwards compatibility with CMake 2.4
  
        # Look for the boost library path.
--- 449,549 ----
    )
  
    SET(Boost_FOUND FALSE)
    IF(Boost_INCLUDE_DIR)
      SET( Boost_FOUND TRUE )
! 
!     # Check the version of Boost against the requested version.
!     if (Boost_FIND_VERSION AND NOT Boost_FIND_VERSION_MINOR)
!       message(SEND_ERROR "When requesting a specific version of Boost, you must provide at least the major and minor version numbers, e.g., 1.34")
!     endif (Boost_FIND_VERSION AND NOT Boost_FIND_VERSION_MINOR)
!     if(Boost_MAJOR_VERSION LESS "${Boost_FIND_VERSION_MAJOR}" )
!       set( Boost_FOUND FALSE )
!       set(_Boost_VERSION_AGE "old")
!     elseif(Boost_MAJOR_VERSION EQUAL "${Boost_FIND_VERSION_MAJOR}" )
!       if(Boost_MINOR_VERSION LESS "${Boost_FIND_VERSION_MINOR}" )
!         set( Boost_FOUND FALSE )
!         set(_Boost_VERSION_AGE "old")
!       elseif(Boost_MINOR_VERSION EQUAL "${Boost_FIND_VERSION_MINOR}" )
!         if( Boost_FIND_VERSION_PATCH AND Boost_SUBMINOR_VERSION LESS "${Boost_FIND_VERSION_PATCH}" )
!           set( Boost_FOUND FALSE )
!           set(_Boost_VERSION_AGE "old")
!         endif( Boost_FIND_VERSION_PATCH AND Boost_SUBMINOR_VERSION LESS "${Boost_FIND_VERSION_PATCH}" )
!       endif( Boost_MINOR_VERSION LESS "${Boost_FIND_VERSION_MINOR}" )
!     endif( Boost_MAJOR_VERSION LESS "${Boost_FIND_VERSION_MAJOR}" )
! 
!     if (Boost_FOUND AND Boost_FIND_VERSION_EXACT)
!       # If the user requested an exact version of Boost, check
!       # that. We already know that the Boost version we have is >= the
!       # requested version.
!       set(_Boost_VERSION_AGE "new")
! 
!       # If the user didn't specify a patchlevel, it's 0.
!       if (NOT Boost_FIND_VERSION_PATCH)
!         set(Boost_FIND_VERSION_PATCH 0)
!       endif (NOT Boost_FIND_VERSION_PATCH)
!       
!       # We'll set Boost_FOUND true again if we have an exact version match.
!       set(Boost_FOUND FALSE)
!       if(Boost_MAJOR_VERSION EQUAL "${Boost_FIND_VERSION_MAJOR}" )
!         if(Boost_MINOR_VERSION EQUAL "${Boost_FIND_VERSION_MINOR}" )
!           if(Boost_SUBMINOR_VERSION EQUAL "${Boost_FIND_VERSION_PATCH}" )
!             set( Boost_FOUND TRUE )
!           endif(Boost_SUBMINOR_VERSION EQUAL "${Boost_FIND_VERSION_PATCH}" )
!         endif( Boost_MINOR_VERSION EQUAL "${Boost_FIND_VERSION_MINOR}" )
!       endif( Boost_MAJOR_VERSION EQUAL "${Boost_FIND_VERSION_MAJOR}" )
!     endif (Boost_FOUND AND Boost_FIND_VERSION_EXACT)
! 
!     if(NOT Boost_FOUND)
!       # State that we found a version of Boost that is too new or too old.
!       set(Boost_ERROR_REASON
!         "${Boost_ERROR_REASON}\nDetected version of Boost is too ${_Boost_VERSION_AGE}. Requested version was ${Boost_FIND_VERSION_MAJOR}.${Boost_FIND_VERSION_MINOR}")
!       if (Boost_FIND_VERSION_PATCH)
!         set(Boost_ERROR_REASON 
!           "${Boost_ERROR_REASON}.${Boost_FIND_VERSION_PATCH}")
!       endif (Boost_FIND_VERSION_PATCH)
!       if (NOT Boost_FIND_VERSION_EXACT)
!         set(Boost_ERROR_REASON "${Boost_ERROR_REASON} (or newer)")
!       endif (NOT Boost_FIND_VERSION_EXACT)
!       set(Boost_ERROR_REASON "${Boost_ERROR_REASON}.")
!     endif (NOT Boost_FOUND)
! 
!     if (Boost_FOUND)
!       set(_boost_CHECKED_COMPONENT FALSE)
!       set(_Boost_MISSING_COMPONENTS)
!       foreach(COMPONENT ${Boost_FIND_COMPONENTS})
!         string(TOUPPER ${COMPONENT} COMPONENT)
!         set(_boost_CHECKED_COMPONENT TRUE)
!         if(NOT Boost_${COMPONENT}_FOUND)
!           string(TOLOWER ${COMPONENT} COMPONENT)
!           list(APPEND _Boost_MISSING_COMPONENTS ${COMPONENT})
!           set( Boost_FOUND FALSE)
!         endif(NOT Boost_${COMPONENT}_FOUND)
!       endforeach(COMPONENT)
!     endif (Boost_FOUND)
! 
!     if (_Boost_MISSING_COMPONENTS)
!       # We were unable to find some libraries, so generate a sensible
!       # error message that lists the libraries we were unable to find.
!       set(Boost_ERROR_REASON
!         "${Boost_ERROR_REASON}\nThe following Boost libraries could not be found:\n")
!       foreach(COMPONENT ${_Boost_MISSING_COMPONENTS})
!         set(Boost_ERROR_REASON
!           "${Boost_ERROR_REASON}        boost_${COMPONENT}\n")
!       endforeach(COMPONENT)
! 
!       list(LENGTH Boost_FIND_COMPONENTS Boost_NUM_COMPONENTS_WANTED)
!       list(LENGTH _Boost_MISSING_COMPONENTS Boost_NUM_MISSING_COMPONENTS)
!       if (${Boost_NUM_COMPONENTS_WANTED} EQUAL ${Boost_NUM_MISSING_COMPONENTS})
!         set(Boost_ERROR_REASON
!           "${Boost_ERROR_REASON}No Boost libraries were found. You may need to set Boost_LIBRARYDIR to the directory containing Boost libraries or BOOST_ROOT to the location of Boost.")
!       else (${Boost_NUM_COMPONENTS_WANTED} EQUAL ${Boost_NUM_MISSING_COMPONENTS})
!         set(Boost_ERROR_REASON
!           "${Boost_ERROR_REASON}Some (but not all) of the required Boost libraries were found. You may need to install these additional Boost libraries. Alternatively, set Boost_LIBRARYDIR to the directory containing Boost libraries or BOOST_ROOT to the location of Boost.")
!       endif (${Boost_NUM_COMPONENTS_WANTED} EQUAL ${Boost_NUM_MISSING_COMPONENTS})
!     endif (_Boost_MISSING_COMPONENTS)
! 
      IF( NOT Boost_LIBRARY_DIRS AND NOT _boost_CHECKED_COMPONENT )
!       # Compatibility Code for backwards compatibility with CMake
!       # 2.4's FindBoost module.
  
        # Look for the boost library path.
***************
*** 550,555 ****
    ELSE (Boost_FOUND)
        IF (Boost_FIND_REQUIRED)
!         MESSAGE(STATUS "Boost version required: ${Boost_FIND_VERSION_MAJOR}.${Boost_FIND_VERSION_MINOR}.${Boost_FIND_VERSION_PATCH}, found: ${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}")
!         MESSAGE(FATAL_ERROR "Couldn't find the Boost libraries and/or include directory, or the version found is too old. Please install the Boost libraries AND development packages. You can set BOOST_ROOT, BOOST_INCLUDEDIR and BOOST_LIBRARYDIR to help find Boost.")
        ENDIF(Boost_FIND_REQUIRED)
    ENDIF(Boost_FOUND)
--- 599,603 ----
    ELSE (Boost_FOUND)
        IF (Boost_FIND_REQUIRED)
!         message(SEND_ERROR "Unable to find the requested Boost libraries.\n${Boost_ERROR_REASON}")
        ENDIF(Boost_FIND_REQUIRED)
    ENDIF(Boost_FOUND)



More information about the Cmake-commits mailing list