diff --git a/CMakeLists.txt b/CMakeLists.txt index 903028dc..ec64831d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,6 +6,8 @@ if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) set(CMAKE_INSTALL_PREFIX /usr) endif () +add_definitions(-DCMAKE_INSTALL_FULL_LIBDIR=\"${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}\") + set(CMAKE_CXX_STANDARD 17) set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_AUTOMOC ON) diff --git a/plugins/assist_login/CMakeLists.txt b/plugins/assist_login/CMakeLists.txt index 6cfeea0d..a177d20e 100644 --- a/plugins/assist_login/CMakeLists.txt +++ b/plugins/assist_login/CMakeLists.txt @@ -20,4 +20,4 @@ aux_source_directory(. SRCS) add_library(${LIB_NAME} SHARED ${SRCS}) add_subdirectory(interface) -install(TARGETS ${LIB_NAME} LIBRARY DESTINATION lib/dde-session-shell/modules) \ No newline at end of file +install(TARGETS ${LIB_NAME} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/dde-session-shell/modules) diff --git a/plugins/assist_login/interface/CMakeLists.txt b/plugins/assist_login/interface/CMakeLists.txt index 4035bd97..c62c9e35 100644 --- a/plugins/assist_login/interface/CMakeLists.txt +++ b/plugins/assist_login/interface/CMakeLists.txt @@ -28,4 +28,4 @@ link_libraries( # 安装/user/lib install(FILES include/assist_login_interface.h DESTINATION /usr/include/dde-session-shell) -install(TARGETS ${LIB_NAME} LIBRARY DESTINATION lib/dde-session-shell/modules) +install(TARGETS ${LIB_NAME} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/dde-session-shell/modules) diff --git a/plugins/examples/login-plugins/login-basic/CMakeLists.txt b/plugins/examples/login-plugins/login-basic/CMakeLists.txt index 65c1e5dc..9a491042 100644 --- a/plugins/examples/login-plugins/login-basic/CMakeLists.txt +++ b/plugins/examples/login-plugins/login-basic/CMakeLists.txt @@ -81,4 +81,4 @@ target_link_libraries(${PLUGIN_NAME} PRIVATE set(CMAKE_INSTALL_PREFIX "/usr") # 设置执行 make install 时哪个目标应该被 install 到哪个位置 -install(TARGETS ${PLUGIN_NAME} LIBRARY DESTINATION lib/dde-session-shell/modules) +install(TARGETS ${PLUGIN_NAME} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/dde-session-shell/modules) diff --git a/plugins/examples/login-plugins/login-complex/CMakeLists.txt b/plugins/examples/login-plugins/login-complex/CMakeLists.txt index 5edcf612..ba2814d8 100644 --- a/plugins/examples/login-plugins/login-complex/CMakeLists.txt +++ b/plugins/examples/login-plugins/login-complex/CMakeLists.txt @@ -12,4 +12,4 @@ aux_source_directory(. SRCS) add_library(${LIB_NAME} SHARED ${SRCS}) -install(TARGETS ${LIB_NAME} LIBRARY DESTINATION lib/dde-session-shell/modules) +install(TARGETS ${LIB_NAME} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/dde-session-shell/modules) diff --git a/plugins/examples/login-plugins/login-fullManaged/CMakeLists.txt b/plugins/examples/login-plugins/login-fullManaged/CMakeLists.txt index bba76f7a..6728045b 100644 --- a/plugins/examples/login-plugins/login-fullManaged/CMakeLists.txt +++ b/plugins/examples/login-plugins/login-fullManaged/CMakeLists.txt @@ -12,4 +12,4 @@ aux_source_directory(. SRCS) add_library(${LIB_NAME} SHARED ${SRCS}) -install(TARGETS ${LIB_NAME} LIBRARY DESTINATION lib/dde-session-shell/modules) +install(TARGETS ${LIB_NAME} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/dde-session-shell/modules) diff --git a/plugins/examples/login-plugins/login-udcp/CMakeLists.txt b/plugins/examples/login-plugins/login-udcp/CMakeLists.txt index bdbc6f3f..cc8a78f8 100644 --- a/plugins/examples/login-plugins/login-udcp/CMakeLists.txt +++ b/plugins/examples/login-plugins/login-udcp/CMakeLists.txt @@ -12,4 +12,4 @@ aux_source_directory(. SRCS) add_library(${LIB_NAME} SHARED ${SRCS} login-plugin.qrc) -install(TARGETS ${LIB_NAME} LIBRARY DESTINATION lib/dde-session-shell/modules) +install(TARGETS ${LIB_NAME} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/dde-session-shell/modules) diff --git a/plugins/examples/tray-plugins/network/CMakeLists.txt b/plugins/examples/tray-plugins/network/CMakeLists.txt index b2cf5755..f401b97a 100644 --- a/plugins/examples/tray-plugins/network/CMakeLists.txt +++ b/plugins/examples/tray-plugins/network/CMakeLists.txt @@ -12,4 +12,4 @@ aux_source_directory(. SRCS) add_library(${LIB_NAME} SHARED ${SRCS}) -install(TARGETS ${LIB_NAME} LIBRARY DESTINATION lib/dde-session-shell/modules) +install(TARGETS ${LIB_NAME} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/dde-session-shell/modules) diff --git a/plugins/examples/tray-plugins/webview/CMakeLists.txt b/plugins/examples/tray-plugins/webview/CMakeLists.txt index d74ad2d5..c45855bb 100644 --- a/plugins/examples/tray-plugins/webview/CMakeLists.txt +++ b/plugins/examples/tray-plugins/webview/CMakeLists.txt @@ -23,4 +23,4 @@ target_link_libraries(${LIB_NAME} PRIVATE Qt${QT_VERSION_MAJOR}::WebEngineWidgets ) -install(TARGETS ${LIB_NAME} LIBRARY DESTINATION lib/dde-session-shell/modules) +install(TARGETS ${LIB_NAME} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/dde-session-shell/modules) diff --git a/plugins/one-key-login/CMakeLists.txt b/plugins/one-key-login/CMakeLists.txt index 0c64477e..5eafdc97 100644 --- a/plugins/one-key-login/CMakeLists.txt +++ b/plugins/one-key-login/CMakeLists.txt @@ -12,4 +12,4 @@ aux_source_directory(. SRCS) add_library(${LIB_NAME} SHARED ${SRCS}) -install(TARGETS ${LIB_NAME} LIBRARY DESTINATION lib/dde-session-shell/modules) +install(TARGETS ${LIB_NAME} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/dde-session-shell/modules) diff --git a/src/global_util/plugin_manager/modules_loader.cpp b/src/global_util/plugin_manager/modules_loader.cpp index bb97f0a2..1e8b2358 100644 --- a/src/global_util/plugin_manager/modules_loader.cpp +++ b/src/global_util/plugin_manager/modules_loader.cpp @@ -16,8 +16,8 @@ #include -const QString ModulesDir = "/usr/lib/dde-session-shell/modules"; -const QString ModulesConfigDir = "/usr/lib/dde-session-shell/modules/config.d/"; +const QString ModulesDir = QString("%1/dde-session-shell/modules").arg(CMAKE_INSTALL_FULL_LIBDIR); +const QString ModulesConfigDir = QString("%1/dde-session-shell/modules/config.d/").arg(CMAKE_INSTALL_FULL_LIBDIR); const QString LOWEST_VERSION = "1.1.0"; const QString LoginType = "Login"; const QString TrayType = "Tray";