Skip to content

Avoid path doubling issue in CMake files#3623

Closed
hmenke wants to merge 1 commit into
warmcat:mainfrom
hmenke:paths
Closed

Avoid path doubling issue in CMake files#3623
hmenke wants to merge 1 commit into
warmcat:mainfrom
hmenke:paths

Conversation

@hmenke

@hmenke hmenke commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

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.

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.
@sonarqubecloud

sonarqubecloud Bot commented Jul 2, 2026

Copy link
Copy Markdown

@lws-team

lws-team commented Jul 2, 2026

Copy link
Copy Markdown
Member

How do you feel about this instead?

e00e810

It looks like your patch as it is will have problems with user overrides LWS_INSTALL_LIB_DIR and pkg-config.

@hmenke

hmenke commented Jul 2, 2026

Copy link
Copy Markdown
Contributor Author

@lws-team LGTM 👍

@hmenke hmenke closed this Jul 2, 2026
@hmenke hmenke deleted the paths branch July 2, 2026 11:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants