Skip to content

Commit

Permalink
Add exporters for CMake
Browse files Browse the repository at this point in the history
CMake's older package finder, FindOpenSSL.cmake, does a best guess effort
and doesn't always get it right.

By CMake's own documentation, that's what such modules are (best effort
attempts), and package producers are (strongly) encouraged to help out by
producing and installing <PackageName>Config.cmake files to get a more
deterministic configuration.

The resulting OpenSSLConfig.cmake tries to mimic the result from CMake's
FindOpenSSL.cmake, by using the same variable and imported target names.
It also adds a few extra variables of its own, such as:

    OPENSSL_MODULES_DIR     Indicates the default installation directory
                            for OpenSSL loadable modules, such as providers.
    OPENSSL_RUNTIME_DIR     Indicates the default runtime directory, where
                            for example the openssl program is located.
    OPENSSL_PROGRAM         Is the full directory-and-filename of the
                            openssl program.

The imported targets OpenSSL::Crypto and OpenSSL::SSL are as precisely
specified as possible, so for example, they are specified with the both the
import library and the DLL on Windows, which should make life easier on that
platform.

For the moment, one of the following must be done in your CMake project for
this CMake configuration to take priority over CMake's FindOpenSSL.cmake:

-   The variable CMAKE_FIND_PACKAGE_PREFER_CONFIG must be set to true prior
    to the 'find_package(OpenSSL)' call.
-   The 'find_package' call itself must use the "Full Signature".  If you
    don't know any better, simply add the 'CONFIG' option, i.e. from this
    example:

        find_package(OpenSSL 3.0 REQUIRED)

    to this:

        find_package(OpenSSL 3.0 REQUIRED CONFIG)

Just as with the 'pkg-config' exporters, two variants of the .cmake files
are produced:

- Those in 'exporters/' are installed in the location that 'pkg-config'
  itself prefers for installed packages.
- Those in the top directory are to be used when it's desirable to build
  directly against an OpenSSL build tree.

