mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-22 12:07:49 +08:00
442d5c1b54
* added find_package for cpr on install How to use: find_package ( CPR REQUIRED ) if ( CPR_FOUND ) message ( STATUS "CPR_INCLUDE_DIRS = ${CPR_INCLUDE_DIRS}" ) message ( STATUS "CPR_LIBRARIES = ${CPR_LIBRARIES}" ) include_directories ( ${CPR_INCLUDE_DIRS} ) endif ( CPR_FOUND ) * [cpr] Provide config and targets files
37 lines
1.0 KiB
CMake
37 lines
1.0 KiB
CMake
include(vcpkg_common_functions)
|
|
|
|
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
|
|
|
|
vcpkg_from_github(
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
REPO whoshuu/cpr
|
|
REF 1.3.0
|
|
SHA512 fd08f8a592a5e1fb8dc93158a4850b81575983c08527fb415f65bd9284f93c804c8680d16c548744583cd26b9353a7d4838269cfc59ccb6003da8941f620c273
|
|
HEAD_REF master
|
|
PATCHES
|
|
001-cpr-config.patch
|
|
)
|
|
|
|
vcpkg_configure_cmake(
|
|
SOURCE_PATH ${SOURCE_PATH}
|
|
PREFER_NINJA
|
|
OPTIONS
|
|
-DBUILD_CPR_TESTS=OFF
|
|
-DUSE_SYSTEM_CURL=ON
|
|
OPTIONS_DEBUG
|
|
-DDISABLE_INSTALL_HEADERS=ON
|
|
)
|
|
|
|
vcpkg_install_cmake()
|
|
|
|
file(INSTALL ${CMAKE_CURRENT_LIST_DIR}/cprConfig.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/lib/cmake/cpr)
|
|
vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/cpr)
|
|
|
|
vcpkg_copy_pdbs()
|
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
|
|
|
|
# Handle copyright
|
|
file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/cpr)
|
|
file(RENAME ${CURRENT_PACKAGES_DIR}/share/cpr/LICENSE ${CURRENT_PACKAGES_DIR}/share/cpr/copyright)
|