Support different header/lib install locations #1315
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Previously the SDK assumed that its headers would be installed into
<prefix>/include
and its libraries into<prefix>/<libdir>
, wherelibdir
is a single directory name. This change allows installing headers into<prefix>/<includedir>
, and letslibdir
andincludedir
both be complete paths instead of just directory names. In particular,<prefix>
can be/
andincludedir
andlibdir
can both be absolute paths.includedir
andlibdir
are given by the usualCMAKE_INSTALL_INCLUDEDIR
andCMAKE_INSTALL_LIBDIR
.This change is necessary to allow usage of the SDK with CMake on platforms where
CMAKE_INSTALL_INCLUDEDIR
andCMAKE_INSTALL_LIBDIR
are absolute paths, or even just contain more than one directory component. In particular it supports whenprefix
is just/
, such as with the Nix package manager (whereCMAKE_INSTALL_INCLUDEDIR
is/nix/store/<some-hash>-aws-sdk-cpp/include
andCMAKE_INSTALL_LIBDIR
is/nix/store/<some-other-hash>-aws-sdk-cpp-dev/lib
, for example). It should also fix #1188.Sorry about the large number of touched files, every SDK component has the same boilerplate that needed fixing.
Note: This does not address any installation issues regarding automatically built dependencies (aws-c-common etc), the expectation is that if a user needs custom lib and include dirs like this then they will build the dependencies themselves.
Check all that applies:
Check which platforms you have built SDK on to verify the correctness of this PR.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.