libopenssl: support for MSVC

Mon, 19 Sep 2016 20:13:46 +0200

author
David Demelier <markand@malikania.fr>
date
Mon, 19 Sep 2016 20:13:46 +0200
changeset 1
3b335cc3cbc3
parent 0
67323405a52f
child 2
a957e9f03335

libopenssl: support for MSVC

libopenssl/CMakeLists.txt file | annotate | diff | comparison | revisions
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/libopenssl/CMakeLists.txt	Mon Sep 19 20:13:46 2016 +0200
@@ -0,0 +1,29 @@
+cmake_minimum_required(VERSION 3.5)
+project(libopenssl)
+include(ExternalProject)
+
+find_package(Perl REQUIRED)
+
+if (MSVC)
+    if (CMAKE_SIZEOF_VOID_P MATCHES 8)
+        set(TGT "VC-WIN64A")
+    else ()
+        set(TGT "VC-WIN32")
+        set(EXTRA no-asm)
+    endif ()
+
+    ExternalProject_Add(
+        libopenssl
+        SOURCE_DIR ${CMAKE_CURRENT_BINARY_DIR}/libopenssl
+        BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/libopenssl
+        URL ftp://ftp.openssl.org/source/openssl-1.0.2h.tar.gz
+        CONFIGURE_COMMAND
+            ${PERL_EXECUTABLE} Configure $<$<CONFIG:Debug>:debug->${TGT} ${EXTRA} --prefix=${CMAKE_INSTALL_PREFIX}
+        COMMAND
+            ms\\do_ms
+        BUILD_COMMAND
+            nmake -f ms\\ntdll.mak
+        INSTALL_COMMAND
+            nmake -f ms\\ntdll.mak install
+    )
+endif ()
\ No newline at end of file

mercurial