# #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 control 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) set (OPENSSL_CFG_FINALIZE ms/do_win64a) else (CMAKE_CL_64) set (OPENSSL_CFG_TARGET VC-WIN32) set (OPENSSL_CFG_FINALIZE ms/do_ms) endif (CMAKE_CL_64) if (BUILD_SHARED_LIBS) set (OPENSSL_MAKE_FILE ms/ntdll.mak) else (BUILD_SHARED_LIBS) set (OPENSSL_MAKE_FILE ms/nt.mak) 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_0_1e.zip URL_MD5 de0f06b07dad7ec8b220336530be1feb PATCH_COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_LIST_DIR}/patch . CONFIGURE_COMMAND perl Configure ${OPENSSL_CFG_TARGET} --prefix= COMMAND ${OPENSSL_CFG_FINALIZE} BUILD_COMMAND nmake -f ${OPENSSL_MAKE_FILE} INSTALL_COMMAND nmake -f ${OPENSSL_MAKE_FILE} install ) 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 http://www.openssl.org/source/openssl-1.0.1e.tar.gz URL_MD5 66bf6f10f060d561929de96f9dfe5b8c CONFIGURE_COMMAND ./configure --prefix= BUILD_COMMAND make INSTALL_COMMAND make install ) endif (UNIX)