Skip to content

Commit ca2fd10

Browse files
committed
use non-Cellar OpenSSL path for macOS
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.
1 parent 69b0032 commit ca2fd10

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

CMakeLists.txt

+4-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ cmake_minimum_required(VERSION 3.10)
22
project(PIVX)
33

44
set(BDB_VER "4.8.30")
5-
set(OPENSSL_VER "1.0.2r")
65
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/contrib/cmake")
76
set(CMAKE_CXX_STANDARD 11)
87
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 ")
@@ -11,9 +10,11 @@ include(${CMAKE_ROOT}/Modules/ExternalProject.cmake)
1110
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
1211
message(STATUS "Compiling on macOS")
1312
list(APPEND CMAKE_PREFIX_PATH /usr/local/opt/qt5)
14-
list(APPEND CMAKE_PREFIX_PATH /usr/local/Cellar/openssl/${OPENSSL_VER})
13+
list(APPEND CMAKE_PREFIX_PATH /usr/local/opt/openssl)
1514
list(APPEND CMAKE_PREFIX_PATH /usr/local/Cellar/berkeley-db@4)
16-
set(OPENSSL_ROOT_DIR "/usr/local/Cellar/openssl/${OPENSSL_VER}/")
15+
set(OPENSSL_ROOT_DIR "/usr/local/opt/openssl/")
16+
set(ENV{CPPFLAGS} "-I${OPENSSL_ROOT_DIR}/include")
17+
set(ENV{LDFLAGS} "-L${OPENSSL_ROOT_DIR}/lib")
1718
set(BerkeleyDB_ROOT_DIR "/usr/local/Cellar/berkeley-db@4/${BDB_VER}/")
1819
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
1920
file(READ "/proc/version" _SYS_VERSION)

0 commit comments

Comments
 (0)