From b70964518109ca1a840025fb334b5332ec462988 Mon Sep 17 00:00:00 2001 From: Roland Kaufmann Date: Wed, 20 Mar 2013 09:58:07 +0100 Subject: [PATCH] Don't search in system dir if explicit dir given If we give an explicit directory path it is because we want a special version to be used instead of the system version; if there is any problems with that, we should know up-front instead of silently start using the system version again! --- cmake/Modules/OpmFind.cmake | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cmake/Modules/OpmFind.cmake b/cmake/Modules/OpmFind.cmake index 8336ae47..273c78c4 100644 --- a/cmake/Modules/OpmFind.cmake +++ b/cmake/Modules/OpmFind.cmake @@ -61,6 +61,14 @@ set (_opm_proj_exemptions # insert this boilerplate whenever we are going to find a new package macro (find_and_append_package_to prefix name) + # special handling for Boost to avoid inadvertedly picking up system + # libraries when we want our own version. this is done here because + # having a custom Boost is common, but the logic to search only there + # does not follow any particular convention. + if (BOOST_ROOT AND NOT DEFINED Boost_NO_SYSTEM_PATHS) + set (Boost_NO_SYSTEM_PATHS TRUE) + endif (BOOST_ROOT AND NOT DEFINED Boost_NO_SYSTEM_PATHS) + # if we have specified a directory, don't revert to searching the # system default paths afterwards string (TOUPPER "${name}" NAME)