Making FindBoost prefer Boost_ROOT

Matthew Woehlke mw_triad at users.sourceforge.net
Wed Mar 26 22:25:58 GMT 2008


Matthew Woehlke wrote:
> In order to get my Boost_ROOT honored rather than the system boost in 
> /usr/include (which is too old), I had to make the following changes to 
> FindBoost.cmake (this is from kdevplatform, but I've had to copy the 
> module to pimlibs and now kdesdk also, due to the module from cmake 
> 2.4.6 being similarly inadequate). Should I commit this?
> 
> CC'ing also the cmake list, as I'm not sure what to do about this as far 
> as upstream; maybe someone will have comments.

In addition, I'm used to environment variables being all-caps. Is 
FindBoost intentionally deviating here, or was this a search-and-replace 
oops? If not, how would people feel about applying this?

===================================================================
--- cmake/modules/FindBoost.cmake       (revision 790531)
+++ cmake/modules/FindBoost.cmake       (working copy)
@@ -196,6 +196,11 @@
      SET(_boost_LIBRARIES_SEARCH_DIRS $ENV{Boost_ROOT}/lib 
${_boost_INCLUDE_SEARCH_DIRS})
    ENDIF( NOT $ENV{Boost_ROOT} STREQUAL "" )

+  IF( NOT $ENV{BOOST_ROOT} STREQUAL "" )
+    SET(_boost_INCLUDE_SEARCH_DIRS $ENV{BOOST_ROOT}/include 
${_boost_INCLUDE_SEARCH_DIRS})
+    SET(_boost_LIBRARIES_SEARCH_DIRS $ENV{BOOST_ROOT}/lib 
${_boost_INCLUDE_SEARCH_DIRS})
+  ENDIF( NOT $ENV{BOOST_ROOT} STREQUAL "" )
+
    IF( NOT $ENV{Boost_INCLUDEDIR} STREQUAL "" )
      SET(_boost_INCLUDE_SEARCH_DIRS $ENV{Boost_INCLUDEDIR} 
${_boost_INCLUDE_SEARCH_DIRS})
    ENDIF( NOT $ENV{Boost_INCLUDEDIR} STREQUAL "" )

(I can do likewise for Boost_INCLUDEDIR and Boost_LIBRARYDIR if desired...)

-- 
Matthew
I'm anti-ascii. Probably because I once worked with a guy who sent EVERY 
BLOODY DESIGN SCHEMA as an ascii art thing. A year into that job and I 
just about wanted to punch him in the head with an ascii fist. He 
totally ruined ascii porn for me even. -- Aaron Seigo





More information about the kde-core-devel mailing list