3

Asking so I can answer this myself, lost a day to it and want to save other folks the trouble.

Setup:

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]

jdowdell
  • 1,578
  • 12
  • 24

2 Answers2

7

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.

jdowdell
  • 1,578
  • 12
  • 24
  • I am glad you have got your solution and thanks for your sharing, I would appreciate it if you mark them as answer and this will be beneficial to other community. – Barrnet Chou Oct 26 '20 at 07:08
  • I was unclear if marking your own answer as "accepted" was good practice, I have accepted it. – jdowdell Oct 28 '20 at 03:54
  • I found this issue also appears with cmake 3.19.1. – yhokazon Dec 15 '20 at 08:23
  • So glad you posted our experience. I have changed some things, including (but not only) CMake and this was the last thing I expected to cause problems. Fixed going from 3.19.1 to 3.18.5. – olepinto Jan 14 '21 at 09:58
1

I had the same issue, and I found out that the CMake that ships with Visual Studio 2019 16.9.1 is broken (version reported as 3.19.20122902-MSVC_2).

I changed the path to CMake to point to that used by Vcpkg, which is version 3.19.2 and now it works just fine.

Therefore I assume the bug is in the CMake that ships with Visual Studio, and was fixed in 3.19.2.

  • I'm trying to install aws-sdk using vcpkg and I'm getting this error - vcpkg on Windows doesn't seem to have its own cmake? I have the same broken cmake version you mention. – Hamish Moffatt Apr 22 '21 at 01:30