Reviewed-by: Paul Dale <[email protected]>
Reviewed-by: Tomas Mraz <[email protected]>
(Merged from openssl#20878)
  • Loading branch information
levitte committed Nov 15, 2023
1 parent 2ac569a commit c768cce
Show file tree
Hide file tree
Showing 8 changed files with 351 additions and 17 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@

# Exporters
/*.pc
/OpenSSLConfig*.cmake
/exporters/*.pc
/exporters/OpenSSLConfig*.cmake

# Links under apps
/apps/CA.pl
Expand Down
19 changes: 19 additions & 0 deletions Configurations/unix-Makefile.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,12 @@ INSTALL_EXPORTERS_PKGCONFIG={-
grep { $unified_info{attributes}->{generate}->{$_}->{exporter} eq 'pkg-config'}
sort keys %{$unified_info{generate}}))
-}
INSTALL_EXPORTERS_CMAKE={-
join(" \\\n" . ' ' x 24,
fill_lines(" ", $COLUMNS - 24,
grep { $unified_info{attributes}->{generate}->{$_}->{exporter} eq 'cmake'}
sort keys %{$unified_info{generate}}))
-}
BIN_SCRIPTS={-
join(" \\\n" . ' ' x 12,
fill_lines(" ", $COLUMNS - 12,
Expand Down Expand Up @@ -327,6 +333,7 @@ bindir={- file_name_is_absolute($bindir)
? $bindir : '$(INSTALLTOP)/$(BINDIR)' -}

PKGCONFIGDIR=$(libdir)/pkgconfig
CMAKECONFIGDIR=$(libdir)/cmake/OpenSSL

MANDIR=$(INSTALLTOP)/share/man
DOCDIR=$(INSTALLTOP)/share/doc/$(BASENAME)
Expand Down Expand Up @@ -790,6 +797,13 @@ install_dev: install_runtime_libs
cp $$e "$(DESTDIR)$(PKGCONFIGDIR)/$$fn"; \
chmod 644 "$(DESTDIR)$(PKGCONFIGDIR)/$$fn"; \
done
@$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(CMAKECONFIGDIR)
@for e in $(INSTALL_EXPORTERS_CMAKE); do \
fn=`basename $$e`; \
$(ECHO) "install $$e -> $(DESTDIR)$(CMAKECONFIGDIR)/$$fn"; \
cp $$e $(DESTDIR)$(CMAKECONFIGDIR)/$$fn; \
chmod 644 $(DESTDIR)$(CMAKECONFIGDIR)/$$fn; \
done

uninstall_dev: uninstall_runtime_libs
@$(ECHO) "*** Uninstalling development files"
Expand Down Expand Up @@ -837,7 +851,12 @@ uninstall_dev: uninstall_runtime_libs
fn=`basename "$$e"`; \
$(RM) "$(DESTDIR)$(PKGCONFIGDIR)/$$fn"; \
done
@for e in $(INSTALL_EXPORTERS_CMAKE); do \
fn=`basename "$$e"`; \
$(RM) "$(DESTDIR)$(CMAKECONFIGDIR)/$$fn"; \
done
-$(RMDIR) "$(DESTDIR)$(PKGCONFIGDIR)"
-$(RMDIR) "$(DESTDIR)$(CMAKECONFIGDIR)"
-$(RMDIR) "$(DESTDIR)$(libdir)"

_install_modules_deps: install_runtime_libs build_modules
Expand Down
9 changes: 9 additions & 0 deletions Configurations/windows-makefile.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,11 @@ MISC_SCRIPTS={-
&& $unified_info{attributes}->{scripts}->{$_}->{misc} }
@{$unified_info{scripts}})
-}
INSTALL_EXPORTERS_CMAKE={-
join(" ", map { quotify1($_) }
grep { $unified_info{attributes}->{generate}->{$_}->{exporter} eq 'cmake'}
sort keys %{$unified_info{generate}})
-}
IMAGEDOCS1={- our @IMAGEDOCS1 = @{$unified_info{imagedocs}->{man1}};
join(" ", @IMAGEDOCS1) -}
IMAGEDOCS3={- our @IMAGEDOCS3 = @{$unified_info{imagedocs}->{man3}};
Expand Down Expand Up @@ -249,6 +254,8 @@ MODULESDIR=$(MODULESDIR_dev)$(MODULESDIR_dir)
libdir={- file_name_is_absolute($libdir)
? $libdir : '$(INSTALLTOP)\$(LIBDIR)' -}

CMAKECONFIGDIR=$(libdir)\cmake\OpenSSL

##### User defined commands and flags ################################

CC="{- $config{CC} -}"
Expand Down Expand Up @@ -557,6 +564,8 @@ install_dev: install_runtime_libs
@"$(PERL)" "$(SRCDIR)\util\copy.pl" $(INSTALL_LIBS) "$(libdir)"
@if "$(SHLIBS)"=="" \
"$(PERL)" "$(SRCDIR)\util\copy.pl" ossl_static.pdb "$(libdir)"
@"$(PERL)" "$(SRCDIR)\util\mkdir-p.pl" "$(CMAKECONFIGDIR)"
@"$(PERL)" "$(SRCDIR)\util\copy.pl" $(INSTALL_EXPORTERS_CMAKE) "$(CMAKECONFIGDIR)"

uninstall_dev:

Expand Down
8 changes: 8 additions & 0 deletions build.info
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,14 @@ IF[{- $config{target} =~ /^(?:Cygwin|mingw|VC-|BC-)/ -}]
SHARED_SOURCE[libssl]=libssl.rc
ENDIF

# This file sets the build directory up for CMake inclusion
GENERATE[OpenSSLConfig.cmake]=exporters/cmake/OpenSSLConfig.cmake.in
DEPEND[OpenSSLConfig.cmake]=builddata.pm
GENERATE[OpenSSLConfigVersion.cmake]=exporters/cmake/OpenSSLConfigVersion.cmake.in
DEPEND[OpenSSLConfigVersion.cmake]=builddata.pm
DEPEND[OpenSSLConfigVersion.cmake]=OpenSSLConfig.cmake
DEPEND[""]=OpenSSLConfigVersion.cmake

# This file sets the build directory up for pkg-config
GENERATE[libcrypto.pc]=exporters/pkg-config/libcrypto.pc.in
DEPEND[libcrypto.pc]=builddata.pm
Expand Down
12 changes: 11 additions & 1 deletion exporters/build.info
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
# For installation: OpenSSLConfig.cmake, OpenSSLConfigVersion.cmake
GENERATE[OpenSSLConfig.cmake]{exporter=cmake}=cmake/OpenSSLConfig.cmake.in
DEPEND[OpenSSLConfig.cmake]=../installdata.pm
GENERATE[OpenSSLConfigVersion.cmake]{exporter=cmake}=cmake/OpenSSLConfigVersion.cmake.in
DEPEND[OpenSSLConfigVersion.cmake]=../installdata.pm
DEPEND[OpenSSLConfigVersion.cmake]=OpenSSLConfig.cmake

DEPEND[""]=OpenSSLConfigVersion.cmake

# For installation: libcrypto.pc, libssl.pc, and openssl.pc
GENERATE[libcrypto.pc]{exporter=pkg-config}=pkg-config/libcrypto.pc.in
DEPEND[libcrypto.pc]=../installdata.pm
Expand All @@ -13,4 +22,5 @@ GENERATE[../installdata.pm]=../util/mkinstallvars.pl \
"PREFIX=$(INSTALLTOP)" BINDIR=bin "LIBDIR=$(LIBDIR)" \
INCLUDEDIR=include APPLINKDIR=include/openssl \
"ENGINESDIR=$(ENGINESDIR)" "MODULESDIR=$(MODULESDIR)" \
"VERSION=$(VERSION)" "LDLIBS=$(LIB_EX_LIBS)"
"PKGCONFIGDIR=$(PKGCONFIGDIR)" "CMAKECONFIGDIR=$(CMAKECONFIGDIR)" \
"LDLIBS=$(LIB_EX_LIBS)" "VERSION=$(VERSION)"
237 changes: 237 additions & 0 deletions exporters/cmake/OpenSSLConfig.cmake.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,237 @@
# Generated by OpenSSL
{-
use lib catdir($config{sourcedir}, 'Configurations');
use platform;
use Data::Dumper;

our %lib_info = (
map { my %x = ();
my $lib_static = platform->staticlib($_);
my $lib_shared =
(platform->can("sharedlib_simple")
? platform->sharedlib_simple($_)
: undef)
// platform->sharedlib($_);
my $lib_shared_import = platform->sharedlib_import($_);
$x{static} = $lib_static if $lib_static;
$x{shared} = $lib_shared if $lib_shared;
$x{shared_import} = $lib_shared_import if $lib_shared_import;
%x ? ( $_ => \%x ) : () }
grep { !$unified_info{attributes}->{libraries}->{$_}->{noinst} }
@{$unified_info{libraries}}
);
our $no_static = !$disabled{shared} && !$lib_info{libcrypto}->{static};
our $no_shared = $disabled{shared};

# Unixifying of paths, because that's what CMake understands.
# This assumes that the given path is absolute.
sub unixify {
use File::Spec;
use File::Spec::Unix;

my $path = shift;
my $no_file = shift;
(my $volume, $directories, $file) = File::Spec->splitpath($path, $no_file // ());
$directories = File::Spec::Unix->catdir(File::Spec->splitdir($directories));

# We know that $volume is ignored by File::Spec::Unix, so we handle it specially
# according to the conventions of the platform.
$volume =~ s|^(.*?):$|/$1| if $^O eq "vms"; # On VMS, DEV: -> /DEV

return $volume . File::Spec::Unix->catpath('', $directories, $no_file ? () : $file);
}
""
-}
# Commands may need to know the format version.
set(CMAKE_IMPORT_FILE_VERSION 1)

# Avoid duplicate find_package()
set(_ossl_expected_targets OpenSSL::Crypto OpenSSL::SSL
{- output_off() if $disabled{uplink}; "" -}OpenSSL::applink{- output_on() if $disabled{uplink}; "" -})
set(_ossl_defined_targets)
set(_ossl_undefined_targets)
foreach(t IN LISTS _ossl_expected_targets)
if(TARGET "${t}")
LIST(APPEND _ossl_defined_targets "${t}")
else()
LIST(APPEND _ossl_undefined_targets "${t}")
endif()
endforeach()
message(DEBUG "_ossl_expected_targets = ${_ossl_expected_targets}")
message(DEBUG "_ossl_defined_targets = ${_ossl_defined_targets}")
message(DEBUG "_ossl_undefined_targets = ${_ossl_undefined_targets}")
if(NOT _ossl_undefined_targets)
# All targets are defined, we're good, just undo everything and return
unset(_ossl_expected_targets)
unset(_ossl_defined_targets)
unset(_ossl_undefined_targets)
unset(CMAKE_IMPORT_FILE_VERSION)
return()
endif()
if(_ossl_defined_targets)
# We have a mix of defined and undefined targets. This is hard to reconcile,
# and probably the result of another config, or FindOpenSSL.cmake having been
# called, or whatever. Therefore, the best course of action is to quit with a
# hard error.
message(FATAL_ERROR "Some targets defined, others not:\nNot defined: ${_ossl_undefined_targets}\nDefined: ${_ossl_defined_targets}")
endif()
unset(_ossl_expected_targets)
unset(_ossl_defined_targets)
unset(_ossl_undefined_targets)

{-
# It can be argued that 'cmake_path' would be the better choice here. However,
# cmake_path is relatively new, while get_filename_component has been around
# since before CMake 3.0
-}
# Set up the import path, so all other import paths are made relative this file
get_filename_component(_ossl_prefix "${CMAKE_CURRENT_LIST_FILE}" PATH)
{-
# For each component in $OpenSSL::safe::installdata::CMAKECONFIGDIR_REL, have CMake
# out the parent directory.
my $d = unixify($OpenSSL::safe::installdata::CMAKECONFIGDIR_REL);
$OUT = '';
$OUT .= 'get_filename_component(_ossl_prefix "${_ossl_prefix}" PATH)' . "\n"
foreach (split '/', $d);
-}
if(_ossl_prefix STREQUAL "/")
set(_ossl_prefix "")
endif()

{- output_off() unless $disabled{shared}; "" -}
set(_ossl_use_static_libs True)
{- output_on() unless $disabled{shared}; "" -}
if(OPENSSL_USE_STATIC_LIBS)
set(_ossl_use_static_libs True)
elseif(DEFINED OPENSSL_USE_STATIC_LIBS)
# We know OPENSSL_USE_STATIC_LIBS is defined and False
if(_ossl_use_static_libs)
# OPENSSL_USE_STATIC_LIBS is explicitly false, indicating that shared libraries are
# required. However, _ossl_use_static_libs indicates that no shared libraries are
# available. The best course of action is to simply return and leave it to CMake to
# use another OpenSSL config.
unset(_ossl_use_static_libs)
unset(CMAKE_IMPORT_FILE_VERSION)
return()
endif()
endif()

# Version, copied from what find_package() gives, for compatibility with FindOpenSSL.cmake
set(OPENSSL_VERSION "${OpenSSL_VERSION}")
set(OPENSSL_VERSION_MAJOR "${OpenSSL_VERSION_MAJOR}")
set(OPENSSL_VERSION_MINOR "${OpenSSL_VERSION_MINOR}")
set(OPENSSL_VERSION_FIX "${OpenSSL_VERSION_PATCH}")
set(OPENSSL_FOUND YES)

# Directories and names
set(OPENSSL_INCLUDE_DIR "${_ossl_prefix}/{- unixify($OpenSSL::safe::installdata::INCLUDEDIR_REL, 1); -}")
set(OPENSSL_LIBRARY_DIR "${_ossl_prefix}/{- unixify($OpenSSL::safe::installdata::LIBDIR_REL, 1); -}")
set(OPENSSL_ENGINES_DIR "${_ossl_prefix}/{- unixify($OpenSSL::safe::installdata::ENGINESDIR_REL, 1); -}")
set(OPENSSL_MODULES_DIR "${_ossl_prefix}/{- unixify($OpenSSL::safe::installdata::MODULESDIR_REL, 1); -}")
set(OPENSSL_RUNTIME_DIR "${_ossl_prefix}/{- unixify($OpenSSL::safe::installdata::BINDIR_REL, 1); -}")
{- output_off() if $disabled{uplink}; "" -}
set(OPENSSL_APPLINK_SOURCE "${_ossl_prefix}/{- unixify($OpenSSL::safe::installdata::APPLINKDIR_REL, 1); -}/applink.c")
{- output_on() if $disabled{uplink}; "" -}
set(OPENSSL_PROGRAM "${OPENSSL_RUNTIME_DIR}/{- platform->bin('openssl') -}")

# Set up the imported targets
if(_ossl_use_static_libs)
{- output_off() unless $no_static; "" -}
# Static libraries are UNSUPPORTED in this configuration
{- output_on() unless $no_static; output_off() if $no_static; "" -}
add_library(OpenSSL::Crypto STATIC IMPORTED)
add_library(OpenSSL::SSL STATIC IMPORTED)

set(OPENSSL_LIBCRYPTO_STATIC "${OPENSSL_LIBRARY_DIR}/{- $lib_info{libcrypto}->{static} -}")
set(OPENSSL_LIBCRYPTO_DEPENDENCIES {- join(' ', @OpenSSL::safe::installdata::LDLIBS) -})
set_target_properties(OpenSSL::Crypto PROPERTIES
IMPORTED_LINK_INTERFACE_LANGUAGES "C"
IMPORTED_LOCATION ${OPENSSL_LIBCRYPTO_STATIC})
set_property(TARGET OpenSSL::Crypto
PROPERTY INTERFACE_LINK_LIBRARIES ${OPENSSL_LIBCRYPTO_DEPENDENCIES})

set(OPENSSL_LIBSSL_STATIC "${OPENSSL_LIBRARY_DIR}/{- $lib_info{libssl}->{static} -}")
set(OPENSSL_LIBSSL_DEPENDENCIES OpenSSL::Crypto)
set_target_properties(OpenSSL::SSL PROPERTIES
IMPORTED_LINK_INTERFACE_LANGUAGES "C"
IMPORTED_LOCATION ${OPENSSL_LIBSSL_STATIC})
set_property(TARGET OpenSSL::SSL
PROPERTY INTERFACE_LINK_LIBRARIES ${OPENSSL_LIBSSL_DEPENDENCIES})

# Directories and names compatible with CMake's FindOpenSSL.cmake
set(OPENSSL_CRYPTO_LIBRARY ${OPENSSL_LIBCRYPTO_STATIC})
set(OPENSSL_CRYPTO_LIBRARIES ${OPENSSL_CRYPTO_LIBRARY} ${OPENSSL_LIBCRYPTO_DEPENDENCIES})
set(OPENSSL_SSL_LIBRARY ${OPENSSL_LIBSSL_STATIC})
set(OPENSSL_SSL_LIBRARIES ${OPENSSL_SSL_LIBRARY} ${OPENSSL_LIBSSL_DEPENDENCIES})
set(OPENSSL_LIBRARIES ${OPENSSL_SSL_LIBRARY} ${OPENSSL_LIBSSL_DEPENDENCIES} ${OPENSSL_LIBCRYPTO_DEPENDENCIES})
{- output_on(); "" -}
else()
{- output_off() unless $no_shared; "" -}
# Shared libraries are UNSUPPORTED in this configuration
{- output_on() unless $no_shared;
output_off() if $no_shared; "" -}
add_library(OpenSSL::Crypto SHARED IMPORTED)
add_library(OpenSSL::SSL SHARED IMPORTED)
{- output_off() unless $lib_info{libcrypto}->{shared_import}; "" -}
set(OPENSSL_LIBCRYPTO_SHARED "${OPENSSL_RUNTIME_DIR}/{- $lib_info{libcrypto}->{shared} -}")
set(OPENSSL_LIBCRYPTO_IMPORT "${OPENSSL_LIBRARY_DIR}/{- $lib_info{libcrypto}->{shared_import} -}")
set(OPENSSL_LIBCRYPTO_DEPENDENCIES {- join(' ', @LDLIBS) -})
set_target_properties(OpenSSL::Crypto PROPERTIES
IMPORTED_LINK_INTERFACE_LANGUAGES "C"
IMPORTED_IMPLIB ${OPENSSL_LIBCRYPTO_IMPORT}
IMPORTED_LOCATION ${OPENSSL_LIBCRYPTO_SHARED})
set_property(TARGET OpenSSL::Crypto
PROPERTY INTERFACE_LINK_LIBRARIES ${OPENSSL_LIBCRYPTO_DEPENDENCIES})

set(OPENSSL_LIBSSL_SHARED "${OPENSSL_RUNTIME_DIR}/{- $lib_info{libssl}->{shared} -}")
set(OPENSSL_LIBSSL_IMPORT "${OPENSSL_LIBRARY_DIR}/{- $lib_info{libssl}->{shared_import} -}")
set(OPENSSL_LIBSSL_DEPENDENCIES OpenSSL::Crypto {- join(' ', @LDLIBS) -})
set_target_properties(OpenSSL::SSL PROPERTIES
IMPORTED_LINK_INTERFACE_LANGUAGES "C"
IMPORTED_IMPLIB ${OPENSSL_LIBSSL_IMPORT}
IMPORTED_LOCATION ${OPENSSL_LIBSSL_SHARED})
set_property(TARGET OpenSSL::SSL
PROPERTY INTERFACE_LINK_LIBRARIES ${OPENSSL_LIBSSL_DEPENDENCIES})

# Directories and names compatible with CMake's FindOpenSSL.cmake
set(OPENSSL_CRYPTO_LIBRARY ${OPENSSL_LIBCRYPTO_IMPORT})
set(OPENSSL_CRYPTO_LIBRARIES ${OPENSSL_CRYPTO_LIBRARY} ${OPENSSL_LIBCRYPTO_DEPENDENCIES})
set(OPENSSL_SSL_LIBRARY ${OPENSSL_LIBSSL_IMPORT})
set(OPENSSL_SSL_LIBRARIES ${OPENSSL_SSL_LIBRARY} ${OPENSSL_LIBSSL_DEPENDENCIES})
set(OPENSSL_LIBRARIES ${OPENSSL_SSL_LIBRARY} ${OPENSSL_LIBSSL_DEPENDENCIES} ${OPENSSL_LIBCRYPTO_DEPENDENCIES})
{- output_on() unless $lib_info{libcrypto}->{shared_import};
output_off() if $lib_info{libcrypto}->{shared_import}; "" -}
# Dependencies are assumed to be implied in the shared libraries
set(OPENSSL_LIBCRYPTO_SHARED "${OPENSSL_LIBRARY_DIR}/{- $lib_info{libcrypto}->{shared} -}")
set_target_properties(OpenSSL::Crypto PROPERTIES
IMPORTED_LINK_INTERFACE_LANGUAGES "C"
IMPORTED_LOCATION ${OPENSSL_LIBCRYPTO_SHARED})

set(OPENSSL_LIBSSL_SHARED "${OPENSSL_LIBRARY_DIR}/{- $lib_info{libssl}->{shared} -}")
set_target_properties(OpenSSL::SSL PROPERTIES
IMPORTED_LINK_INTERFACE_LANGUAGES "C"
IMPORTED_LOCATION ${OPENSSL_LIBSSL_SHARED})

# Directories and names compatible with CMake's FindOpenSSL.cmake
set(OPENSSL_CRYPTO_LIBRARY ${OPENSSL_LIBCRYPTO_SHARED})
set(OPENSSL_CRYPTO_LIBRARIES ${OPENSSL_CRYPTO_LIBRARY})
set(OPENSSL_SSL_LIBRARY ${OPENSSL_LIBSSL_SHARED})
set(OPENSSL_SSL_LIBRARIES ${OPENSSL_SSL_LIBRARY})
set(OPENSSL_LIBRARIES ${OPENSSL_SSL_LIBRARIES})
{- output_on() if $lib_info{libcrypto}->{shared_import}; "" -}
{- output_on() if $no_shared; "" -}
endif()

set_target_properties(OpenSSL::Crypto PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${OPENSSL_INCLUDE_DIR}")
set_target_properties(OpenSSL::SSL PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${OPENSSL_INCLUDE_DIR}")

{- output_off() if $disabled{uplink}; "" -}
add_library(OpenSSL::applink INTERFACE IMPORTED)
set_property(TARGET OpenSSL::applink PROPERTY
INTERFACE_SOURCES "${OPENSSL_APPLINK_SOURCE}")
{- output_on() if $disabled{uplink}; "" -}

unset(_ossl_prefix)
unset(_ossl_use_static_libs)
17 changes: 17 additions & 0 deletions exporters/cmake/OpenSSLConfigVersion.cmake.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Generated by OpenSSL

set(PACKAGE_VERSION {- $config{version} -})

if(NOT PACKAGE_FIND_VERSION)
# find_package() was called without any version information. This is assumed to
# mean that the caller accepts whatever they get.
set(PACKAGE_VERSION_COMPATIBLE 1)
elseif(PACKAGE_FIND_VERSION_MAJOR LESS {- my $x = $config{version}; $x =~ s/\..*//; $x -}
OR PACKAGE_FIND_VERSION VERSION_GREATER {- $config{version} -})
set(PACKAGE_VERSION_UNSUITABLE 1)
else()
set(PACKAGE_VERSION_COMPATIBLE 1)
if(PACKAGE_FIND_VERSION VERSION_EQUAL {- $config{version} -})
set(PACKAGE_VERSION_EXACT 1)
endif()
endif()
Loading

0 comments on commit c768cce

Please sign in to comment.