2018-02-14 08:43:42 +08:00
|
|
|
vcpkg_from_github(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
REPO uriparser/uriparser
|
2022-11-04 06:15:26 +08:00
|
|
|
REF 634b678fa858abf1d1ebc0634e96e9e29596e92a # uriparser-0.9.7
|
|
|
|
SHA512 124d1b772b365af3c603146c65986698a94e839e5499da6391694d7958d73bfad38d59f967836270c2a190a1c8d2309fb5ad6068543ce40e4847523e55ca26b9
|
2019-05-08 05:50:54 +08:00
|
|
|
HEAD_REF master
|
2017-07-22 12:56:20 +08:00
|
|
|
)
|
|
|
|
|
2019-05-08 05:50:54 +08:00
|
|
|
if("tool" IN_LIST FEATURES)
|
|
|
|
set(URIPARSER_BUILD_TOOLS ON)
|
|
|
|
else()
|
|
|
|
set(URIPARSER_BUILD_TOOLS OFF)
|
|
|
|
endif()
|
|
|
|
|
2021-09-08 12:04:44 +08:00
|
|
|
vcpkg_cmake_configure(
|
|
|
|
SOURCE_PATH "${SOURCE_PATH}"
|
2019-05-08 05:50:54 +08:00
|
|
|
OPTIONS
|
|
|
|
-DURIPARSER_BUILD_DOCS=OFF
|
|
|
|
-DURIPARSER_BUILD_TESTS=OFF
|
|
|
|
OPTIONS_DEBUG
|
|
|
|
-DURIPARSER_BUILD_TOOLS=OFF
|
|
|
|
OPTIONS_RELEASE
|
|
|
|
-DURIPARSER_BUILD_TOOLS=${URIPARSER_BUILD_TOOLS}
|
2017-07-22 12:56:20 +08:00
|
|
|
)
|
|
|
|
|
2021-09-08 12:04:44 +08:00
|
|
|
vcpkg_cmake_install()
|
2019-05-08 05:50:54 +08:00
|
|
|
|
2017-07-22 12:56:20 +08:00
|
|
|
vcpkg_copy_pdbs()
|
|
|
|
|
2019-05-08 05:50:54 +08:00
|
|
|
if(URIPARSER_BUILD_TOOLS)
|
2020-05-02 06:28:55 +08:00
|
|
|
vcpkg_copy_tools(
|
|
|
|
TOOL_NAMES uriparse
|
|
|
|
AUTO_CLEAN
|
|
|
|
)
|
2019-05-08 05:50:54 +08:00
|
|
|
endif()
|
|
|
|
|
|
|
|
set(_package_version_re "#define[ ]+PACKAGE_VERSION[ ]+\"([0-9]+.[0-9]+.[0-9]+)\"")
|
|
|
|
file(STRINGS
|
2022-11-04 06:15:26 +08:00
|
|
|
"${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/UriConfig.h"
|
2019-05-08 05:50:54 +08:00
|
|
|
_package_version_define REGEX "${_package_version_re}"
|
|
|
|
)
|
|
|
|
string(REGEX REPLACE "${_package_version_re}" "\\1" _package_version ${_package_version_define})
|
|
|
|
|
2021-09-08 12:04:44 +08:00
|
|
|
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/${PORT}-${_package_version})
|
2019-05-08 05:50:54 +08:00
|
|
|
|
|
|
|
if(VCPKG_LIBRARY_LINKAGE STREQUAL static)
|
|
|
|
vcpkg_replace_string(
|
2021-09-08 12:04:44 +08:00
|
|
|
"${CURRENT_PACKAGES_DIR}/include/uriparser/UriBase.h"
|
2019-05-08 05:50:54 +08:00
|
|
|
"defined(URI_STATIC_BUILD)"
|
|
|
|
"1 // defined(URI_STATIC_BUILD)"
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
2021-09-08 12:04:44 +08:00
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include" "${CURRENT_PACKAGES_DIR}/debug/share")
|
2019-04-24 06:02:52 +08:00
|
|
|
|
2021-09-08 12:04:44 +08:00
|
|
|
file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
|
2022-11-04 06:15:26 +08:00
|
|
|
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
|
2021-10-28 06:19:28 +08:00
|
|
|
|
|
|
|
vcpkg_fixup_pkgconfig()
|