Files
cgal/Installation/cmake/modules/CGAL_SetupBoost.cmake
T
Laurent Rineau c6c0a606ce Remove the variable Boost_DIR from the CMake cache
The CMake module FindBoost.cmake searchs for Boost first in the "Config
mode" of 'find_package'. That allows to find installation of boost-cmake
(that is Boost configured using CMake). That configuration of Boost is
rather rare. But the search for it leaves a variable Boost_DIR=NOTFOUND in
the cache, even if Boost libraries are found using the regular way.

That patch removes from the cache the variable Boost_DIR, when Boost is
already found, to avoid more confusion for users.
2013-03-18 16:17:04 +01:00

39 lines
1.3 KiB
CMake

if ( NOT CGAL_Boost_Setup )
include(CGAL_TweakFindBoost)
# In the documentation, we say we require Boost-1.39, but technically we
# require 1.33.1. Some packages may require more recent versions, though.
find_package( Boost 1.33.1 REQUIRED thread system )
if(Boost_FOUND)
if(DEFINED Boost_DIR AND NOT Boost_DIR)
# Unset that cache variable that is set in the cache by FindBoost
# (while it was searching for boost-cmake).
unset(Boost_DIR CACHE)
set(Boost_NO_BOOST_CMAKE TRUE CACHE INTERNAL "Avoid future search of boost-cmake")
endif()
endif()
message( STATUS "Boost include: ${Boost_INCLUDE_DIRS}" )
message( STATUS "Boost libraries: ${Boost_LIBRARIES}" )
message( STATUS "Boost definitions: ${Boost_DEFINITIONS}" )
set ( CGAL_USE_BOOST 1 )
include(CGAL_Macros)
add_to_cached_list(CGAL_3RD_PARTY_INCLUDE_DIRS ${Boost_INCLUDE_DIRS} )
add_to_cached_list(CGAL_3RD_PARTY_LIBRARIES_DIRS ${Boost_LIBRARY_DIRS} )
add_to_cached_list(CGAL_3RD_PARTY_DEFINITIONS ${Boost_DEFINITIONS} )
if ( NOT MSVC )
add_to_cached_list(CGAL_3RD_PARTY_LIBRARIES ${Boost_LIBRARIES} )
endif()
message( STATUS "USING BOOST_VERSION = '${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}'" )
set ( CGAL_Boost_Setup TRUE )
endif()