Skip to content

Commit

Permalink
use non-Cellar OpenSSL path for macOS
Browse files Browse the repository at this point in the history
removes the dependency on a specific version, as long as the installed
version is 1.0.x. Also set the appropriate environment flags for OpenSSL
 on macOS.

Note: the setting of these two environment variables would be better
suited to a user's `~/.bash_profile` rather than being done within
CMake, as doing it here is destructive.
  • Loading branch information
Fuzzbawls committed Jun 10, 2019
1 parent 69b0032 commit ca2fd10
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ cmake_minimum_required(VERSION 3.10)
project(PIVX)

set(BDB_VER "4.8.30")
set(OPENSSL_VER "1.0.2r")
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/contrib/cmake")
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 ")
Expand All @@ -11,9 +10,11 @@ include(${CMAKE_ROOT}/Modules/ExternalProject.cmake)
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
message(STATUS "Compiling on macOS")
list(APPEND CMAKE_PREFIX_PATH /usr/local/opt/qt5)
list(APPEND CMAKE_PREFIX_PATH /usr/local/Cellar/openssl/${OPENSSL_VER})
list(APPEND CMAKE_PREFIX_PATH /usr/local/opt/openssl)
list(APPEND CMAKE_PREFIX_PATH /usr/local/Cellar/berkeley-db@4)
set(OPENSSL_ROOT_DIR "/usr/local/Cellar/openssl/${OPENSSL_VER}/")
set(OPENSSL_ROOT_DIR "/usr/local/opt/openssl/")
set(ENV{CPPFLAGS} "-I${OPENSSL_ROOT_DIR}/include")
set(ENV{LDFLAGS} "-L${OPENSSL_ROOT_DIR}/lib")
set(BerkeleyDB_ROOT_DIR "/usr/local/Cellar/berkeley-db@4/${BDB_VER}/")
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
file(READ "/proc/version" _SYS_VERSION)
Expand Down

0 comments on commit ca2fd10

Please sign in to comment.