Azure / azure-c-shared-utility

Azure C SDKs common code
Other
111 stars 203 forks source link

INCLUDES DESTINATION issue #621

Open Kevin0626 opened 1 year ago

Kevin0626 commented 1 year ago

The exported INCLUDE path is ${CMAKE_INSTALL_INCLUDEDIR}/azureiot, however the FILE INSTALL path is ${CMAKE_INSTALL_INCLUDEDIR}/azure_c_shared_utility. It is cause the project relying on it has cmake problem:

CMake Error in core/CMakeLists.txt:
  Imported target "aziotsharedutil" includes non-existent path

    "/home/Kevin/sdk/external/iot-edge-v1/v1/install-deps/include/azureiot"

  in its INTERFACE_INCLUDE_DIRECTORIES.  Possible reasons include:

  * The path was deleted, renamed, or moved to another location.

  * An install or uninstall procedure did not complete successfully.

  * The installation package was faulty and references files it does not
  provide.

The code:

install (TARGETS ${targets} EXPORT aziotsharedutilTargets
    LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
    ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
    RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
    INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/azureiot
)
install (FILES ${source_h_files} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/azure_c_shared_utility)
install (FILES ${micromock_h_files_full_path} ${INSTALL_H_FILES} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/azureiot)

In old version, it was: install (FILES ${source_h_files} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/azureiot/azure_c_shared_utility)