aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/boringssl/install-pc-files.cmake
blob: 47eab26cdc6a446e80bcabf9088f63e9a259d913 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
function(install_pc_file name pc_data)
    # fix platform-specific details
    if (NOT VCPKG_TARGET_IS_WINDOWS)
        string(REPLACE "-lcrypt32" "" pc_data "${pc_data}")
        string(REPLACE "-lws2_32" "" pc_data "${pc_data}")
        string(REPLACE "-llibssl" "-lssl" pc_data "${pc_data}")
        string(REPLACE "-llibcrypto" "-lcrypto" pc_data "${pc_data}")
    elseif (NOT VCPKG_TARGET_IS_MINGW)
        string(REPLACE "-llibssl" "-lssl" pc_data "${pc_data}")
        string(REPLACE "-llibcrypto" "-lcrypto" pc_data "${pc_data}")
    endif()
    if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release")
        configure_file("${CMAKE_CURRENT_LIST_DIR}/openssl.pc.in" "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/${name}.pc" @ONLY)
    endif()
    if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
        if(VCPKG_TARGET_IS_WINDOWS)
            if (NOT VCPKG_TARGET_IS_MINGW)
                string(REPLACE "-lssl" "-lssld" pc_data "${pc_data}")
                string(REPLACE "-lcrypto" "-lcryptod" pc_data "${pc_data}")
            else()
                string(REPLACE "-llibssl" "-llibssld" pc_data "${pc_data}")
                string(REPLACE "-llibcrypto" "-llibcryptod" pc_data "${pc_data}")
            endif()
        endif()
        configure_file("${CMAKE_CURRENT_LIST_DIR}/openssl.pc.in" "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/${name}.pc" @ONLY)
    endif()
endfunction()

install_pc_file(openssl [[
Name: BoringSSL
Description: Secure Sockets Layer and cryptography libraries and tools
Requires: libssl libcrypto
]])

install_pc_file(libssl [[
Name: BoringSSL-libssl
Description: Secure Sockets Layer and cryptography libraries
Libs: -L"${libdir}" -llibssl
Requires: libcrypto
Cflags: -I"${includedir}"
]])

install_pc_file(libcrypto [[
Name: BoringSSL-libcrypto
Description: OpenSSL cryptography library
Libs: -L"${libdir}" -llibcrypto
Libs.private: -lcrypt32 -lws2_32
Cflags: -I"${includedir}"
]])

vcpkg_fixup_pkgconfig()