Skip to content

Commit

Permalink
configure the package config file openssl.pc
Browse files Browse the repository at this point in the history
  • Loading branch information
janbar committed Nov 30, 2023
1 parent 434e1aa commit da217f1
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 6 deletions.
9 changes: 9 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,15 @@ install( FILES

install( DIRECTORY doc DESTINATION share )

set( prefix "${CMAKE_INSTALL_PREFIX}" )
set( includedir "include" )
set( libdir "lib" )
get_target_property( libcrypto crypto OUTPUT_NAME )
get_target_property( libssl ssl OUTPUT_NAME )
configure_file(openssl.pc.in.cmake openssl.pc @ONLY)
install (FILES ${CMAKE_CURRENT_BINARY_DIR}/openssl.pc
DESTINATION lib/pkgconfig)

configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake IMMEDIATE @ONLY
Expand Down
6 changes: 3 additions & 3 deletions crypto/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -298,14 +298,14 @@ set_target_properties( crypto PROPERTIES

if( ANDROID )
set_target_properties( crypto PROPERTIES OUTPUT_NAME "crypto_1_1" )
endif()

if( MSVC )
elseif( MSVC )
if( CMAKE_SIZEOF_VOID_P EQUAL 8 )
set_target_properties( crypto PROPERTIES OUTPUT_NAME "crypto-1_1-x64" )
elseif( CMAKE_SIZEOF_VOID_P EQUAL 4 )
set_target_properties( crypto PROPERTIES OUTPUT_NAME "crypto-1_1" )
endif()
else()
set_target_properties( crypto PROPERTIES OUTPUT_NAME "crypto" )
endif()

install( TARGETS crypto
Expand Down
10 changes: 10 additions & 0 deletions openssl.pc.in.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
prefix=@prefix@
exec_prefix=${prefix}
libdir=${exec_prefix}/@libdir@
includedir=${prefix}/@includedir@

Name: OpenSSL
Description: Secure Sockets Layer and cryptography libraries and tools
Version: @VERSION_STRING@
Libs: -L${libdir} -l@libssl@ -l@libcrypto@

6 changes: 3 additions & 3 deletions ssl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,14 @@ set_target_properties( ssl PROPERTIES

if( ANDROID )
set_target_properties( ssl PROPERTIES OUTPUT_NAME "ssl_1_1" )
endif()

if( MSVC )
elseif( MSVC )
if( CMAKE_SIZEOF_VOID_P EQUAL 8 )
set_target_properties( ssl PROPERTIES OUTPUT_NAME "ssl-1_1-x64" )
elseif( CMAKE_SIZEOF_VOID_P EQUAL 4 )
set_target_properties( ssl PROPERTIES OUTPUT_NAME "ssl-1_1" )
endif()
else()
set_target_properties( ssl PROPERTIES OUTPUT_NAME "ssl" )
endif()

install( TARGETS ssl
Expand Down

0 comments on commit da217f1

Please sign in to comment.