forked from microsoft/vcpkg
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[aliyun-oss-cpp-sdk] add new port (microsoft#40597)
Co-authored-by: 牧亦 <luanjun.lj@alibaba-inc.com>
- Loading branch information
Showing
6 changed files
with
119 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
diff --git a/sdk/CMakeLists.txt b/sdk/CMakeLists.txt | ||
index 28d04c2..c7b2e6c 100644 | ||
--- a/sdk/CMakeLists.txt | ||
+++ b/sdk/CMakeLists.txt | ||
@@ -146,6 +146,13 @@ set_target_properties(${PROJECT_NAME}${STATIC_LIB_SUFFIX} | ||
OUTPUT_NAME ${TARGET_OUTPUT_NAME_PREFIX}${PROJECT_NAME}${STATIC_LIB_SUFFIX} | ||
) | ||
|
||
+target_include_directories(${PROJECT_NAME}${STATIC_LIB_SUFFIX} | ||
+ PUBLIC $<INSTALL_INTERFACE:include> | ||
+) | ||
+ | ||
+target_link_libraries(${PROJECT_NAME}${STATIC_LIB_SUFFIX} ${CRYPTO_LIBS}) | ||
+target_link_libraries(${PROJECT_NAME}${STATIC_LIB_SUFFIX} ${CLIENT_LIBS}) | ||
+ | ||
target_include_directories(${PROJECT_NAME}${STATIC_LIB_SUFFIX} | ||
PRIVATE include | ||
PRIVATE include/alibabacloud/oss | ||
@@ -172,7 +179,11 @@ if (BUILD_SHARED_LIBS) | ||
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib | ||
OUTPUT_NAME ${TARGET_OUTPUT_NAME_PREFIX}${PROJECT_NAME} | ||
) | ||
- | ||
+ | ||
+ target_include_directories(${PROJECT_NAME} | ||
+ PUBLIC $<INSTALL_INTERFACE:include> | ||
+ ) | ||
+ | ||
target_include_directories(${PROJECT_NAME} | ||
PRIVATE include | ||
PRIVATE include/alibabacloud/oss | ||
@@ -210,16 +221,22 @@ install(FILES ${sdk_encryption_header} | ||
install(FILES ${sdk_public_header} | ||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/alibabacloud/oss) | ||
|
||
-install(TARGETS ${PROJECT_NAME}${STATIC_LIB_SUFFIX} | ||
+install(TARGETS ${PROJECT_NAME}${STATIC_LIB_SUFFIX} EXPORT unofficial-aliyun-oss-cpp-sdk-config | ||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} | ||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} | ||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} | ||
) | ||
|
||
if (BUILD_SHARED_LIBS) | ||
-install(TARGETS ${PROJECT_NAME} | ||
+install(TARGETS ${PROJECT_NAME} EXPORT unofficial-aliyun-oss-cpp-sdk-config | ||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} | ||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} | ||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} | ||
) | ||
-endif() | ||
\ No newline at end of file | ||
+endif() | ||
+ | ||
+install( | ||
+ EXPORT unofficial-aliyun-oss-cpp-sdk-config | ||
+ NAMESPACE unofficial::aliyun-oss-cpp-sdk:: | ||
+ DESTINATION share/unofficial-aliyun-oss-cpp-sdk | ||
+) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
vcpkg_from_github( | ||
OUT_SOURCE_PATH SOURCE_PATH | ||
REPO aliyun/aliyun-oss-cpp-sdk | ||
REF "${VERSION}" | ||
SHA512 7773961ad380d28cda96e16ae6491a76e03f0cb5f0c5135b660179dd449d730e1dfffb916489ed60e13815f53566c24cd9cfd8985c468438369341358eeed3bd | ||
HEAD_REF master | ||
PATCHES | ||
cmake-export.patch | ||
) | ||
|
||
vcpkg_cmake_configure( | ||
SOURCE_PATH "${SOURCE_PATH}" | ||
OPTIONS | ||
-DBUILD_SAMPLE=OFF | ||
) | ||
|
||
vcpkg_cmake_install() | ||
|
||
vcpkg_cmake_config_fixup(PACKAGE_NAME unofficial-${PORT}) | ||
|
||
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") | ||
|
||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") | ||
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
The package aliyun-oss-cpp-sdk provides CMake targets: | ||
|
||
find_package(unofficial-aliyun-oss-cpp-sdk CONFIG REQUIRED) | ||
target_link_libraries(main PRIVATE unofficial::aliyun-oss-cpp-sdk::cpp-sdk) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"name": "aliyun-oss-cpp-sdk", | ||
"version": "1.10.0", | ||
"description": "Alibaba Cloud Object Storage Service (OSS) is a cloud storage service provided by Alibaba Cloud, featuring massive capacity, security, a low cost, and high reliability.", | ||
"homepage": "https://github.com/aliyun/aliyun-oss-cpp-sdk", | ||
"license": "Apache-2.0", | ||
"supports": "linux | osx | android", | ||
"dependencies": [ | ||
"curl", | ||
"openssl", | ||
{ | ||
"name": "vcpkg-cmake", | ||
"host": true | ||
}, | ||
{ | ||
"name": "vcpkg-cmake-config", | ||
"host": true | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"versions": [ | ||
{ | ||
"git-tree": "cb847011bd7b34fe9ce8ce2ebf15141de1588003", | ||
"version": "1.10.0", | ||
"port-version": 0 | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters