1
0
mirror of https://github.com/Kitware/CMake.git synced 2025-10-14 02:08:27 +08:00
Commit Graph

84 Commits

Author SHA1 Message Date
Orgad Shaneh
98fa09d5be FindOpenSSL: Link with ws2_32 and crypt32 on Windows/static 2021-06-07 19:23:13 +03:00
Deniz Bahadir
bc00cf9300 FindOpenSSL: Add support for version-range 2021-02-01 12:27:05 +01:00
Ma Br
a6e03b2e6f FindOpenSSL: Distinguish 32-bit and 64-bit search paths on Windows
Fixes: #21611
2020-12-21 13:34:42 -05:00
Nikita Nemkin
8fea95319b Help: Add .. versionadded directives to module docs
Issue: #19715
2020-12-02 21:00:30 +05:00
Sylvain Corlay
1925f9d8eb FindOpenSSL: Add support for finding static libraries
Fixes: #20903
2020-08-13 17:59:13 +02:00
Jean-Christophe Fillion-Robin
207373802e Fix typos identified using codespell
See https://github.com/codespell-project/codespell#readme

The following command was used:

```
codespell -q6 --skip="\
.git,\
*.json,\
./Copyright.txt,\
./Help/command/foreach.rst,\
./Help/prop_test/REQUIRED_FILES.rst,\
./Help/variable/CTEST_COVERAGE_COMMAND.rst,\
./Modules/CMakeCheckCompilerFlagCommonPatterns.cmake,\
./Modules/CMakeRCInformation.cmake,\
./Modules/Internal/CPack/NSIS.template.in,\
./Modules/FindMatlab.cmake,\
./Modules/MatlabTestsRedirect.cmake,\
./Modules/Platform/Windows-Clang.cmake,\
./Modules/Platform/Windows-Intel-Fortran.cmake,\
./Modules/Platform/Windows-MSVC.cmake,\
./Source/CMakeVersion.cmake,\
./Source/cmConvertMSBuildXMLToJSON.py,\
./Source/cmCreateTestSourceList.cxx,\
./Source/cmGlobalVisualStudio10Generator.cxx,\
./Source/cmExportBuildFileGenerator.cxx,\
./Source/cmExportInstallAndroidMKGenerator.cxx,\
./Source/cmExportInstallFileGenerator.cxx,\
./Source/cmExportSet.cxx,\
./Source/cmExportTryCompileFileGenerator.cxx,\
./Source/cmFindPackageCommand.cxx,\
./Source/cmInstallCommand.cxx,\
./Source/cmGeneratorExpressionLexer.cxx,\
./Source/cmLocalVisualStudio7Generator.cxx,\
./Source/cmOrderDirectories.cxx,\
./Source/cmTarget.cxx,\
./Source/kwsys/*,\
./Source/QtDialog/CMakeSetupDialog.ui,\
./Source/CPack/WiX/cmWIXRichTextFormatWriter.cxx,\
./Source/CTest/cmParseCoberturaCoverage.h,\
./Tests/CMakeTests/ImplicitLinkInfoTest.cmake.in,\
./Tests/RunCMake/CPack/tests/DMG_SLA/English.license.rtf,\
./Tests/RunCMake/CPack/tests/DMG_SLA/German.license.txt,\
./Tests/RunCMake/CPack/tests/DMG_SLA/German.menu.txt,\
./Tests/RunCMake/GoogleTest/xml_output.cpp,\
./Tests/RunCMake/Make/TargetMessages*,\
./Utilities/*,\
" \
-L "\
dependees,\
endwhile,\
fo,\
filetest,\
helpfull,\
nd,\
objext,\
stoll,\
supercedes,\
superceded,\
vas,\
varn,\
"
```
2020-07-22 12:44:47 -04:00
Brad King
cc1592d708 Merge topic 'FindOpenSSL-3.0'
796b447373 FindOpenSSL: Fix OpenSSL 3.0.0 version extraction

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4860
2020-06-09 08:53:06 -04:00
Billy Brumley
796b447373 FindOpenSSL: Fix OpenSSL 3.0.0 version extraction
Fix the regex syntax added by commit 61d746e592 (FindOpenSSL: Detect
OpenSSL 3.0.0, 2020-05-27, v3.17.3~1^2).  Add missing escapes.
Test with `openssl-3.0.0-alpha3`.

