Discussion:
[cmake-developers] Enabling SSL support by default when building CMake from source
Craig Scott
2018-08-09 12:54:48 UTC
Permalink
When building CMake from source with default options, you typically end up
without SSL support, even if the necessary libraries (i.e. OpenSSL) are
available. I've been bitten by that in my earlier days building CMake and
I've seen others have a similar experience. Is there any reason why this is
the default behavior, or is it just that the logic hasn't been added to try
to enable it by default if available?
--
Craig Scott
Melbourne, Australia
https://crascit.com

New book released: Professional CMake: A Practical Guide
<https://crascit.com/professional-cmake/>
Nils Gladitz
2018-08-09 13:14:45 UTC
Permalink
Post by Craig Scott
When building CMake from source with default options, you typically end up
without SSL support, even if the necessary libraries (i.e. OpenSSL) are
available. I've been bitten by that in my earlier days building CMake and
I've seen others have a similar experience. Is there any reason why this is
the default behavior, or is it just that the logic hasn't been added to try
to enable it by default if available?
I remember this having changed to some degree here (~3.6):
https://gitlab.kitware.com/cmake/cmake/commit/190a5fdffd8104ad613854bdd563a0a11dd88f63

Nils
Brad King
2018-08-09 13:18:18 UTC
Permalink
or is it just that the logic hasn't been added to try to enable
it by default if available?
Mostly that.

On Windows and macOS we already get SSL by default because curl
just uses the OS-provided APIs. This issue occurs only when we
need to find OpenSSL.

Since commit v3.6.0-rc1~301^2 (Automatically use OpenSSL by default
on Linux and FreeBSD if available, 2016-02-26) we try to enable
SSL by default on Linux and FreeBSD. Its commit message explains
why we didn't do that for other platforms (too easy to find an
OpenSSL library that is not compatible with the target compiler).
A sophisticated try_compile may be needed to determine whether
enabling it will compile and link properly.

-Brad
--
Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake-developers
Loading...