Build environment: Enable SSL for Python on Linux
[blender.git] / build_files / build_environment / cmake / ssl.cmake
1 # ***** BEGIN GPL LICENSE BLOCK *****
2 #
3 # This program is free software; you can redistribute it and/or
4 # modify it under the terms of the GNU General Public License
5 # as published by the Free Software Foundation; either version 2
6 # of the License, or (at your option) any later version.
7 #
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11 # GNU General Public License for more details.
12 #
13 # You should have received a copy of the GNU General Public License
14 # along with this program; if not, write to the Free Software Foundation,
15 # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16 #
17 # ***** END GPL LICENSE BLOCK *****
18
19 set(SSL_CONFIGURE_COMMAND ./Configure)
20 set(SSL_PATCH_CMD echo .)
21
22 if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
23         set(SSL_EXTRA_ARGS enable-ec_nistp_64_gcc_128)
24         set(SSL_OS_COMPILER "blender-x86_64")
25 else()
26         set(SSL_OS_COMPILER "blender-x86")
27 endif()
28
29 ExternalProject_Add(external_ssl
30         URL ${SSL_URI}
31         DOWNLOAD_DIR ${DOWNLOAD_DIR}
32         URL_HASH SHA256=${SSL_HASH}
33         PREFIX ${BUILD_DIR}/ssl
34         PATCH_COMMAND ${SSL_PATCH_CMD}
35         CONFIGURE_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/ssl/src/external_ssl/ && ${SSL_CONFIGURE_COMMAND} --prefix=${LIBDIR}/ssl
36                 --openssldir=${LIBDIR}/ssl
37                 no-shared
38                 no-idea no-mdc2 no-rc5 no-zlib no-ssl3 enable-unit-test no-ssl3-method enable-rfc3779 enable-cms
39                 --config=${CMAKE_CURRENT_SOURCE_DIR}/cmake/ssl.conf
40                 ${SSL_OS_COMPILER}
41         BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/ssl/src/external_ssl/ && make -j${MAKE_THREADS}
42         INSTALL_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/ssl/src/external_ssl/ && make install
43         INSTALL_DIR ${LIBDIR}/ssl
44 )