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
.
azure-c-shared-utility/CMakeLists.txt
Line 692 in 341c40b
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).
Yes! That solves it.
Reverting fix due to vcpkg build break, reopening issue.