[Cmake-commits] [cmake-commits] lowman committed FindBoost.cmake 1.46 1.47

cmake-commits at cmake.org cmake-commits at cmake.org
Fri Oct 9 01:15:58 EDT 2009


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

Modified Files:
	FindBoost.cmake 
Log Message:
Several minor FindBoost changes to address posts on mailing list

1. Add STATUS output "Could NOT find Boost" if boost is not found
which brings FindBoost closer in behavior to most CMake find modules.

2. Add an option: Boost_DETAILED_FAILURE_MSG to output
Boost_ERROR_REASON on a non-REQUIRED find if this
is desired by the developer.  This is done because the error messages
are rather long and software with optional Boost dependencies might
not like them showing up by default, especially since this wasn't done
before.

3. Add mention of Boost_ADDITIONAL_VERSIONS close to top
of file since this seems to be the most common problem brought
up on the mailing list (maybe people will notice it there)

4. Added additional check for intel compiler which probably isn't
necessary but ultimately should be cleaner if CMAKE_CXX_COMPILER_ID
sticks around.

5. Added my name to the Copyright list


Index: FindBoost.cmake
===================================================================
RCS file: /cvsroot/CMake/CMake/Modules/FindBoost.cmake,v
retrieving revision 1.46
retrieving revision 1.47
diff -C 2 -d -r1.46 -r1.47
*** FindBoost.cmake	28 Sep 2009 15:45:33 -0000	1.46
--- FindBoost.cmake	9 Oct 2009 05:15:56 -0000	1.47
***************
*** 2,5 ****
--- 2,10 ----
  # Usage of this module as follows:
  #
+ # NOTE: Take note of the Boost_ADDITIONAL_VERSIONS variable below.
+ # Due to Boost naming conventions and limitations in CMake this find
+ # module is NOT future safe with respect to Boost version numbers,
+ # and may break.
+ #
  # == Using Header-Only libraries from within Boost: ==
  #
***************
*** 66,70 ****
  # binary Boost releases do so.
  #
! # SET(Boost_ADDITIONAL_VERSIONS "0.99" "0.99.0" "1.78" "1.78.0")
  #
  # ===================================== ============= ========================
--- 71,75 ----
  # binary Boost releases do so.
  #
! # SET(Boost_ADDITIONAL_VERSIONS "1.78" "1.78.0" "1.79" "1.79.0")
  #
  # ===================================== ============= ========================
***************
*** 91,94 ****
--- 96,105 ----
  #                                Please enable this before filing any bug
  #                                reports.
+ #
+ #   Boost_DETAILED_FAILURE_MSG   FindBoost doesn't output detailed information
+ #                                about why it failed or how to fix the problem
+ #                                unless this is set to TRUE or the REQUIRED
+ #                                keyword is specified in find_package().
+ #                                  [Since CMake 2.8.0]
  # 
  #   Boost_COMPILER               Set this to the compiler suffix used by Boost
***************
*** 155,158 ****
--- 166,170 ----
  # Copyright 2007      Mike Jackson
  # Copyright 2008      Andreas Pakulat <apaku at gmx.de>
+ # Copyright 2008-2009 Philip Lowman <philip at yhbt.com>
  #
  # Distributed under the OSI-approved BSD License (the "License");
***************
*** 548,553 ****
      # please report them and use the Boost_COMPILER variable
      # to work around the problems.
!     if("${CMAKE_CXX_COMPILER}" MATCHES "icl" 
!         OR "${CMAKE_CXX_COMPILER}" MATCHES "icpc") 
        if(WIN32)
          set (_boost_COMPILER "-iw")
--- 560,566 ----
      # please report them and use the Boost_COMPILER variable
      # to work around the problems.
!     if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel"
!         OR "${CMAKE_CXX_COMPILER}" MATCHES "icl" 
!         OR "${CMAKE_CXX_COMPILER}" MATCHES "icpc")
        if(WIN32)
          set (_boost_COMPILER "-iw")
***************
*** 875,883 ****
          ENDIF ( Boost_${UPPERCOMPONENT}_FOUND )
        ENDFOREACH(COMPONENT)
!   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)
  
    # show the Boost_INCLUDE_DIRS AND Boost_LIBRARIES variables only in the advanced view
--- 888,908 ----
          ENDIF ( Boost_${UPPERCOMPONENT}_FOUND )
        ENDFOREACH(COMPONENT)
!   else()
!     if(Boost_FIND_REQUIRED)
!       message(SEND_ERROR "Unable to find the requested Boost libraries.\n${Boost_ERROR_REASON}")
!     else()
!       if(NOT Boost_FIND_QUIETLY)
!         # we opt not to automatically output Boost_ERROR_REASON here as
!         # it could be quite lengthy and somewhat imposing in it's requests
!         # Since Boost is not always a required dependency we'll leave this
!         # up to the end-user.
!         if(Boost_DEBUG OR Boost_DETAILED_FAILURE_MSG)
!           message(STATUS "Could NOT find Boost\n${Boost_ERROR_REASON}")
!         else()
!           message(STATUS "Could NOT find Boost")
!         endif()
!       endif()
!     endif(Boost_FIND_REQUIRED)
!   endif()
  
    # show the Boost_INCLUDE_DIRS AND Boost_LIBRARIES variables only in the advanced view



More information about the Cmake-commits mailing list