Skip to content

Support different header/lib install locations #1315

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from

Conversation

EmilyMansfield
Copy link

Previously the SDK assumed that its headers would be installed into <prefix>/include and its libraries into <prefix>/<libdir>, where libdir is a single directory name. This change allows installing headers into <prefix>/<includedir>, and lets libdir and includedir both be complete paths instead of just directory names. In particular, <prefix> can be / and includedir and libdir can both be absolute paths. includedir and libdir are given by the usual CMAKE_INSTALL_INCLUDEDIR and CMAKE_INSTALL_LIBDIR.

This change is necessary to allow usage of the SDK with CMake on platforms where CMAKE_INSTALL_INCLUDEDIR and CMAKE_INSTALL_LIBDIR are absolute paths, or even just contain more than one directory component. In particular it supports when prefix is just /, such as with the Nix package manager (where CMAKE_INSTALL_INCLUDEDIR is /nix/store/<some-hash>-aws-sdk-cpp/include and CMAKE_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:

  • Did a review by yourself.
  • Added proper tests to cover this PR. Have tested manually, not sure how to add tests for CMake.
  • Checked if this PR is a breaking (APIs have been changed) change.
  • Checked if this PR will not introduce cross-platform inconsistent behavior.
  • Checked if this PR would require a ReadMe/Wiki update.

Check which platforms you have built SDK on to verify the correctness of this PR.

  • Linux
  • Windows
  • Android
  • MacOS
  • IOS
  • Other Platforms

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Without this, consumers will look for includes in the wrong directory if they
set CMAKE_INSTALL_INCLUDEDIR to something other than "include" when installing.
The derivation of AWSSDK_ROOT_DIR from the include directory assumed that
CMAKE_INSTALL_INCLUDEDIR is the default "include", and similarly for
CMAKE_INSTALL_LIBDIR. Paths with more than one component are now supported,
including absolute paths, though CMAKE_INSTALL_INCLUDEDIR and
CMAKE_INSTALL_LIBDIR are still required to have a common root directory.
@github-actions
Copy link

github-actions bot commented Feb 3, 2021

Greetings! Sorry to say but this is a very old issue that is probably not getting as much attention as it deservers. We encourage you to check if this is still an issue in the latest release and if you find that this is still a problem, please feel free to open a new one.

@github-actions github-actions bot added closing-soon This issue will automatically close in 4 days unless further comments are made. closed-for-staleness and removed closing-soon This issue will automatically close in 4 days unless further comments are made. labels Feb 3, 2021
@github-actions github-actions bot closed this Feb 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

cmake: cmake can't find libraries on linux
1 participant