aws / aws-iot-device-sdk-embedded-C

SDK for connecting to AWS IoT from a device using embedded C.
MIT License
984 stars 633 forks source link

CMake Configuration error when the SDK is not on the top level of the source tree #1916

Closed IdrisCodes closed 1 month ago

IdrisCodes commented 2 months ago

Hello,

I am trying to add the SDK to my project via CMake's FetchContent.

Because the SDK's CMakeLists.txt file is not the top CMake file anymore, an error occurs in platform/posix/transport/CMakeLists.txt.

Specifically, this line, set(COREPKCS11_LOCATION "${CMAKE_SOURCE_DIR}/libraries/standard/corePKCS11")

As a workaround, I simply changed it to set(COREPKCS11_LOCATION "${CMAKE_CURRENT_SOURCE_DIR}/../../../libraries/standard/corePKCS11")

I believe this fix should be applied so that the SDK could be integrated in a more flexible way to other projects.

Thank you.

aggarg commented 2 months ago

That seems reasonable to me. Would you like to raise a PR for this?