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 <max@methylblue.com> Fixes Homebrew/homebrew#242
This commit is contained in:
parent
fa2162ef62
commit
056851463e
@ -36,6 +36,8 @@ module HomebrewEnvExtension
|
|||||||
# /usr/local is already an -isystem and -L directory so we skip it
|
# /usr/local is already an -isystem and -L directory so we skip it
|
||||||
ENV['CPPFLAGS'] = "-isystem #{HOMEBREW_PREFIX}/include"
|
ENV['CPPFLAGS'] = "-isystem #{HOMEBREW_PREFIX}/include"
|
||||||
ENV['LDFLAGS'] = "-L#{HOMEBREW_PREFIX}/lib"
|
ENV['LDFLAGS'] = "-L#{HOMEBREW_PREFIX}/lib"
|
||||||
|
# CMake ignores the variables above
|
||||||
|
ENV['CMAKE_PREFIX_PATH'] = "#{HOMEBREW_PREFIX}"
|
||||||
else
|
else
|
||||||
# ignore existing build vars, thus we should have less bugs to deal with
|
# ignore existing build vars, thus we should have less bugs to deal with
|
||||||
ENV['CPPFLAGS'] = ''
|
ENV['CPPFLAGS'] = ''
|
||||||
@ -169,6 +171,8 @@ module HomebrewEnvExtension
|
|||||||
# CPPFLAGS are the C-PreProcessor flags, *not* C++!
|
# CPPFLAGS are the C-PreProcessor flags, *not* C++!
|
||||||
append 'CPPFLAGS', '-I/usr/X11R6/include'
|
append 'CPPFLAGS', '-I/usr/X11R6/include'
|
||||||
append 'LDFLAGS', '-L/usr/X11R6/lib'
|
append 'LDFLAGS', '-L/usr/X11R6/lib'
|
||||||
|
# CMake ignores the variables above
|
||||||
|
append 'CMAKE_PREFIX_PATH', '/usr/X11R6', ':'
|
||||||
end
|
end
|
||||||
alias_method :libpng, :x11
|
alias_method :libpng, :x11
|
||||||
# we've seen some packages fail to build when warnings are disabled!
|
# we've seen some packages fail to build when warnings are disabled!
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user