Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Variable cleaning fix for Mac OS X bug. #18

Merged
merged 1 commit into from
Oct 6, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 18 additions & 11 deletions external/CMake/add_boost.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,14 @@ foreach(Component ${BoostComponents})
set(BoostComponentsDir OFF)
endif()

# Need to unset these too, otherwise other find_package calls willl not update them.
unset("${Boost_${ComponentUpper}_FOUND}" CACHE)
unset("${Boost_${ComponentUpper}_LIBRARY}" CACHE)
# Need to unset these too, otherwise other find_package calls willl not update them. Also some are put in current scope and cache
unset("Boost_${ComponentUpper}_FOUND")
unset("Boost_${ComponentUpper}_LIBRARY")
unset("Boost_${ComponentUpper}_FOUND" CACHE)
unset("Boost_${ComponentUpper}_LIBRARY" CACHE)
unset("Boost_${ComponentUpper}_LIBRARIES")
unset("Boost_${ComponentUpper}_LIBRARY_DEBUG" CACHE)
unset("Boost_${ComponentUpper}_LIBRARY_RELEASE" CACHE)

# Exit the for loop if a single component fails
if(NOT ${BoostComponentsDir})
Expand All @@ -123,17 +128,19 @@ foreach(Component ${BoostComponents})
endforeach()

# Unset all variable from find_package(Boost), preventing future usages of this macro becoming lazy.
unset(Boost_FOUND CACHE)
unset(Boost_INCLUDE_DIRS CACHE)
# As before some variables are also cached, so need double cleaning
unset(Boost_FOUND)
unset(Boost_INCLUDE_DIRS)
unset(Boost_LIBRARY_DIRS)
unset(Boost_LIBRARY_DIRS CACHE)
unset(Boost_LIBRARIES CACHE)
unset(Boost_LIBRARIES)
unset(Boost_VERSION)
unset(Boost_VERSION CACHE)
unset(Boost_LIB_VERSION)
unset(Boost_LIB_VERSION CACHE)
unset(Boost_MAJOR_VERSION CACHE)
unset(Boost_MINOR_VERSION CACHE)
unset(Boost_SUBMINOR_VERSION CACHE)
unset(Boost_LIB_DIAGNOSTIC_DEFINITIONS CACHE)
endif()
unset(Boost_MAJOR_VERSION)
unset(Boost_MINOR_VERSION)
unset(Boost_SUBMINOR_VERSION)

# Check if all components were found and if their location is local and not on the system.
if(${BoostComponentsFound} AND ${BoostComponentsDir})
Expand Down