While at it, also unset a temporary variable after use.
2020-06-08 08:24:57 -04:00
Brad King
40748ec1d9 Merge topic 'openssl-3.0.0'
61d746e592 FindOpenSSL: Detect OpenSSL 3.0.0

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4805
2020-05-28 06:51:52 -04:00
Vitezslav Cizek
61d746e592 FindOpenSSL: Detect OpenSSL 3.0.0
The OpenSSL versioning is changing with the upcoming 3.0.0 release.
https://www.openssl.org/blog/blog/2018/11/28/version/
Since 3.0.0, the patch letters are being dropped. The new format is:
MAJOR.MINOR.PATCH

The OPENSSL_VERSION variable can now be directly derived from the new
OPENSSL_VERSION_STR macro.
https://www.openssl.org/docs/manmaster/man3/OPENSSL_VERSION_NUMBER.html
2020-05-27 09:08:10 -04:00
gnaggnoyil
7b83ca816a FindOpenSSL: add target OpenSSL::applink to support OpenSSL's applink feature
Fixes: #20701
2020-05-15 15:50:10 +08:00
Ben Boeckel
af158149e7 FindOpenSSL: do not mark a local variable as advanced 2020-01-20 15:49:29 -05:00
Ashley Whetter
90973c4abd FindOpenSSL: Fix ordering of dependency link flags
Fixes: #20082
2019-12-31 15:01:35 -08:00
Denis Thulin
24d52daf49 FindOpenSSL: Lookup all pkg-config directories
When using a custom sysroot to build things using pkg-config, some of
the output variables feature the sysroot while others do not:

```console
$ export PKG_CONFIG_SYSROOT_DIR=/path/to/sysroot
$ export PKG_CONFIG_LIBDIR=/path/to/sysroot/usr/lib/pkgconfig
$ pkg-config --cflags-only-I openssl
-I/path/to/sysroot/usr/include/
$ pkg-config --variable=includedir openssl
/usr/include
$ pkg-config --libs-only-L openssl
-L/path/to/sysroot/usr/lib
$ pkg-config --variable=libdir openssl
/usr/lib
```

When using `pkg_check_modules`, it's pretty much the same:
```cmake
pkg_check_modules(_OPENSSL QUIET openssl)
_OPENSSL_INCLUDE_DIRS == /path/to/sysroot/usr/include/
_OPENSSL_INCLUDEDIR == /usr/include
_OPENSSL_LIBRARY_DIRS == -L/path/to/sysroot/usr/lib
_OPENSSL_LIBDIR == /usr/lib
```

However, FindOpenSSL only searches for headers in `INCLUDEDIR` and
libraries in `LIBDIR` instead of searching `INCLUDE_DIRS` and
`LIBRARY_DIRS` as well.

This fixes that behaviour.

Fixes: #16885

Signed-off-by: Denis Thulin <denis.thulin@enyx.fr>
2019-11-07 16:44:12 +01:00
David Callu
8098bd5768 FindOpenSSL: add pthread and dl dependencies to static lib on Linux 2019-09-20 22:39:20 +02:00
Kitware Robot
df4ed1e9ff Help: Convert remaining modules to block-style comments 2018-10-22 11:09:34 -04:00
Harry Mallon
912a6c1cb5 FindOpenSSL: Add component support 2018-04-16 12:38:39 +01:00
luzpaz
777e87ae00 Fix trivial typos in text
Some are user facing.

