peerplays-fc/CMakeLists.txt

497 lines
18 KiB
CMake
Raw Normal View History

#
# Defines fc library target.
2012-09-08 02:50:37 +00:00
PROJECT( fc )
CMAKE_MINIMUM_REQUIRED( VERSION 2.8.12 )
2012-09-08 02:50:37 +00:00
MESSAGE(STATUS "Configuring project fc located in: ${CMAKE_CURRENT_SOURCE_DIR}")
SET( CMAKE_AUTOMOC OFF )
2012-09-08 02:50:37 +00:00
# Setup module path to make visible used CMake extensions
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/GitVersionGen")
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules")
2012-09-08 02:50:37 +00:00
INCLUDE(GetPrerequisites)
2012-09-08 02:50:37 +00:00
INCLUDE( VersionMacros )
INCLUDE( SetupTargetMacros )
INCLUDE(GetGitRevisionDescription)
2012-09-08 02:50:37 +00:00
get_git_head_revision(GIT_REFSPEC FC_GIT_REVISION_SHA)
get_git_unix_timestamp(FC_GIT_REVISION_UNIX_TIMESTAMP)
2012-09-08 02:50:37 +00:00
SET( DEFAULT_HEADER_INSTALL_DIR include/\${target} )
SET( DEFAULT_LIBRARY_INSTALL_DIR lib/ )
SET( DEFAULT_EXECUTABLE_INSTALL_DIR bin/ )
SET( CMAKE_DEBUG_POSTFIX _debug )
SET( BUILD_SHARED_LIBS NO )
2015-06-12 13:50:56 +00:00
SET( ECC_IMPL secp256k1 CACHE STRING "secp256k1 or openssl or mixed" )
2012-09-08 02:50:37 +00:00
set(platformBitness 32)
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(platformBitness 64)
endif()
SET (ORIGINAL_LIB_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})
2012-09-08 02:50:37 +00:00
SET(BOOST_COMPONENTS)
2014-07-03 02:36:10 +00:00
LIST(APPEND BOOST_COMPONENTS thread date_time system filesystem program_options signals serialization chrono unit_test_framework context locale iostreams)
SET( Boost_USE_STATIC_LIBS ON CACHE STRING "ON or OFF" )
2015-05-27 15:26:04 +00:00
IF( ECC_IMPL STREQUAL openssl )
SET( ECC_REST src/crypto/elliptic_impl_pub.cpp )
ELSE( ECC_IMPL STREQUAL openssl )
SET( ECC_LIB secp256k1 )
IF( ECC_IMPL STREQUAL mixed )
SET( ECC_REST src/crypto/elliptic_impl_priv.cpp src/crypto/elliptic_impl_pub.cpp )
ELSE( ECC_IMPL STREQUAL mixed )
SET( ECC_REST src/crypto/elliptic_impl_priv.cpp )
ENDIF( ECC_IMPL STREQUAL mixed )
ENDIF( ECC_IMPL STREQUAL openssl )
2015-03-07 13:48:45 +00:00
2015-06-13 17:39:43 +00:00
# Configure secp256k1-zkp
if ( WIN32 )
# autoconf won't work here, hard code the defines
set( SECP256K1_DIR "${CMAKE_CURRENT_SOURCE_DIR}/vendor/secp256k1-zkp" )
2015-06-26 15:14:02 +00:00
file( GLOB SECP256K1_SOURCES "${SECP256K1_DIR}/src/secp256k1.c" )
add_library( secp256k1 ${SECP256K1_SOURCES} )
2015-06-26 15:14:02 +00:00
target_include_directories( secp256k1 PRIVATE "${SECP256K1_DIR}" PUBLIC "${SECP256K1_DIR}/include" )
2015-06-26 15:14:02 +00:00
set( SECP256K1_BUILD_DEFINES
USE_FIELD_10X26
USE_FIELD_INV_BUILTIN
USE_NUM_NONE
USE_SCALAR_8X32
USE_SCALAR_INV_BUILTIN )
set_target_properties( secp256k1 PROPERTIES COMPILE_DEFINITIONS "${SECP256K1_BUILD_DEFINES}" LINKER_LANGUAGE C )
else ( WIN32 )
include(ExternalProject)
ExternalProject_Add( project_secp256k1
PREFIX ${CMAKE_CURRENT_BINARY_DIR}/vendor/secp256k1-zkp
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/vendor/secp256k1-zkp
CONFIGURE_COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/vendor/secp256k1-zkp/configure --prefix=${CMAKE_CURRENT_BINARY_DIR}/vendor/secp256k1-zkp --with-bignum=no
BUILD_COMMAND make
INSTALL_COMMAND true
2015-06-26 15:14:02 +00:00
BUILD_BYPRODUCTS ${CMAKE_CURRENT_BINARY_DIR}/vendor/secp256k1-zkp/src/project_secp256k1-build/.libs/libsecp256k1.a
)
ExternalProject_Add_Step(project_secp256k1 autogen
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/vendor/secp256k1-zkp
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/vendor/secp256k1-zkp/autogen.sh
DEPENDERS configure
)
ExternalProject_Get_Property(project_secp256k1 binary_dir)
add_library(secp256k1 STATIC IMPORTED)
set_property(TARGET secp256k1 PROPERTY IMPORTED_LOCATION ${binary_dir}/.libs/libsecp256k1${CMAKE_STATIC_LIBRARY_SUFFIX})
set_property(TARGET secp256k1 PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_CURRENT_SOURCE_DIR}/vendor/secp256k1-zkp/include)
add_dependencies(secp256k1 project_secp256k1)
endif ( WIN32 )
2015-06-13 17:39:43 +00:00
# End configure secp256k1-zkp
2012-09-08 02:50:37 +00:00
IF( WIN32 )
MESSAGE(STATUS "Configuring fc to build on Win32")
2012-09-08 02:50:37 +00:00
set( RPCRT4 Rpcrt4 )
2012-09-08 02:50:37 +00:00
#boost
SET(BOOST_ROOT $ENV{BOOST_ROOT})
# set(Boost_USE_DEBUG_PYTHON ON)
set(Boost_USE_MULTITHREADED ON)
set(BOOST_ALL_DYN_LINK OFF) # force dynamic linking for all libraries
FIND_PACKAGE(Boost 1.53 REQUIRED COMPONENTS ${BOOST_COMPONENTS})
# For Boost 1.53 on windows, coroutine was not in BOOST_LIBRARYDIR and do not need it to build, but if boost versin >= 1.54, find coroutine otherwise will cause link errors
IF(NOT "${Boost_VERSION}" MATCHES "1.53(.*)")
SET(BOOST_LIBRARIES_TEMP ${Boost_LIBRARIES})
FIND_PACKAGE(Boost 1.54 REQUIRED COMPONENTS coroutine)
LIST(APPEND BOOST_COMPONENTS coroutine)
SET(Boost_LIBRARIES ${BOOST_LIBRARIES_TEMP} ${Boost_LIBRARIES})
ENDIF()
set( PLATFORM_SPECIFIC_LIBS WS2_32.lib Userenv.lib)
# iphlpapi.lib
2012-09-08 02:50:37 +00:00
ELSE(WIN32)
MESSAGE(STATUS "Configuring fc to build on Unix/Apple")
2012-09-08 02:50:37 +00:00
LIST(APPEND BOOST_COMPONENTS coroutine)
2015-06-13 17:39:43 +00:00
FIND_PACKAGE(Boost 1.53 REQUIRED COMPONENTS ${BOOST_COMPONENTS})
2012-09-08 02:50:37 +00:00
SET(CMAKE_FIND_LIBRARY_SUFFIXES ".a;.so")
2012-09-08 02:50:37 +00:00
2014-12-08 13:57:36 +00:00
IF(NOT APPLE)
# Linux or other unix
SET(rt_library rt )
SET(pthread_library pthread)
ENDIF(NOT APPLE)
ENDIF(WIN32)
2015-04-29 19:41:55 +00:00
IF(NOT "$ENV{OPENSSL_ROOT_DIR}" STREQUAL "")
set(OPENSSL_ROOT_DIR $ENV{OPENSSL_ROOT_DIR} )
set(OPENSSL_INCLUDE_DIR ${OPENSSL_ROOT_DIR}/include)
message(STATUS "Setting up OpenSSL root and include vars to ${OPENSSL_ROOT_DIR}, ${OPENSSL_INCLUDE_DIR}")
2014-06-17 14:58:57 +00:00
ENDIF()
find_package(OpenSSL REQUIRED)
2014-03-11 15:29:29 +00:00
set( CMAKE_FIND_LIBRARY_SUFFIXES ${ORIGINAL_LIB_SUFFIXES} )
option( UNITY_BUILD OFF )
set( fc_sources
2013-07-27 03:20:06 +00:00
src/uint128.cpp
src/real128.cpp
src/variant.cpp
src/exception.cpp
src/variant_object.cpp
src/thread/thread.cpp
2014-08-27 16:20:19 +00:00
src/thread/thread_specific.cpp
src/thread/future.cpp
src/thread/task.cpp
2015-06-13 17:39:43 +00:00
src/thread/spin_lock.cpp
src/thread/spin_yield_lock.cpp
src/thread/mutex.cpp
src/thread/non_preemptable_scope_check.cpp
src/asio.cpp
src/string.cpp
src/shared_ptr.cpp
src/time.cpp
src/utf8.cpp
src/io/iostream.cpp
src/io/datastream.cpp
src/io/buffered_iostream.cpp
src/io/fstream.cpp
src/io/sstream.cpp
src/io/json.cpp
src/io/varint.cpp
src/io/console.cpp
src/filesystem.cpp
src/interprocess/process.cpp
2013-11-24 18:00:21 +00:00
src/interprocess/signals.cpp
src/interprocess/file_mapping.cpp
src/interprocess/mmap_struct.cpp
2015-04-29 19:41:55 +00:00
src/rpc/cli.cpp
src/rpc/http_api.cpp
src/rpc/json_connection.cpp
src/rpc/state.cpp
src/rpc/websocket_api.cpp
2015-06-13 17:39:43 +00:00
src/log/log_message.cpp
src/log/logger.cpp
src/log/appender.cpp
src/log/console_appender.cpp
src/log/file_appender.cpp
src/log/gelf_appender.cpp
src/log/logger_config.cpp
2015-07-29 21:22:34 +00:00
src/crypto/_digest_common.cpp
src/crypto/openssl.cpp
src/crypto/aes.cpp
2013-07-17 15:50:45 +00:00
src/crypto/crc.cpp
src/crypto/city.cpp
src/crypto/base32.cpp
2013-07-17 19:00:13 +00:00
src/crypto/base36.cpp
src/crypto/base58.cpp
2013-07-17 19:00:13 +00:00
src/crypto/base64.cpp
src/crypto/bigint.cpp
src/crypto/hex.cpp
src/crypto/sha1.cpp
2013-07-28 14:49:45 +00:00
src/crypto/ripemd160.cpp
src/crypto/sha256.cpp
src/crypto/sha224.cpp
src/crypto/sha512.cpp
src/crypto/dh.cpp
src/crypto/blowfish.cpp
src/crypto/elliptic_common.cpp
${ECC_REST}
2015-03-06 13:28:25 +00:00
src/crypto/elliptic_${ECC_IMPL}.cpp
2014-04-06 23:16:14 +00:00
src/crypto/rand.cpp
src/network/tcp_socket.cpp
src/network/udp_socket.cpp
src/network/udt_socket.cpp
src/network/http/http_connection.cpp
src/network/http/http_server.cpp
src/network/http/websocket.cpp
2014-06-11 19:17:28 +00:00
src/network/ntp.cpp
src/network/ip.cpp
src/network/rate_limiting.cpp
src/network/resolve.cpp
src/network/url.cpp
2014-08-15 21:02:02 +00:00
src/network/gntp.cpp
src/compress/smaz.cpp
src/compress/zlib.cpp
vendor/cyoencode-1.0.2/src/CyoDecode.c
vendor/cyoencode-1.0.2/src/CyoEncode.c
)
2015-06-13 17:39:43 +00:00
file( GLOB_RECURSE fc_headers ${CMAKE_CURRENT_SOURCE_DIR} *.hpp *.h )
set( sources
${fc_sources}
)
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/src/git_revision.cpp.in" "${CMAKE_CURRENT_BINARY_DIR}/git_revision.cpp" @ONLY)
list(APPEND sources "${CMAKE_CURRENT_BINARY_DIR}/git_revision.cpp")
list(APPEND sources ${fc_headers})
add_subdirectory( vendor/websocketpp )
2014-06-26 15:25:07 +00:00
add_subdirectory( vendor/udt4 )
2012-10-26 05:03:47 +00:00
setup_library( fc SOURCES ${sources} LIBRARY_TYPE STATIC DONT_INSTALL_LIBRARY )
2015-04-29 19:41:55 +00:00
# begin readline stuff
find_package(Curses)
find_package(Readline)
file(GLOB HEADERS "include/bts/cli/*.hpp")
if (READLINE_FOUND)
target_compile_definitions (fc PRIVATE HAVE_READLINE)
set(readline_libraries ${Readline_LIBRARY})
if (CURSES_FOUND)
list(APPEND readline_libraries ${CURSES_LIBRARY})
endif()
set(readline_includes ${Readline_INCLUDE_DIR})
endif()
if(WIN32)
target_compile_definitions( fc PRIVATE _CRT_NONSTDC_NO_DEPRECATE )
endif(WIN32)
# end readline stuff
IF(WIN32)
target_compile_definitions(fc PUBLIC WIN32 NOMINMAX _WIN32_WINNT=0x0501 _CRT_SECURE_NO_WARNINGS
2015-06-13 17:39:43 +00:00
_SCL_SERCURE_NO_WARNINGS
# Needed to disable MSVC autolinking feature (#pragma comment)
BOOST_ALL_NO_LIB
# The current version of websockets doesn't correctly guess what 'chrono' implementation boost::asio uses
2015-06-17 15:03:45 +00:00
# on the recommended build platform of VC++12/boost_1.58. Force it here until websocket gets their
# autodetecting code to do the right thing.
_WEBSOCKETPP_CPP11_CHRONO_
)
# Activate C++ exception handling, assume extern C calls don't throw
2015-06-13 17:39:43 +00:00
# Add /U options to be sure settings specific to dynamic boost link are ineffective
target_compile_options(fc PUBLIC /EHsc /UBOOST_ALL_DYN_LINK /UBOOST_LINKING_PYTHON /UBOOST_DEBUG_PYTHON)
ELSE()
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -Wall")
IF(APPLE)
2014-07-12 21:29:19 +00:00
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -stdlib=libc++ -Wall")
ELSE()
2014-07-24 19:33:56 +00:00
if( NOT "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" )
target_compile_options(fc PUBLIC -std=c++11 -Wall -fnon-call-exceptions)
endif()
2014-07-12 21:29:19 +00:00
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -fnon-call-exceptions")
ENDIF()
ENDIF()
2015-06-13 17:39:43 +00:00
target_include_directories(fc
PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include
${Boost_INCLUDE_DIR}
${OPENSSL_INCLUDE_DIR}
2015-04-29 19:41:55 +00:00
"${readline_includes}"
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/vendor/boost_1.51/include
2015-06-13 17:39:43 +00:00
${CMAKE_CURRENT_SOURCE_DIR}/vendor/cyoencode-1.0.2/src
2014-06-25 01:57:25 +00:00
${CMAKE_CURRENT_SOURCE_DIR}/vendor/udt4/src
${CMAKE_CURRENT_SOURCE_DIR}/vendor/websocketpp
2015-06-13 17:39:43 +00:00
${CMAKE_CURRENT_SOURCE_DIR}/vendor/secp256k1-zkp
)
2015-06-23 20:19:36 +00:00
#target_link_libraries( fc PUBLIC udt ${Boost_LIBRARIES} ${OPENSSL_LIBRARIES} ${ZLIB_LIBRARIES} ${PLATFORM_SPECIFIC_LIBS} ${RPCRT4} ${CMAKE_DL_LIBS} ${rt_library} ${ECC_LIB} )
IF(NOT WIN32)
set(LINK_USR_LOCAL_LIB -L/usr/local/lib)
ENDIF()
target_link_libraries( fc PUBLIC ${LINK_USR_LOCAL_LIB} udt ${Boost_LIBRARIES} ${OPENSSL_LIBRARIES} ${ZLIB_LIBRARIES} ${PLATFORM_SPECIFIC_LIBS} ${RPCRT4} ${CMAKE_DL_LIBS} ${rt_library} ${readline_libraries} ${ECC_LIB} )
if(MSVC)
set_source_files_properties( src/network/http/websocket.cpp PROPERTIES COMPILE_FLAGS "/bigobj" )
endif(MSVC)
2015-04-19 08:14:53 +00:00
IF(NOT Boost_UNIT_TEST_FRAMEWORK_LIBRARY MATCHES "\\.(a|lib)$")
IF(WIN32)
add_definitions(/DBOOST_TEST_DYN_LINK)
ELSE(WIN32)
add_definitions(-DBOOST_TEST_DYN_LINK)
ENDIF(WIN32)
ENDIF()
2015-03-09 22:50:20 +00:00
add_executable( api tests/api.cpp )
target_link_libraries( api fc )
if( ECC_IMPL STREQUAL secp256k1 )
2015-07-24 20:11:29 +00:00
add_executable( blind tests/all_tests.cpp tests/crypto/blind.cpp )
target_link_libraries( blind fc )
endif()
2015-06-10 22:34:19 +00:00
include_directories( vendor/websocketpp )
2015-07-24 20:11:29 +00:00
add_executable( ntp_test tests/all_tests.cpp tests/network/ntp_test.cpp )
2014-06-14 17:48:28 +00:00
target_link_libraries( ntp_test fc )
2014-06-11 19:17:28 +00:00
2015-07-24 20:11:29 +00:00
add_executable( task_cancel_test tests/all_tests.cpp tests/thread/task_cancel.cpp )
target_link_libraries( task_cancel_test fc )
2015-03-09 22:50:20 +00:00
2015-07-23 21:20:17 +00:00
add_executable( bloom_test tests/all_tests.cpp tests/bloom_test.cpp )
target_link_libraries( bloom_test fc )
2015-07-23 20:24:29 +00:00
add_executable( real128_test tests/all_tests.cpp tests/real128_test.cpp )
2014-10-15 21:53:15 +00:00
target_link_libraries( real128_test fc )
2015-07-04 16:48:21 +00:00
add_executable( hmac_test tests/hmac_test.cpp )
target_link_libraries( hmac_test fc )
add_executable( blinding_test tests/blinding_test.cpp )
target_link_libraries( blinding_test fc )
2014-06-25 01:57:25 +00:00
2014-06-26 15:25:07 +00:00
add_executable( udt_server tests/udts.cpp )
target_link_libraries( udt_server fc udt )
2014-06-25 01:57:25 +00:00
2014-06-26 15:25:07 +00:00
add_executable( udt_client tests/udtc.cpp )
target_link_libraries( udt_client fc udt )
2014-06-25 01:57:25 +00:00
2015-07-24 20:11:29 +00:00
add_executable( ecc_test tests/crypto/ecc_test.cpp )
target_link_libraries( ecc_test fc )
2013-11-13 19:51:29 +00:00
#add_executable( test_aes tests/aes_test.cpp )
#target_link_libraries( test_aes fc ${rt_library} ${pthread_library} )
#add_executable( test_sleep tests/sleep.cpp )
#target_link_libraries( test_sleep fc )
2014-05-23 22:09:44 +00:00
#add_executable( test_rate_limiting tests/rate_limiting.cpp )
#target_link_libraries( test_rate_limiting fc )
2015-07-24 20:11:29 +00:00
add_executable( all_tests tests/all_tests.cpp
tests/compress/compress.cpp
tests/crypto/aes_test.cpp
tests/crypto/base_n_tests.cpp
2015-07-26 13:36:49 +00:00
tests/crypto/bigint_test.cpp
2015-07-24 20:11:29 +00:00
tests/crypto/blind.cpp
2015-07-26 15:11:40 +00:00
tests/crypto/blowfish_test.cpp
tests/crypto/dh_test.cpp
tests/crypto/rand_test.cpp
2015-07-27 21:05:39 +00:00
tests/crypto/sha_tests.cpp
2015-07-24 20:11:29 +00:00
tests/network/ntp_test.cpp
2015-08-30 20:15:20 +00:00
tests/network/http/websocket_test.cpp
2015-07-24 20:11:29 +00:00
tests/thread/task_cancel.cpp
2015-07-23 20:57:54 +00:00
tests/bloom_test.cpp
2015-07-23 21:20:17 +00:00
tests/real128_test.cpp
2015-08-23 20:15:47 +00:00
tests/utf8_test.cpp
2015-07-24 20:11:29 +00:00
)
target_link_libraries( all_tests fc )
if(WIN32)
# add addtional import library on windows platform
target_link_libraries( fc PUBLIC crypt32.lib)
# now generate a list of the DLLs we're using to use during the install process
include (ParseLibraryList)
PARSE_LIBRARY_LIST(${Boost_LIBRARIES}
FOUND parseOk
DEBUG Boost_LIBRARIES_DEBUG
OPT Boost_LIBRARIES_RELEASE
GENERAL Boost_LIBRARIES_GENERAL)
#Variable will hold list of .pdb files generated for libraries the 'fc' module is linked to
set(INTERFACE_LINK_PDB_RELEASE)
set(SHARED_LIBRARIES_RELEASE)
foreach(boost_import_lib ${Boost_LIBRARIES_RELEASE})
get_filename_component(import_lib_name_root ${boost_import_lib} NAME_WE)
get_filename_component(import_lib_path ${boost_import_lib} PATH)
set(boost_dll "${import_lib_path}/${import_lib_name_root}${CMAKE_SHARED_LIBRARY_SUFFIX}")
set(boost_lib_pdb "${import_lib_name_root}.pdb")
FILE(GLOB_RECURSE boost_pdb_paths "${import_lib_path}/../../bin.v2/*/${boost_lib_pdb}")
foreach(p ${boost_pdb_paths})
if(p MATCHES ".*/address-model-${platformBitness}/")
GP_APPEND_UNIQUE(INTERFACE_LINK_PDB_RELEASE ${p})
endif()
endforeach()
if(EXISTS "${boost_dll}")
set(SHARED_LIBRARIES_RELEASE ${SHARED_LIBRARIES_RELEASE} "${boost_dll}")
endif()
endforeach()
2015-06-13 17:39:43 +00:00
set(INTERFACE_LINK_PDB_DEBUG)
set(SHARED_LIBRARIES_DEBUG)
foreach(boost_import_lib ${Boost_LIBRARIES_DEBUG})
get_filename_component(import_lib_name_root ${boost_import_lib} NAME_WE)
get_filename_component(import_lib_path ${boost_import_lib} PATH)
set(boost_dll "${import_lib_path}/${import_lib_name_root}${CMAKE_SHARED_LIBRARY_SUFFIX}")
set(boost_lib_pdb "${import_lib_name_root}.pdb")
FILE(GLOB_RECURSE boost_pdb_paths "${import_lib_path}/../../bin.v2/*/${boost_lib_pdb}")
foreach(p ${boost_pdb_paths})
if(p MATCHES ".*/address-model-${platformBitness}/")
GP_APPEND_UNIQUE(INTERFACE_LINK_PDB_DEBUG ${p})
endif()
endforeach()
if(EXISTS "${boost_dll}")
set(SHARED_LIBRARIES_DEBUG ${SHARED_LIBRARIES_DEBUG} "${boost_dll}")
endif()
endforeach()
# message(STATUS "openssl_libraries=${OPENSSL_LIBRARIES}")
foreach(lib ${OPENSSL_LIBRARIES})
get_filename_component(lib_name ${lib} NAME_WE)
if (${lib_name} STREQUAL "libeay32")
get_filename_component(lib_dir ${lib} DIRECTORY)
2014-03-14 21:14:02 +00:00
get_filename_component(openssl_dir "${lib_dir}/.." REALPATH)
set( eaydll "${openssl_dir}/bin/${lib_name}${CMAKE_SHARED_LIBRARY_SUFFIX}")
set(eay_pdb "${openssl_dir}/bin/${lib_name}.pdb")
message(STATUS "eay=${eaydll}")
if(EXISTS ${eay_pdb})
GP_APPEND_UNIQUE(INTERFACE_LINK_PDB_RELEASE ${eay_pdb})
GP_APPEND_UNIQUE(INTERFACE_LINK_PDB_DEBUG ${eay_pdb})
endif()
2014-03-14 21:14:02 +00:00
set(SHARED_LIBRARIES_DEBUG ${SHARED_LIBRARIES_DEBUG} "${eaydll}")
set(SHARED_LIBRARIES_RELEASE ${SHARED_LIBRARIES_RELEASE} "${eaydll}")
endif()
endforeach()
set_property(TARGET fc PROPERTY INTERFACE_LINK_PDB_RELEASE ${INTERFACE_LINK_PDB_RELEASE})
set_property(TARGET fc PROPERTY INTERFACE_LINK_PDB_DEBUG ${INTERFACE_LINK_PDB_DEBUG})
set_property(TARGET fc PROPERTY SHARED_LIBRARIES_DEBUG ${SHARED_LIBRARIES_DEBUG})
set_property(TARGET fc PROPERTY SHARED_LIBRARIES_RELEASE ${SHARED_LIBRARIES_RELEASE})
endif(WIN32)
IF(APPLE)
# As of 10.10 yosemite, the OpenSSL static libraries shipped with os x have a dependency
# on zlib, so any time you link in openssl you also need to link zlib. . We really want to detect whether openssl was configured with the --no-zlib
# option or not when it was built, but that's difficult to do in practice, so we
# just always try to link it in on mac.
find_package( ZLIB REQUIRED )
ENDIF(APPLE)
SET(OPENSSL_CONF_TARGET )
IF(DEFINED CMAKE_RUNTIME_OUTPUT_DIRECTORY)
SET (OPENSSL_CONF_TARGET ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
ELSE()
SET (OPENSSL_CONF_TARGET ${CMAKE_CURRENT_BINARY_DIR})
ENDIF()
2014-06-03 15:16:29 +00:00
IF(WIN32)
SET(POST_BUILD_STEP_COMMANDS ${POST_BUILD_STEP_COMMANDS}
2014-06-03 15:16:29 +00:00
COMMAND ${CMAKE_COMMAND} -E copy_if_different "${OPENSSL_ROOT_DIR}/ssl/openssl.cnf" "${OPENSSL_CONF_TARGET}/openssl.cnf")
ENDIF(WIN32)
2015-06-13 17:39:43 +00:00
ADD_CUSTOM_COMMAND(TARGET fc POST_BUILD ${POST_BUILD_STEP_COMMANDS}
COMMENT "Copying OpenSSL/ssl/openssl.cnf into target directory."
)
MESSAGE(STATUS "Finished fc module configuration...")