Avoid path doubling issue in CMake files#3623
Closed
hmenke wants to merge 1 commit into
Closed
Conversation
There is no guarantee that `CMAKE_INSTALL_LIBDIR` (and for that matter `LWS_INSTALL_LIBDIR`) are relative paths, so that it would be safe to concatenate it with `CMAKE_INSTALL_PREFIX`. If `CMAKE_INSTALL_LIBDIR` is set to an absolute path, e.g. `/usr/lib` and `CMAKE_INSTALL_PREFIX` is set to `/usr` this leads to path doubling in various places where there now appears `/usr/usr/lib`. Here we use the “full” variants of those variables instead which branch correctly on both absolute and relative paths.
|
14 tasks
Member
|
How do you feel about this instead? It looks like your patch as it is will have problems with user overrides LWS_INSTALL_LIB_DIR and pkg-config. |
Contributor
Author
|
@lws-team LGTM 👍 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.



There is no guarantee that
CMAKE_INSTALL_LIBDIR(and for that matterLWS_INSTALL_LIBDIR) are relative paths, so that it would be safe to concatenate it withCMAKE_INSTALL_PREFIX. IfCMAKE_INSTALL_LIBDIRis set to an absolute path, e.g./usr/libandCMAKE_INSTALL_PREFIXis set to/usrthis leads to path doubling in various places where there now appears/usr/usr/lib.Here we use the “full” variants of those variables instead which branch correctly on both absolute and relative paths.