1

I am trying to add aws-sdk-cpp as a submodule in my Qt application using Qt Creator and CMake. I want it to build for any platform without doing the building and installing on the command line as described here.

My project structure and CMakeLists.txt files looks like this:

Project structure

I have successfully built the entire aws-sdk-cpp using MSVC2019 in debug mode using Qt Creator. My projects build folder is now 15 GB containing all the built libraries. The current issue I'm now facing is this error:

CMake Error at app/CMakeLists.txt:23 (find_package):
By not providing "FindAWSSDK.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "AWSSDK", but
CMake did not find one.

Could not find a package configuration file provided by "AWSSDK" with any
of the following names:

AWSSDKConfig.cmake
awssdk-config.cmake

Add the installation prefix of "AWSSDK" to CMAKE_PREFIX_PATH or set
"AWSSDK_DIR" to a directory containing one of the above files.  If "AWSSDK"
provides a separate development package or SDK, be sure it has been
installed.

I think what is missing is the make install step described here and to set the path to AWSSDK_DIR.

I'm very new to CMake and I have not found any way to perform the make install step in the CMakeLists.txt file and then be able to set the AWSSDK_DIR which points to the AWSSDKConfig.cmake or awssdk-config.cmake file missing.

I'm also not sure which CMakeLists.txt file this should be written or if there is an entire other way to do this? Currently I'm stuck getting nowhere..

eyllanesc
  • 235,170
  • 19
  • 170
  • 241
uniquenamehere
  • 1,869
  • 3
  • 31
  • 60
  • 1
    "I think what is missing is the `make install` step" - Yes, you are missing "install" step. "I have not found any way to perform the `make install` step" - Do you mean that you haven't found how to perform that step in QT Creator (since you use it for build AWS SDK)? Have you checked [that question](https://stackoverflow.com/questions/50316551/where-to-add-make-install-in-qt-creator)? – Tsyvarev Dec 30 '20 at 09:07
  • @Tsyvarev I was thinking that I want to get these commands into the CMakeLists.txt files if possible. And add the necessary paths so my app can use the built libraries. I think that this should be possible somehow? Adding make install in Qt Creator does not perform make install on the aws-sdk-cpp at the right time, if at all I think? Any suggestions on how to do this is very welcome! – uniquenamehere Dec 31 '20 at 00:34
  • Oh, I missed the part that you want to build aws-sdk as a **submodule**. Not sure whether this is intended to work, but their top-level `CMakeLists.txt` is definitely prepared to be non-root one. However, I don't know what could be a replacement for `find_package(AWSSDK)`, it seems that the script [AWSSDKConfig.cmake](https://github.com/aws/aws-sdk-cpp/blob/master/cmake/AWSSDKConfig.cmake) is suited only for *installation* tree, not for the *build* one. – Tsyvarev Dec 31 '20 at 10:46
  • And please, paste your code into the question as a **text**, not as an *image*. This is a requirement of Stack Overflow. – Tsyvarev Dec 31 '20 at 10:47
  • I have stumbled upon this question ahead of time... I am still building the aws-sdk-qt by pcolby... and its taking hours together to build in VS2019... thanks for the Question – Som Pra Jun 13 '22 at 17:45
  • To all those who are trying this... This error comes when you create sdk_install or build files inside source folder. I cloned the repo recursively and built into a folder outside the cloned one. This problem solved but when I tried to run the S3 sample code I am not getting any output... no errors no warnings and in debugger a aws sdk dll file is showing exception. I think the main repo when I cloned was having issues so will try to clone a release next. – Som Pra Jun 17 '22 at 15:20

0 Answers0