fix: exporters/cmake/OpenSSLConfig.cmake.in to work for build config
This template file is made to make both: 1. OpenSSLConfig.cmake (CMake config used when building a CMake package against an uninstalled OpenSSL build) 2. exporters/OpenSSLConfig.cmake (CMake config that's to be installed alongside OpenSSL, and is used when building a CMake package against an OpenSSL installation). Variant 1 was unfortunately getting the internal '_ossl_prefix' variable wrong, which is due to how the perl snippet builds the command(s) to figure out its value. That needed some correction. Reviewed-by: Neil Horman <nhorman@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/24918)
This commit is contained in:
parent
0acb32052a
commit
a82d9e572c
1 changed files with 6 additions and 4 deletions
|
@ -91,11 +91,13 @@ get_filename_component(_ossl_prefix "${CMAKE_CURRENT_LIST_FILE}" PATH)
|
||||||
{-
|
{-
|
||||||
# For each component in $OpenSSL::safe::installdata::CMAKECONFIGDIR relative to
|
# For each component in $OpenSSL::safe::installdata::CMAKECONFIGDIR relative to
|
||||||
# $OpenSSL::safe::installdata::PREFIX, have CMake figure out the parent directory.
|
# $OpenSSL::safe::installdata::PREFIX, have CMake figure out the parent directory.
|
||||||
my $d = join('/', unixify($OpenSSL::safe::installdata::LIBDIR_REL_PREFIX),
|
my $d = join('/', unixify(catdir($OpenSSL::safe::installdata::LIBDIR_REL_PREFIX,
|
||||||
unixify($OpenSSL::safe::installdata::CMAKECONFIGDIR_REL_LIBDIR));
|
$OpenSSL::safe::installdata::CMAKECONFIGDIR_REL_LIBDIR), 1));
|
||||||
$OUT = '';
|
$OUT = '';
|
||||||
$OUT .= 'get_filename_component(_ossl_prefix "${_ossl_prefix}" PATH)' . "\n"
|
if ($d ne '.') {
|
||||||
foreach (split '/', $d);
|
$OUT .= 'get_filename_component(_ossl_prefix "${_ossl_prefix}" PATH)' . "\n"
|
||||||
|
foreach (split '/', $d);
|
||||||
|
}
|
||||||
-}
|
-}
|
||||||
if(_ossl_prefix STREQUAL "/")
|
if(_ossl_prefix STREQUAL "/")
|
||||||
set(_ossl_prefix "")
|
set(_ossl_prefix "")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue