blob: 158f9a84bdd4d1988a7de2cf409a58c836fb97bc [file] [log] [blame]
Bill Roberts202a1632024-01-09 13:10:05 -06001if(NOT DISABLE_PACKAGE_CONFIG_AND_INSTALL)
2 include(JoinPaths.cmake)
3 join_paths(PKGCONFIG_INCLUDEDIR "\${prefix}" "${CMAKE_INSTALL_INCLUDEDIR}")
4 join_paths(PKGCONFIG_LIBDIR "\${prefix}" "${CMAKE_INSTALL_LIBDIR}")
5
6 #define these manually since minimum CMAKE version is not 3.9 for DESCRIPTION and 3.12 for HOMEPAGE_URL usage in project() below.
7 # Prefix with something that won't clash with newer versions of CMAKE.
8 set(PKGCONFIG_PROJECT_DESCRIPTION "Mbed TLS is a C library that implements cryptographic primitives, X.509 certificate manipulation and the SSL/TLS and DTLS protocols. Its small code footprint makes it suitable for embedded systems.")
9 set(PKGCONFIG_PROJECT_HOMEPAGE_URL "https://www.trustedfirmware.org/projects/mbed-tls/")
10
11 # Following the conventsion for DESCRIPTION and HOMEPAGE_URL, VERSION wasn't added until 3.0 and depends on policy CMP0048
Manuel Pégourié-Gonnard9f7cc4c2024-08-26 12:44:41 +020012 set(PKGCONFIG_VERSION 2.28.9)
Bill Roberts202a1632024-01-09 13:10:05 -060013
14 configure_file(mbedcrypto.pc.in mbedcrypto.pc @ONLY)
15 install(FILES
16 ${CMAKE_CURRENT_BINARY_DIR}/mbedcrypto.pc
17 DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
18
19 configure_file(mbedtls.pc.in mbedtls.pc @ONLY)
20 install(FILES
21 ${CMAKE_CURRENT_BINARY_DIR}/mbedtls.pc
22 DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
23
24 configure_file(mbedx509.pc.in mbedx509.pc @ONLY)
25 install(FILES
26 ${CMAKE_CURRENT_BINARY_DIR}/mbedx509.pc
27 DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
28endif()