From a4ba5b6bf6ee8dc10e619a4e8eef430c97fa49b9 Mon Sep 17 00:00:00 2001 From: Florian Sowade Date: Wed, 9 Dec 2009 04:49:19 +0100 Subject: Added CMAKE_PREFIX_PATH to environment valriables CMake ignores the CPPFLAGS and LDFLAGS environment variables. This makes sure CMake finds libraries when homebrew is not installed at /usr/local. Signed-off-by: Max Howell Fixes #242--- Library/Homebrew/extend/ENV.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Library/Homebrew/extend/ENV.rb b/Library/Homebrew/extend/ENV.rb index 7cd519936..b652be242 100644 --- a/Library/Homebrew/extend/ENV.rb +++ b/Library/Homebrew/extend/ENV.rb @@ -36,6 +36,8 @@ module HomebrewEnvExtension # /usr/local is already an -isystem and -L directory so we skip it ENV['CPPFLAGS'] = "-isystem #{HOMEBREW_PREFIX}/include" ENV['LDFLAGS'] = "-L#{HOMEBREW_PREFIX}/lib" + # CMake ignores the variables above + ENV['CMAKE_PREFIX_PATH'] = "#{HOMEBREW_PREFIX}" else # ignore existing build vars, thus we should have less bugs to deal with ENV['CPPFLAGS'] = '' @@ -169,6 +171,8 @@ module HomebrewEnvExtension # CPPFLAGS are the C-PreProcessor flags, *not* C++! append 'CPPFLAGS', '-I/usr/X11R6/include' append 'LDFLAGS', '-L/usr/X11R6/lib' + # CMake ignores the variables above + append 'CMAKE_PREFIX_PATH', '/usr/X11R6', ':' end alias_method :libpng, :x11 # we've seen some packages fail to build when warnings are disabled! -- cgit v1.2.3