Asking so I can answer this myself, lost a day to it and want to save other folks the trouble.
Setup:
- Windows (seen on both Windows 10 and Server 2019)
- Visual Studio (seen on both Visual Studio 2017 and Visual Studio 2019)
- cmake 3.19.0-rc1 (latest download as of this post)
- Following instructions at https://docs.aws.amazon.com/sdk-for-cpp/v1/developer-guide/setup.html for Windows build-from-source of the AWS C++ SDK. Happens both for standard build from source and
vcpkg
alternative. Also happens if you try to go build the "3rd party dependencies" mentioned at https://github.com/aws/aws-sdk-cpp manually.
You try something like:
git clone https://github.com/aws/aws-sdk-cpp.git
cd aws-sdk-cpp
mkdir build
cd build
cmake ..
You get complaints from cmake ending:
[...]
Performing configure step for 'AwsChecksums'
-- Selecting Windows SDK version 10.0.18362.0 to target Windows 10.0.17763.
-- The C compiler identification is MSVC 19.27.29112.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.27.29110/bin/Hostx64/x64/cl.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Configuring done
CUSTOMBUILD : CMake error : install(EXPORT "aws-checksums-targets" ...) includes target "aws-checksums" more than once in the export set. [C:\Users\xyz\aws-sdk-cpp\build\.deps\AwsChecksums.vcxproj]
-- Generating done
CMake Generate step failed. Build files cannot be regenerated correctly.
CMake Error at CMakeLists.txt:224 (message):
Failed to build third-party libraries.
There is a similar line reading CUSTOMBUILD : CMake error : install(EXPORT "aws-c-common-targets" ...) includes target "aws-c-common" more than once in the export set. [C:\Users\xyz\aws-sdk-cpp\build\.deps\AwsCCommon.vcxproj]
Completely non-obvious, but the issue appears to be with "cmake 3.19.0-rc1". Changing to cmake 3.18.4 bypassed the issue. I can't tell if this is a cmake issue or an sdk issue, or I'd be posting on somebody's github instead of stackoverflow.