Build environment: Enable SSL for Python on Linux
[blender.git] / build_files / build_environment / cmake / python.cmake
index 3fbf3a4086819ad303b2bbf14f8e2dc6b2b5d4a7..64ae515cb1b97610a4246c8e2cf7dcedb704dc32 100644 (file)
@@ -88,7 +88,9 @@ else()
                set(PYTHON_BINARY ${BUILD_DIR}/python/src/external_python/python.exe)
                #set(PYTHON_PATCH ${PATCH_CMD} --verbose -p1 -d ${BUILD_DIR}/python/src/external_python < ${PATCH_DIR}/python_apple.diff)
                set(PYTHON_PATCH echo .)
+               set(PYTHON_CONFIGURE_EXTRA_ARGS)
        else()
+               set(PYTHON_CONFIGURE_EXTRA_ARGS "--with-openssl=${LIBDIR}/ssl")
                set(PYTHON_CONFIGURE_ENV ${CONFIGURE_ENV})
                set(PYTHON_BINARY ${BUILD_DIR}/python/src/external_python/python)
        endif()
@@ -99,7 +101,7 @@ else()
                URL_HASH MD5=${PYTHON_HASH}
                PREFIX ${BUILD_DIR}/python
                PATCH_COMMAND ${PYTHON_PATCH}
-               CONFIGURE_COMMAND ${PYTHON_CONFIGURE_ENV} && cd ${BUILD_DIR}/python/src/external_python/ && ${CONFIGURE_COMMAND} --prefix=${LIBDIR}/python
+               CONFIGURE_COMMAND ${PYTHON_CONFIGURE_ENV} && cd ${BUILD_DIR}/python/src/external_python/ && ${CONFIGURE_COMMAND} --prefix=${LIBDIR}/python ${PYTHON_CONFIGURE_EXTRA_ARGS}
                BUILD_COMMAND ${PYTHON_CONFIGURE_ENV} && cd ${BUILD_DIR}/python/src/external_python/ && make -j${MAKE_THREADS}
                INSTALL_COMMAND ${PYTHON_CONFIGURE_ENV} && cd ${BUILD_DIR}/python/src/external_python/ && make install
                INSTALL_DIR ${LIBDIR}/python)
@@ -162,3 +164,10 @@ if(MSVC)
        )
        add_custom_target(Make_Python_Environment ALL DEPENDS ${BUILD_DIR}/python/src/external_python/run/python${PYTHON_POSTFIX}.exe Package_Python)
 endif()
+
+if(UNIX AND NOT APPLE)
+       add_dependencies(
+               external_python
+               external_ssl
+       )
+endif()