From 6b11f9746d523f1bf6d57b156af40df63b9460aa Mon Sep 17 00:00:00 2001 From: jim wang <122244446+jimwang118@users.noreply.github.com> Date: Wed, 29 May 2024 08:43:10 +0000 Subject: [PATCH] [aws-sdk-cpp] Fixed issue where curl and zlib cannot be found when using (#38861) Fix issue in comment [issuecomment](https://github.com/microsoft/vcpkg/pull/38215#issuecomment-2122692264). ``` CMake Error at /mnt/vcpkg/scripts/buildsystems/vcpkg.cmake:598 (_add_executable): Target "example" links to target "CURL::libcurl" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing? Call Stack (most recent call first): CMakeLists.txt:11 (add_executable) CMake Error at /mnt/vcpkg/scripts/buildsystems/vcpkg.cmake:598 (_add_executable): Target "example" links to target "ZLIB::ZLIB" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing? Call Stack (most recent call first): CMakeLists.txt:11 (add_executable) ``` Fixed the issue that curl and zlib cannot be found when calling s3 feature. - [X] Changes comply with the [maintainer guide](https://github.com/microsoft/vcpkg-docs/blob/main/vcpkg/contributing/maintainer-guide.md). - [ ] ~~SHA512s are updated for each updated download.~~ - [ ] ~~The "supports" clause reflects platforms that may be fixed by this new version.~~ - [ ] ~~Any fixed [CI baseline](https://github.com/microsoft/vcpkg/blob/master/scripts/ci.baseline.txt) entries are removed from that file.~~ - [ ] ~~Any patches that are no longer applied are deleted from the port's directory.~~ - [X] The version database is fixed by rerunning `./vcpkg x-add-version --all` and committing the result. - [X] Only one version is added to each modified port's versions file. Usage test pass with following triplets: ``` x64-windows x64-linux ``` --- ports/aws-sdk-cpp/portfile.cmake | 9 +++++++++ ports/aws-sdk-cpp/vcpkg.json | 2 +- versions/a-/aws-sdk-cpp.json | 5 +++++ versions/baseline.json | 2 +- 4 files changed, 16 insertions(+), 2 deletions(-) diff --git a/ports/aws-sdk-cpp/portfile.cmake b/ports/aws-sdk-cpp/portfile.cmake index a4b0039aec..7696d7c2dd 100644 --- a/ports/aws-sdk-cpp/portfile.cmake +++ b/ports/aws-sdk-cpp/portfile.cmake @@ -72,6 +72,15 @@ foreach(AWS_CONFIG IN LISTS AWS_CONFIGS) file(READ "${AWS_CONFIG}" _contents) file(WRITE "${AWS_CONFIG}" "include(CMakeFindDependencyMacro)\nfind_dependency(aws-cpp-sdk-core)\n${_contents}") endforeach() +vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/share/awssdk/AWSSDKConfig.cmake" "include(${CMAKE_CURRENT_LIST_DIR}/compiler_settings.cmake)" +[[include(${CMAKE_CURRENT_LIST_DIR}/compiler_settings.cmake) +include(CMakeFindDependencyMacro) +find_dependency(ZLIB) +find_dependency(CURL)]]) +vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/share/aws-cpp-sdk-core/aws-cpp-sdk-core-config.cmake" "find_dependency(aws-crt-cpp)" +[[find_dependency(aws-crt-cpp) +find_dependency(ZLIB) +find_dependency(CURL)]]) file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include" diff --git a/ports/aws-sdk-cpp/vcpkg.json b/ports/aws-sdk-cpp/vcpkg.json index 93df560956..fdcca1c89a 100644 --- a/ports/aws-sdk-cpp/vcpkg.json +++ b/ports/aws-sdk-cpp/vcpkg.json @@ -2,7 +2,7 @@ "$note": "Automatically generated by generateFeatures.ps1", "name": "aws-sdk-cpp", "version": "1.11.285", - "port-version": 1, + "port-version": 2, "description": "AWS SDK for C++", "homepage": "https://github.com/aws/aws-sdk-cpp", "license": "Apache-2.0", diff --git a/versions/a-/aws-sdk-cpp.json b/versions/a-/aws-sdk-cpp.json index 21e358fc32..11ca0e6b46 100644 --- a/versions/a-/aws-sdk-cpp.json +++ b/versions/a-/aws-sdk-cpp.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "252f02a82047e15da94b42568b63b4064ae55e56", + "version": "1.11.285", + "port-version": 2 + }, { "git-tree": "86cda4ed313a3d7b3b6bd63cd7eb67f947e87855", "version": "1.11.285", diff --git a/versions/baseline.json b/versions/baseline.json index cdc6375f69..fefef2a087 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -426,7 +426,7 @@ }, "aws-sdk-cpp": { "baseline": "1.11.285", - "port-version": 1 + "port-version": 2 }, "azmq": { "baseline": "2023-03-23",