[openvpn3] Export cmake target (#24955)

* Add Config.cmake.in

* export cmake targets

* update namespace
This commit is contained in:
Mengna Li 2022-06-01 07:16:07 +08:00 committed by GitHub
parent 49cfe5e329
commit f14179a5d2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 22 additions and 1 deletions

View File

@ -20,13 +20,21 @@ endif()
add_library(ovpncli client/ovpncli.cpp)
target_link_libraries(ovpncli PRIVATE Iphlpapi.lib Wininet.lib Setupapi.lib Cfgmgr32.lib Rpcrt4.lib Fwpuclnt.lib Wtsapi32.lib ${MBEDTLS_LIB} ${MBEDCRYPTO_LIB} ${MBEDX509_LIB})
target_include_directories(ovpncli PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}> $<INSTALL_INTERFACE:include>)
install(
TARGETS ovpncli
EXPORT unofficial-openvpnConfig
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
)
INSTALL(EXPORT unofficial-openvpnConfig
NAMESPACE unofficial::openvpn3::
DESTINATION share/unofficial-openvpn
)
if(BUILD_TOOL)
add_executable(cli test/ovpncli/cli.cpp)
target_compile_definitions(cli PRIVATE -DTAP_WIN_COMPONENT_ID=tap0901)

View File

@ -29,6 +29,9 @@ foreach(HEADER IN LISTS HEADERS)
file(WRITE "${HEADER}" "${_contents}")
endforeach()
vcpkg_cmake_config_fixup(PACKAGE_NAME unofficial-openvpn CONFIG_PATH share/unofficial-openvpn)
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
file(INSTALL
"${SOURCE_PATH}/COPYRIGHT.AGPLV3"
DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)

View File

@ -1,6 +1,7 @@
{
"name": "openvpn3",
"version": "3.7.0",
"port-version": 1,
"description": "a C++ class library that implements the functionality of an OpenVPN client, and is protocol-compatible with the OpenVPN 2.x branch.",
"homepage": "https://openvpn.net",
"license": "AGPL-3.0",
@ -14,6 +15,10 @@
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
]
}

View File

@ -5222,7 +5222,7 @@
},
"openvpn3": {
"baseline": "3.7.0",
"port-version": 0
"port-version": 1
},
"openvr": {
"baseline": "1.16.8",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "352f972ff2ff0cfb7305f779253f322ba72e14f5",
"version": "3.7.0",
"port-version": 1
},
{
"git-tree": "901a710e937496a572cdb5b64d2401c18919ffde",
"version": "3.7.0",