Improve openssl directory finding

This commit is contained in:
seelabs
2016-10-18 14:18:41 -04:00
parent 7688a97d95
commit cdaafeb4b6
2 changed files with 14 additions and 9 deletions

View File

@@ -294,10 +294,13 @@ macro(find_pthread)
endmacro() endmacro()
macro(find_openssl openssl_min) macro(find_openssl openssl_min)
if (APPLE) if (APPLE AND NOT DEFINED ENV{OPENSSL_ROOT_DIR})
# swd TBD fixme find_program(HOMEBREW brew)
file(GLOB OPENSSL_ROOT_DIR /usr/local/Cellar/openssl/*) if (NOT HOMEBREW STREQUAL "HOMEBREW-NOTFOUND")
# set(OPENSSL_ROOT_DIR /usr/local/Cellar/openssl) execute_process(COMMAND brew --prefix openssl
OUTPUT_VARIABLE OPENSSL_ROOT_DIR
OUTPUT_STRIP_TRAILING_WHITESPACE)
endif()
endif() endif()
if (WIN32) if (WIN32)

View File

@@ -385,11 +385,13 @@ def config_base(env):
except KeyError: except KeyError:
pass pass
elif Beast.system.osx: elif Beast.system.osx:
OSX_OPENSSL_ROOT = '/usr/local/Cellar/openssl/' try:
most_recent = sorted(os.listdir(OSX_OPENSSL_ROOT))[-1] openssl = subprocess.check_output(['brew', '--prefix','openssl'],
openssl = os.path.join(OSX_OPENSSL_ROOT, most_recent) stderr=subprocess.STDOUT).strip()
env.Prepend(CPPPATH='%s/include' % openssl) env.Prepend(CPPPATH='%s/include' % openssl)
env.Prepend(LIBPATH=['%s/lib' % openssl]) env.Prepend(LIBPATH=['%s/lib' % openssl])
except:
pass
if not 'vcxproj' in COMMAND_LINE_TARGETS: if not 'vcxproj' in COMMAND_LINE_TARGETS:
env.Append(CPPDEFINES=['NO_LOG_UNHANDLED_EXCEPTIONS']) env.Append(CPPDEFINES=['NO_LOG_UNHANDLED_EXCEPTIONS'])