Please find the patch attached to this email.
Let me know if anything is wrong.

Best,
Guillaume

On 10/16/2014 05:09 PM, Chuck Atkins wrote:
Guillaume,

Please see CONTRIBUTING.rst in the top level of the CMake source tree. If you can please create and post a patch against cmake master then I'll work on getting it merged into cmake next. Thanks for the bug fix!

- Chuck

On Thu, Oct 16, 2014 at 10:32 AM, Chuck Atkins <chuck.atk...@kitware.com <mailto:chuck.atk...@kitware.com>> wrote:

This looks like a reasonable way to accomplish this right now. The underlying prioblem is that ther's no way to specify which
    path types get re-rooted and which don't.  Ideally you'd want to
    be able to specify in the toolchain for something like this that
    all paths operate in "ONLY" mode except HINTS, which you would
    want to place in NEVER mode.  I'm currently working on just such a
    feature but in the meantime, forcing it like this in the FindBoost
    module looks reasonable.



>From 136f1362f466e5ed54e5d1b969f08d37c03d7be4 Mon Sep 17 00:00:00 2001
From: Guillaume Papin <guillaume.pa...@parrot.com>
Date: Thu, 23 Oct 2014 09:10:54 +0200
Subject: [PATCH] FindBoost: fix find_library call when using "re-rooting"

When using CMAKE_FIND_ROOT_PATH, FindBoost was able to find the first
component and cache the full-path of the directory in Boost_LIBRARY_DIR
so that all components were looked in same directory. The issue was
that, when looking for the other components, Boost_LIBRARY_DIR was
re-rooted against CMAKE_FIND_ROOT_PATH even though it was already a path
on the host. This change fix this by disabling the re-rooting in the
find_library call when using Boost_LIBRARY_DIR as a hint.

See http://www.cmake.org/pipermail/cmake-developers/2014-October/011670.html
---
 Modules/FindBoost.cmake | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Modules/FindBoost.cmake b/Modules/FindBoost.cmake
index 3642b3e..aad6575 100644
--- a/Modules/FindBoost.cmake
+++ b/Modules/FindBoost.cmake
@@ -321,7 +321,7 @@ macro(_Boost_FIND_LIBRARY var)
 
   # If Boost_LIBRARY_DIR is known then search only there.
   if(Boost_LIBRARY_DIR)
-    set(_boost_LIBRARY_SEARCH_DIRS ${Boost_LIBRARY_DIR} NO_DEFAULT_PATH)
+    set(_boost_LIBRARY_SEARCH_DIRS ${Boost_LIBRARY_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
   endif()
 endmacro()
 
@@ -855,7 +855,7 @@ if(_Boost_CHANGE_LIBDIR AND NOT _Boost_LIBRARY_DIR_CHANGED)
 endif()
 
 if(Boost_LIBRARY_DIR)
-  set(_boost_LIBRARY_SEARCH_DIRS ${Boost_LIBRARY_DIR} NO_DEFAULT_PATH)
+  set(_boost_LIBRARY_SEARCH_DIRS ${Boost_LIBRARY_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
 else()
   set(_boost_LIBRARY_SEARCH_DIRS "")
   if(BOOST_LIBRARYDIR)
-- 
1.9.1

-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers

Reply via email to