fix for mac
This commit is contained in:
parent
5a0f996333
commit
73dd2d68ea
2 changed files with 12 additions and 9 deletions
|
|
@ -312,8 +312,10 @@ ELSE()
|
||||||
SET (OPENSSL_CONF_TARGET ${CMAKE_CURRENT_BINARY_DIR})
|
SET (OPENSSL_CONF_TARGET ${CMAKE_CURRENT_BINARY_DIR})
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
|
IF(WIN32)
|
||||||
SET(POST_BUILD_STEP_COMMANDS ${POST_BUILD_STEP_COMMANDS}
|
SET(POST_BUILD_STEP_COMMANDS ${POST_BUILD_STEP_COMMANDS}
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different "${OPENSSL_ROOT_DIR}/ssl/openssl.cnf" "${OPENSSL_CONF_TARGET}/openssl.cnf")
|
COMMAND ${CMAKE_COMMAND} -E copy_if_different "${OPENSSL_ROOT_DIR}/ssl/openssl.cnf" "${OPENSSL_CONF_TARGET}/openssl.cnf")
|
||||||
|
ENDIF(WIN32)
|
||||||
|
|
||||||
ADD_CUSTOM_COMMAND(TARGET fc POST_BUILD ${POST_BUILD_STEP_COMMANDS}
|
ADD_CUSTOM_COMMAND(TARGET fc POST_BUILD ${POST_BUILD_STEP_COMMANDS}
|
||||||
COMMENT "Copying OpenSSL/ssl/openssl.cnf into target directory."
|
COMMENT "Copying OpenSSL/ssl/openssl.cnf into target directory."
|
||||||
|
|
|
||||||
|
|
@ -6,12 +6,13 @@
|
||||||
|
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
namespace fc
|
namespace fc
|
||||||
{
|
{
|
||||||
struct openssl_scope
|
struct openssl_scope
|
||||||
{
|
{
|
||||||
static path _configurationFilePath;
|
static path _configurationFilePath;
|
||||||
openssl_scope()
|
openssl_scope()
|
||||||
{
|
{
|
||||||
ERR_load_crypto_strings();
|
ERR_load_crypto_strings();
|
||||||
|
|
@ -19,11 +20,11 @@ namespace fc
|
||||||
|
|
||||||
const boost::filesystem::path& boostPath = _configurationFilePath;
|
const boost::filesystem::path& boostPath = _configurationFilePath;
|
||||||
if(boostPath.empty() == false)
|
if(boostPath.empty() == false)
|
||||||
{
|
{
|
||||||
std::string varSetting("OPENSSL_CONF=");
|
std::string varSetting("OPENSSL_CONF=");
|
||||||
varSetting += _configurationFilePath.to_native_ansi_path();
|
varSetting += _configurationFilePath.to_native_ansi_path();
|
||||||
putenv(varSetting.c_str());
|
putenv((char*)varSetting.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
OPENSSL_config(nullptr);
|
OPENSSL_config(nullptr);
|
||||||
}
|
}
|
||||||
|
|
@ -38,9 +39,9 @@ namespace fc
|
||||||
path openssl_scope::_configurationFilePath;
|
path openssl_scope::_configurationFilePath;
|
||||||
|
|
||||||
void store_configuration_path(const path& filePath)
|
void store_configuration_path(const path& filePath)
|
||||||
{
|
{
|
||||||
openssl_scope::_configurationFilePath = filePath;
|
openssl_scope::_configurationFilePath = filePath;
|
||||||
}
|
}
|
||||||
|
|
||||||
int init_openssl()
|
int init_openssl()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue