[Cmake-commits] [cmake-commits] lowman committed FindBoost.cmake 1.35 1.36
cmake-commits at cmake.org
cmake-commits at cmake.org
Thu Mar 12 21:06:14 EDT 2009
Update of /cvsroot/CMake/CMake/Modules
In directory public:/mounts/ram/cvs-serv657
Modified Files:
FindBoost.cmake
Log Message:
STYLE: Moved functions/macros to top of file so main is more readable.
Index: FindBoost.cmake
===================================================================
RCS file: /cvsroot/CMake/CMake/Modules/FindBoost.cmake,v
retrieving revision 1.35
retrieving revision 1.36
diff -C 2 -d -r1.35 -r1.36
*** FindBoost.cmake 3 Mar 2009 02:09:36 -0000 1.35
--- FindBoost.cmake 13 Mar 2009 01:06:08 -0000 1.36
***************
*** 161,206 ****
#
- IF(NOT DEFINED Boost_USE_MULTITHREADED)
- SET(Boost_USE_MULTITHREADED TRUE)
- ENDIF()
-
- if(Boost_FIND_VERSION_EXACT)
- # The version may appear in a directory with or without the patch
- # level, even when the patch level is non-zero.
- set(_boost_TEST_VERSIONS
- "${Boost_FIND_VERSION_MAJOR}.${Boost_FIND_VERSION_MINOR}.${Boost_FIND_VERSION_PATCH}"
- "${Boost_FIND_VERSION_MAJOR}.${Boost_FIND_VERSION_MINOR}")
- else(Boost_FIND_VERSION_EXACT)
- # The user has not requested an exact version. Among known
- # versions, find those that are acceptable to the user request.
- set(_Boost_KNOWN_VERSIONS ${Boost_ADDITIONAL_VERSIONS}
- "1.38.0" "1.38" "1.37.0" "1.37"
- "1.36.1" "1.36.0" "1.36" "1.35.1" "1.35.0" "1.35" "1.34.1" "1.34.0"
- "1.34" "1.33.1" "1.33.0" "1.33")
- set(_boost_TEST_VERSIONS)
- if(Boost_FIND_VERSION)
- set(_Boost_FIND_VERSION_SHORT "${Boost_FIND_VERSION_MAJOR}.${Boost_FIND_VERSION_MINOR}")
- # Select acceptable versions.
- foreach(version ${_Boost_KNOWN_VERSIONS})
- if(NOT "${version}" VERSION_LESS "${Boost_FIND_VERSION}")
- # This version is high enough.
- list(APPEND _boost_TEST_VERSIONS "${version}")
- elseif("${version}.99" VERSION_EQUAL "${_Boost_FIND_VERSION_SHORT}.99")
- # This version is a short-form for the requested version with
- # the patch level dropped.
- list(APPEND _boost_TEST_VERSIONS "${version}")
- endif()
- endforeach(version)
- else(Boost_FIND_VERSION)
- # Any version is acceptable.
- set(_boost_TEST_VERSIONS "${_Boost_KNOWN_VERSIONS}")
- endif(Boost_FIND_VERSION)
- 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)
############################################
#
--- 161,169 ----
#
+ #-------------------------------------------------------------------------------
+ # FindBoost functions & macros
+ #
############################################
#
***************
*** 212,215 ****
--- 175,179 ----
# original authors of the FindQt4.cmake file. Only minor modifications were
# made to remove references to Qt and make this file more generally applicable
+ # And ELSE/ENDIF pairs were removed for readability.
#########################################################################
***************
*** 221,231 ****
IF (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
SET(Boost_${basename}_LIBRARY optimized ${Boost_${basename}_LIBRARY_RELEASE} debug ${Boost_${basename}_LIBRARY_DEBUG})
! ELSE(CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
# if there are no configuration types and CMAKE_BUILD_TYPE has no value
# then just use the release libraries
SET(Boost_${basename}_LIBRARY ${Boost_${basename}_LIBRARY_RELEASE} )
! ENDIF(CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
SET(Boost_${basename}_LIBRARIES optimized ${Boost_${basename}_LIBRARY_RELEASE} debug ${Boost_${basename}_LIBRARY_DEBUG})
! ENDIF (Boost_${basename}_LIBRARY_DEBUG AND Boost_${basename}_LIBRARY_RELEASE)
# if only the release version was found, set the debug variable also to the release version
--- 185,196 ----
IF (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
SET(Boost_${basename}_LIBRARY optimized ${Boost_${basename}_LIBRARY_RELEASE} debug ${Boost_${basename}_LIBRARY_DEBUG})
! ELSE()
# if there are no configuration types and CMAKE_BUILD_TYPE has no value
# then just use the release libraries
SET(Boost_${basename}_LIBRARY ${Boost_${basename}_LIBRARY_RELEASE} )
! ENDIF()
! # FIXME: This probably should be set for both cases
SET(Boost_${basename}_LIBRARIES optimized ${Boost_${basename}_LIBRARY_RELEASE} debug ${Boost_${basename}_LIBRARY_DEBUG})
! ENDIF()
# if only the release version was found, set the debug variable also to the release version
***************
*** 234,238 ****
SET(Boost_${basename}_LIBRARY ${Boost_${basename}_LIBRARY_RELEASE})
SET(Boost_${basename}_LIBRARIES ${Boost_${basename}_LIBRARY_RELEASE})
! ENDIF (Boost_${basename}_LIBRARY_RELEASE AND NOT Boost_${basename}_LIBRARY_DEBUG)
# if only the debug version was found, set the release variable also to the debug version
--- 199,203 ----
SET(Boost_${basename}_LIBRARY ${Boost_${basename}_LIBRARY_RELEASE})
SET(Boost_${basename}_LIBRARIES ${Boost_${basename}_LIBRARY_RELEASE})
! ENDIF()
# if only the debug version was found, set the release variable also to the debug version
***************
*** 241,245 ****
SET(Boost_${basename}_LIBRARY ${Boost_${basename}_LIBRARY_DEBUG})
SET(Boost_${basename}_LIBRARIES ${Boost_${basename}_LIBRARY_DEBUG})
! ENDIF (Boost_${basename}_LIBRARY_DEBUG AND NOT Boost_${basename}_LIBRARY_RELEASE)
IF (Boost_${basename}_LIBRARY)
--- 206,210 ----
SET(Boost_${basename}_LIBRARY ${Boost_${basename}_LIBRARY_DEBUG})
SET(Boost_${basename}_LIBRARIES ${Boost_${basename}_LIBRARY_DEBUG})
! ENDIF()
IF (Boost_${basename}_LIBRARY)
***************
*** 256,260 ****
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)
ENDIF (Boost_INCLUDE_DIR )
--- 221,225 ----
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)
ENDIF (Boost_INCLUDE_DIR )
***************
*** 267,270 ****
--- 232,237 ----
ENDMACRO (_Boost_ADJUST_LIB_VARS)
+ #-------------------------------------------------------------------------------
+
#
# Runs compiler with "-dumpversion" and parses major/minor
***************
*** 283,290 ****
ENDFUNCTION()
!
#-------------------------------------------------------------------------------
SET( _boost_IN_CACHE TRUE)
IF(Boost_INCLUDE_DIR)
--- 250,304 ----
ENDFUNCTION()
! #
! # End functions/macros
! #
#-------------------------------------------------------------------------------
+
+
+ IF(NOT DEFINED Boost_USE_MULTITHREADED)
+ SET(Boost_USE_MULTITHREADED TRUE)
+ ENDIF()
+
+ if(Boost_FIND_VERSION_EXACT)
+ # The version may appear in a directory with or without the patch
+ # level, even when the patch level is non-zero.
+ set(_boost_TEST_VERSIONS
+ "${Boost_FIND_VERSION_MAJOR}.${Boost_FIND_VERSION_MINOR}.${Boost_FIND_VERSION_PATCH}"
+ "${Boost_FIND_VERSION_MAJOR}.${Boost_FIND_VERSION_MINOR}")
+ else(Boost_FIND_VERSION_EXACT)
+ # The user has not requested an exact version. Among known
+ # versions, find those that are acceptable to the user request.
+ set(_Boost_KNOWN_VERSIONS ${Boost_ADDITIONAL_VERSIONS}
+ "1.38.0" "1.38" "1.37.0" "1.37"
+ "1.36.1" "1.36.0" "1.36" "1.35.1" "1.35.0" "1.35" "1.34.1" "1.34.0"
+ "1.34" "1.33.1" "1.33.0" "1.33")
+ set(_boost_TEST_VERSIONS)
+ if(Boost_FIND_VERSION)
+ set(_Boost_FIND_VERSION_SHORT "${Boost_FIND_VERSION_MAJOR}.${Boost_FIND_VERSION_MINOR}")
+ # Select acceptable versions.
+ foreach(version ${_Boost_KNOWN_VERSIONS})
+ if(NOT "${version}" VERSION_LESS "${Boost_FIND_VERSION}")
+ # This version is high enough.
+ list(APPEND _boost_TEST_VERSIONS "${version}")
+ elseif("${version}.99" VERSION_EQUAL "${_Boost_FIND_VERSION_SHORT}.99")
+ # This version is a short-form for the requested version with
+ # the patch level dropped.
+ list(APPEND _boost_TEST_VERSIONS "${version}")
+ endif()
+ endforeach(version)
+ else(Boost_FIND_VERSION)
+ # Any version is acceptable.
+ set(_boost_TEST_VERSIONS "${_Boost_KNOWN_VERSIONS}")
+ endif(Boost_FIND_VERSION)
+ 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)
+
+
SET( _boost_IN_CACHE TRUE)
IF(Boost_INCLUDE_DIR)
More information about the Cmake-commits
mailing list