Azure/azure-c-shared-utility

Headers installed under non-standard directory, causes build breaks

thalesx opened this issue · 4 comments

Per the cmake like below, the SDK's C headers get installed under /usr/include/azureiot/azure_c_shared_utility.

install (FILES ${source_h_files} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/azureiot/azure_c_shared_utility)

However, many of the SDK's headers include other SDK headers using (1) #include "azure_c_shared_utility/other_header.h" instead of (2) #include "azureiot/azure_c_shared_utility/other_header.h".

The issue is that, for a project consuming the C SDK in the form of a lib installed in the sysroot, only the /usr/include is in the include search path by default; the directory /usr/include/azureiot is not. Therefore, the header includes of the form (1) fail.

By patching the c-utility CMakeList.txt to install the headers in ${CMAKE_INSTALL_INCLUDEDIR}/azure_c_shared_utility, I got it to work for my project. Alternatively the includes of form (1) could be changed to (2).

Hi @thalesx thanks for the feedback. Would this solve it?
#531

FWIW this is what I see on the install step after the change:

image

Yes! That solves it.

Reverting fix due to vcpkg build break, reopening issue.