Skip to content

ENH: Add configure time check that CMake supports HTTPS

Sam Horvath requested to merge github/fork/msmolens/4098-cmake-check-https into master

Created by: msmolens

Some build targets require downloading files using the HTTPS protocol. Before this commit, targets such as 'python-source' would fail during the build process with errors like:

CMake Error at python-source-prefix/src/python-source-stamp/download-python-source.cmake:27 (message):
  error: downloading
  'https://www.python.org/ftp/python/2.7.11/Python-2.7.11.tgz' failed

    status_code: 1
    status_string: "Unsupported protocol"
    log: Protocol "https" not supported or disabled in libcurl

This commit adds a configure-time check that CMake supports HTTPS. Now, developers are made aware of the problem before building.

If CMake doesn't support HTTPS, the configuration step now fails with a descriptive error message and a suggested solution:

CMake Error at CMake/SlicerCheckCMakeHTTPS.cmake:21 (message):
  error: This CMake does not support the HTTPS protocol.  Ensure that CMake
  is compiled with CMAKE_USE_OPENSSL enabled.

Fixes http://www.na-mic.org/Bug/view.php?id=4098

Merge request reports