Found using

    codespell -q 3 --skip="./Utilities" -I .cmake-whitelist.txt`

whereby the whitelist contained:

    ans
    dum
    helpfull
    emmited
    emmitted
    buil
    iff
    isnt
    nto
    ot
    pathes
    substract
    te
    todays
    upto
    whitespaces
2017-11-03 10:25:05 -04:00
Robert Dailey
d371b52fdf FindOpenSSL: Search 'ssld' and 'crypod' for debug variants
Release variant search already considered `ssl` and `crypto`, but
similarly named libs with `d` postfix were not searched for debug
variant.
2017-09-08 13:57:55 -05:00
Brad King
300979e788 Merge topic 'FindOpenSSL-crypto-only'
8b410453 FindOpenSSL: Restore support for crypto-only result

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !846
2017-05-16 09:49:05 -04:00
Brad King
8b41045393 FindOpenSSL: Restore support for crypto-only result
Since commit v3.8.0-rc1~132^2 (FindOpenSSL: Check that both CRYPTO and
SSL libraries are present, 2017-01-03) we require both crypto and ssl
libraries to be present.  This makes sense because `OPENSSL_LIBRARIES`
lists both and breaks when one is not found.  However, prior to that
fix we supported finding only the crypto library and using it through
the imported target.  Drop the requirement for ssl to restore support
for using crypto alone.

Later this module should be taught to support the `COMPONENTS` argument
of `find_package`.

Fixes: #16882
2017-05-15 10:12:46 -04:00
Brad King
01d72391b3 Merge topic 'FindOpenSSL-more-precompiled'
16ef163f FindOpenSSL: Add more library name alternatives

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !713
2017-04-20 08:46:47 -04:00
Alex Turbov
16ef163fd6 FindOpenSSL: Add more library name alternatives
Add names found in OpenSSL 1.1.0 builds from [1].

[1] https://www.npcglib.org/~stathis/blog/precompiled-openssl/
2017-04-19 11:08:42 -04:00
Kevin Whitaker
9b78dca3a9 FindOpenSSL: Add another name for libcrypto with MSVC
Add the `crypto` name without any prefix or suffix as a fallback, just
as we already have for `ssl`.
2017-02-16 13:26:42 -05:00
Harry Mallon
696339a9d5 FindOpenSSL: Check that both CRYPTO and SSL libraries are present
* Strawberry perl on Windows installs one that is found by the
  default finder

While at it, de-duplicate code setting `OPENSSL_LIBRARIES`.
2017-01-10 13:42:48 -05:00
Brad King
86578eccf2 Simplify CMake per-source license notices
Per-source copyright/license notice headers that spell out copyright holder
names and years are hard to maintain and often out-of-date or plain wrong.
Precise contributor information is already maintained automatically by the
version control tool.  Ultimately it is the receiver of a file who is
responsible for determining its licensing status, and per-source notices are
merely a convenience.  Therefore it is simpler and more accurate for
each source to have a generic notice of the license name and references to
more detailed information on copyright holders and full license terms.

Our `Copyright.txt` file now contains a list of Contributors whose names
appeared source-level copyright notices.  It also references version control
history for more precise information.  Therefore we no longer need to spell
out the list of Contributors in each source file notice.

Replace CMake per-source copyright/license notice headers with a short
description of the license and links to `Copyright.txt` and online information
available from "https://cmake.org/licensing".  The online URL also handles
cases of modules being copied out of our source into other projects, so we
can drop our notices about replacing links with full license text.

Run the `Utilities/Scripts/filter-notices.bash` script to perform the majority
of the replacements mechanically.  Manually fix up shebang lines and trailing
newlines in a few files.  Manually update the notices in a few files that the
script does not handle.
2016-09-27 15:14:44 -04:00
Brad King
0d8c5ba42a FindOpenSSL: Search in more-specific directories before less-specific
Since commit v3.6.0-rc1~182^2 (FindOpenSSL: Prefer libs early in search
path regardless of name, 2016-04-04) we use the `NAMES_PER_DIR` option
to `find_library` calls to consider all names in each directory before
moving on to the next directory.  Fix our library search directory
ordering to place more-specific (e.g. VC/) directories before the
general directories.  Otherwise they may never be considered.

Closes: #16320
2016-09-22 07:55:27 -04:00
Alexis Murzeau
ed1758f8eb FindOpenSSL: Fix detection of OpenSSL 1.1 Win32/64
Since OpenSSL 1.1.0, Windows binaries are libcrypto and libssl instead of
the old names libeay32 and ssleay32.
When using MSVC, FindOpenSSL was searching for the old lib names only so
this add the new names to be able to find OpenSSL 1.1.0 libraries.

For example, the files in lib directory of OpenSSL 1.1.0 Win64 :
 - libcrypto.lib
 - libssl.lib
 - VC/libcrypto64MD.lib
 - VC/libcrypto64MDd.lib
 - VC/libcrypto64MT.lib
 - VC/libcrypto64MTd.lib
 - VC/libssl64MD.lib
 - VC/libssl64MDd.lib
 - VC/libssl64MT.lib
 - VC/libssl64MTd.lib

32 bits OpenSSL has the same files with "32" instead of "64" for files in
VC directory.

MinGW still works and use lib/libcrypto.lib and lib/libssl.lib.

This patch also add libssl and libcrypto for other windows compilers too (like
Intel).
2016-08-30 10:51:25 -04:00
Brad King
ff386d1121 Modules: Make imported targets fall back to Release
Find modules only detect Debug and Release configurations.  All other
configurations will fall back to the configuration listed as the first
entry in `IMPORTED_CONFIGURATIONS`.  Switch the order so that `Release`
is listed first, as this is a better fallback than `Debug` for the
`RelWithDebInfo` and `MinSizeRel` configurations.  See issue #16091.

This approach is recommended by documentation in `cmake-developer(7)`
added by commit v3.2.0-rc1~286^2~1 (Help: Document IMPORTED_CONFIGURATIONS
target property for Find modules, 2014-12-04).
2016-08-03 11:14:29 -04:00
Vladimír Vondruš
e937b4c387 FindOpenSSL: Do not assume that the version regex finds something
BoringSSL's openslv.h does not have the version information.
2016-06-09 08:51:01 -04:00
Hannes Mezger
b148440381 FindOpenSSL: Prefer libs early in search path regardless of name (#15887)
Add NAMES_PER_DIR to all find_library invocations so that we consider
all possible names in each search directory before moving on to the next
directory.  Otherwise we may not find self-built libraries first even if
they appear early in the search path.
2016-04-05 09:32:08 -04:00
Wayne Stambaugh
1bf66fed67 FindOpenSSL: Search for unix-named libraries first on MinGW (#15765)
Generalize the change made by commit v2.8.10~228^2~4 (FindOpenSSL: find
cross-compiled OpenSSL from MinGW, 2012-07-23) to be used on builds
hosted on Windows too.  When building for MinGW, consider library names
that come with MinGW before looking for the main Windows distribution of
OpenSSL.
2015-10-06 11:55:46 -04:00
Wayne Stambaugh
6b575dec8d FindOpenSSL: Tolerate tabs in header while parsing version (#15765)
Tolerate tabs instead of spaces in the "# define" line.
2015-10-06 11:50:32 -04:00
Thijs Wenker
821e17785e FindOpenSSL: Add support for static MSVC runtime
Add an OPENSSL_MSVC_STATIC_RT option to switch from the default search
for `/MD` libraries to look for `/MT` libraries instead.
2015-10-05 11:40:09 -04:00
Thijs Wenker
369a8cde37 FindOpenSSL: Optionally search only for static libraries
Add an OPENSSL_USE_STATIC_LIBS option to enable it.  Adjust
CMAKE_FIND_LIBRARY_SUFFIXES to only look for .a and .lib files.  Also
adjust the search paths on Windows for installer locations of static
libraries.
2015-09-02 13:47:57 -04:00
Konstantin Podsvirov
75e3a8e811 FindOpenSSL: Provide imported targets OpenSSL::{SSL,Crypto} 2015-08-13 10:58:40 -04:00
Brad King
79a364376c FindOpenSSL: Revise and format module documentation
Improve reStructuredText formatting and add section headers.
2015-08-13 10:53:08 -04:00
Thijs Wenker
fbcbf7f29d FindOpenSSL: De-duplicate find_library path suffixes on Windows
Store the path suffixes in a variable and reference it in each
find_library call.
2015-07-30 10:33:12 -04:00
Thijs Wenker
4c10461a87 FindOpenSSL: Remove extra whitespace 2015-07-30 10:30:49 -04:00
Brad King
de4ccee75a Merge topic 'OpenSSL_102'
c5d9a828 FindOpenSSL: fix detection of OpenSSL 1.0.2
2015-01-28 09:33:42 -05:00
Guillaume Belz
c5d9a8283c FindOpenSSL: fix detection of OpenSSL 1.0.2 2015-01-27 22:53:54 +01:00
Aku Kotkavuo
99b1382071 FindOpenSSL: Always extract version from detected header (#15075)
Do not use the _OPENSSL_VERSION computed by pkg-config because
the user may change OPENSSL_INCLUDE_DIR.
2015-01-11 15:32:55 -05:00
Hannes Mezger
be9bec5df2 FindOpenSSL: Report crypto and ssl libraries separately
Some applications only need the OpenSSL crypto library and want to avoid
linking against the SSL library.  Set OPENSSL_CRYPTO_LIBRARY and
OPENSSL_SSL_LIBRARY in the code paths that do not need to find them
separately, and document them publicly.  This allows applications to be
more specific when linking against OpenSSL.
2014-12-01 09:41:46 -05:00
Ho Cheung
e346c47ac5 FindOpenSSL: Prefer OPENSSL_ROOT_DIR first (#14764)
Use hints computed from this explicit variable before those
computed by PkgConfig.  They are more specific.
2014-02-18 15:05:32 -05:00
Ho Cheung
12d6eb639d FindOpenSSL: Honor OPENSSL_ROOT_DIR everywhere (#14735)
In commit v2.8.5~176^2~2 (FindOpenSSL: We should only use hints to find
OpenSSL, 2011-03-28) values for HINTS and PATHS of find_* calls were
computed everywhere but only used on Windows.  Use them everywhere.
2014-02-05 12:28:36 -05:00
Kitware Robot
f051814ed0 Convert builtin help to reStructuredText source files
Run the convert-help.bash script to convert documentation:

 ./convert-help.bash "/path/to/CMake-build/bin"

Then remove it.
2013-10-15 14:12:03 -04:00
Rolf Eike Beer
864e2a3141 FindOpenSSL: mark variables as advanced for MSVC (#14418) 2013-09-17 08:10:08 +02:00
Brad King
0dc0e7d885 Merge topic 'doc-improvements'
7cc2805 Docs: Clarify wording "flag used" => "flag (to|will) be used"
2378a69 Docs: Clarify that CMAKE_*_(PREFIX|SUFFIX) affect filenames
56ca34d Docs: Update description of CMAKE_(BUILD_TYPE|CONFIGURATION_TYPES)
2bab472 VS10: add detailed comment about MIDL processing
e619111 Explain distribution of Win9x binary on all Windows versions.
5ca4336 FindwxWidgets: add DOC strings with usual style
f57800d Fix spelling and typos (product names)
bf019d7 Fix spelling and typos (non-binary)
ddac8d3 Fix spelling and typos (affecting binary data / module messages)
86832ce Fix spelling and typos (affecting users)
2013-05-16 14:38:07 -04:00
Andreas Mohr
f57800d6f5 Fix spelling and typos (product names)
API, Borland, MinGW, UNIX, Mac OS X.
2013-05-07 08:42:20 -04:00
Robin Lee
1b614e018c FindOpenSSL: Fix spelling of CMAKE_CROSSCOMPILING (#14075)
Use of the mis-spelled variable name 'CMAKE_CROSS_COMPILING' was
introduced by commit 4b793ad1 (FindOpenSSL: find cross-compiled OpenSSL
from MinGW, 2012-07-23).  Fix the spelling.
2013-04-12 08:50:06 -04:00