# #openssl # #See http://developer.covenanteyes.com/building-openssl-for-visual-studio/ #and https://cmake.org/Bug/view.php?id=13251 #for how to build openssl for Windows. # #To build openssl on Windows: # # - Requires perl in order to configure. # - Set up the toolchain environment prior to compilation by either # 64 bit build: C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall x86_amd64 # or # 32 bit build: C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall x86 # #The option BUILD_SHARED_LIBS controls the type of library built. # if (WIN32) #Building openssl under Windows is a real kludge that could have been a lot #more elegant if people stopped relying on scripts (perl/batch files) for the #configure step and instead used a build tool that is aware of the concept of #a configuration step ("cmake" is my personal favourite - "scons" is another). if (CMAKE_CL_64) set (OPENSSL_CFG_TARGET VC-WIN64A) else (CMAKE_CL_64) set (OPENSSL_CFG_TARGET VC-WIN32) endif (CMAKE_CL_64) if (BUILD_SHARED_LIBS) set (OPENSSL_SHARED shared) else (BUILD_SHARED_LIBS) set (OPENSSL_SHARED no-shared) endif (BUILD_SHARED_LIBS) ExternalProject_Add ( openssl PREFIX ${CMAKE_INSTALL_PREFIX} BUILD_IN_SOURCE 1 #We will install directly from the source, so no build directory is needed URL https://github.com/openssl/openssl/archive/OpenSSL_1_1_0d.zip URL_MD5 c724658598bd293d3c794a4c0a073a7c PATCH_COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_LIST_DIR}/patch . CONFIGURE_COMMAND $/bin/perl> Configure ${OPENSSL_CFG_TARGET} --prefix= --openssldir=$/SSL> no-asm ${OPENSSL_SHARED} BUILD_COMMAND nmake INSTALL_COMMAND nmake install DEPENDS perl ) endif (WIN32) if (UNIX) ExternalProject_Add ( openssl PREFIX ${CMAKE_INSTALL_PREFIX} BUILD_IN_SOURCE 1 #We will install directly from the source, so no build directory is needed URL https://github.com/openssl/openssl/archive/OpenSSL_1_1_0d.zip URL_MD5 c724658598bd293d3c794a4c0a073a7c CONFIGURE_COMMAND ./config --prefix= BUILD_COMMAND make INSTALL_COMMAND make install ) endif (UNIX)