fix: Respect CMAKE_INSTALL_LIBDIR for module installation and lookup#48
fix: Respect CMAKE_INSTALL_LIBDIR for module installation and lookup#48hillwoodroc wants to merge 1 commit intolinuxdeepin:masterfrom
Conversation
|
Hi @hillwoodroc. Thanks for your PR. 😃 |
Synchronize source files from linuxdeepin/dde-session-shell. Source-pull-request: linuxdeepin/dde-session-shell#48
|
Hi @hillwoodroc. Thanks for your PR. I'm waiting for a linuxdeepin member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
| set(CMAKE_INSTALL_PREFIX /usr) | ||
| endif () | ||
|
|
||
| add_definitions(-DCMAKE_INSTALL_FULL_LIBDIR=\"${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}\") |
There was a problem hiding this comment.
只要include 了 GNUInstallDirs 模块,CMAKE_INSTALL_FULL_LIBDIR 是可以自动生成的。不要手动拼
https://cmake.org/cmake/help/latest/module/GNUInstallDirs.html
你可以用 “-DCMAKE_INSTALL_FULL_LIBDIR="${CMAKE_INSTALL_FULL_LIBDIR}"”
There was a problem hiding this comment.
这是为了和后面的 install 语句的 ${CMAKE_INSTALL_LIBDIR} 路径相匹配。install 语句用的相对路径。-DCMAKE_INSTALL_FULL_LIBDIR 无法直接传过去。
There was a problem hiding this comment.
install 逻辑本身就会自动拼接绝对路径,逻辑是 GNUInstallDirs_get_absolute_install_dir,只要在 include(GNUInstallDirs) 之前设置好 CMAKE_INSTALL_LIBDIR,CMAKE_INSTALL_FULL_LIBDIR 一定是正确的
There was a problem hiding this comment.
试过,在存在 CMAKE_INSTALL_LIBDIR 的情况下,并不会自动生成 CMAKE_INSTALL_FULL_LIBDIR,还得保留这一行。
Synchronize source files from linuxdeepin/dde-session-shell. Source-pull-request: linuxdeepin/dde-session-shell#48
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: hillwoodroc The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
1 similar comment
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: hillwoodroc The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Synchronize source files from linuxdeepin/dde-session-shell. Source-pull-request: linuxdeepin/dde-session-shell#48
CMakeLists.txt
Outdated
| cmake_minimum_required(VERSION 3.16) | ||
| project(dde-session-shell C CXX) | ||
|
|
||
| if(NOT DEFINED CMAKE_INSTALL_LIBDIR) |
There was a problem hiding this comment.
不需要, include(GNUInstallDirs) 里一定会定义
There was a problem hiding this comment.
GNUInstallDirs 定义的路径在 debian 是带架构字符路径,不是你们希望的 lib 。当然不定义这个我是没意见,反正可以自己传参数。
There was a problem hiding this comment.
GNUInstallDirs 定义的路径在 debian 是带架构字符路径,不是你们希望的 lib 。当然不定义这个我是没意见,反正可以自己传参数。
Synchronize source files from linuxdeepin/dde-session-shell. Source-pull-request: linuxdeepin/dde-session-shell#48
Synchronize source files from linuxdeepin/dde-session-shell. Source-pull-request: linuxdeepin/dde-session-shell#48
This ensures correct installation and runtime lookup on both lib and
lib64 based systems.
Log:
- Define CMAKE_INSTALL_FULL_LIBDIR in top-level CMakeLists.txt
- Replace hardcoded 'lib/dde-session-shell/modules' with
'${CMAKE_INSTALL_LIBDIR}/dde-session-shell/modules' in all plugin
CMakeLists
- Update modules_loader.cpp to use CMAKE_INSTALL_FULL_LIBDIR for
locating modules and configs
Synchronize source files from linuxdeepin/dde-session-shell. Source-pull-request: linuxdeepin/dde-session-shell#48
This ensures correct installation and runtime lookup on both lib and lib64 based systems.
Log: