Commit a624794b authored by Rashad Kanavath's avatar Rashad Kanavath

SuperBuild: build openssl on windows

parent df25faaf
......@@ -19,19 +19,38 @@ else()
# set proj back to its original value
set(proj OPENSSL)
set(OPENSSL_BUILD_ARCH "linux-x32")
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(OPENSSL_BUILD_ARCH "linux-x86_64")
endif()
if(WIN32)
set(OPENSSL_BUILD_ARCH "linux-x32")
set(OPENSSL_BUILD_ARCH "VC-WIN32")
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(OPENSSL_BUILD_ARCH "linux-x86_64")
set(OPENSSL_BUILD_ARCH "VC-WIN64A")
endif()
endif()
if(MSVC)
message(FATAL_ERROR "No build rules added yet.")
STRING(REGEX REPLACE "/$" "" CMAKE_WIN_INSTALL_PREFIX ${SB_INSTALL_PREFIX})
STRING(REGEX REPLACE "/" "\\\\" CMAKE_WIN_INSTALL_PREFIX ${CMAKE_WIN_INSTALL_PREFIX})
ExternalProject_Add(${proj}
PREFIX ${proj}
URL "https://github.com/openssl/openssl/archive/OpenSSL_1_0_1e.zip"
URL_MD5 de0f06b07dad7ec8b220336530be1feb
DEPENDS ${${proj}_DEPENDENCIES}
BINARY_DIR ${OPENSSL_SB_BUILD_DIR}
INSTALL_DIR ${SB_INSTALL_PREFIX}
DOWNLOAD_DIR ${DOWNLOAD_LOCATION}
PATCH_COMMAND ${CMAKE_COMMAND} -E copy_directory ${OPENSSL_SB_SRC} ${OPENSSL_SB_BUILD_DIR}
CONFIGURE_COMMAND ${CMAKE_COMMAND} -E chdir ${OPENSSL_SB_BUILD_DIR} perl Configure ${OPENSSL_BUILD_ARCH} no-asm --prefix=${CMAKE_WIN_INSTALL_PREFIX} --openssldir=${CMAKE_WIN_INSTALL_PREFIX}
BUILD_COMMAND ms/do_ms.bat
INSTALL_COMMAND nmake -f ms/ntdll.mak install
)
else(UNIX)
ExternalProject_Add(${proj}
PREFIX ${proj}
DEPENDS ${${proj}_DEPENDENCIES}
URL "http://openssl.org/source/openssl-1.0.2c.tar.gz"
URL_MD5 8c8d81a9ae7005276e486702edbcd4b6
URL "https://github.com/openssl/openssl/archive/OpenSSL_1_0_1e.zip"
URL_MD5 de0f06b07dad7ec8b220336530be1feb
BINARY_DIR ${OPENSSL_SB_BUILD_DIR}
INSTALL_DIR ${SB_INSTALL_PREFIX}
DOWNLOAD_DIR ${DOWNLOAD_LOCATION}
......@@ -45,7 +64,7 @@ else()
set(_SB_${proj}_INCLUDE_DIR ${SB_INSTALL_PREFIX}/include)
if(WIN32)
message(FATAL_ERROR "No build rules added yet.")
set(_SB_${proj}_LIBRARY ${SB_INSTALL_PREFIX}/lib/libcurl.lib)
elseif(UNIX)
set(_SB_${proj}_LIBRARY ${SB_INSTALL_PREFIX}/lib/libssl${CMAKE_SHARED_LIBRARY_SUFFIX})
endif()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment