diff --git a/CMakeLists.txt b/CMakeLists.txt index 6494ed7fd..f0fa72cdd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,6 +15,8 @@ set(SECURITY_COMPILE, "-fstack-protector-all -fPIC") set(CMAKE_CXX_FLAGS, "${CMAKE_CXX_FLAGS} ${SECURITY_COMPILE}") set(CMAKE_C_FLAGS, "${CMAKE_C_FLAGS} ${SECURITY_COMPILE}") +add_definitions(-DCMAKE_INSTALL_FULL_LIBDIR=\"${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}\") + # coverage option # cmake -DENABLE_COVERAGE=ON .. OPTION (ENABLE_COVERAGE "Use gcov" OFF) diff --git a/modules/examples/login/CMakeLists.txt b/modules/examples/login/CMakeLists.txt index 36cd7ce5f..c9213601b 100644 --- a/modules/examples/login/CMakeLists.txt +++ b/modules/examples/login/CMakeLists.txt @@ -8,10 +8,12 @@ link_libraries( set(LIB_NAME login) +set(MODULESDIR ${CMAKE_INSTALL_LIBDIR}/dde-session-shell/modules) + aux_source_directory(. SRCS) # add_library(${LIB_NAME} STATIC ${SRCS}) add_library(${LIB_NAME} SHARED ${SRCS}) -install(TARGETS ${LIB_NAME} LIBRARY DESTINATION lib/dde-session-shell/modules) +install(TARGETS ${LIB_NAME} LIBRARY DESTINATION ${MODULESDIR}) diff --git a/modules/examples/network/CMakeLists.txt b/modules/examples/network/CMakeLists.txt index ae913fd4e..32aea5ce5 100644 --- a/modules/examples/network/CMakeLists.txt +++ b/modules/examples/network/CMakeLists.txt @@ -8,10 +8,12 @@ link_libraries( set(LIB_NAME network) +set(MODULESDIR ${CMAKE_INSTALL_LIBDIR}/dde-session-shell/modules) + aux_source_directory(. SRCS) # add_library(${LIB_NAME} STATIC ${SRCS}) add_library(${LIB_NAME} SHARED ${SRCS}) -install(TARGETS ${LIB_NAME} LIBRARY DESTINATION lib/dde-session-shell/modules) +install(TARGETS ${LIB_NAME} LIBRARY DESTINATION ${MODULESDIR}) diff --git a/modules/examples/webview/CMakeLists.txt b/modules/examples/webview/CMakeLists.txt index db1031b46..755ebeb0d 100644 --- a/modules/examples/webview/CMakeLists.txt +++ b/modules/examples/webview/CMakeLists.txt @@ -11,6 +11,8 @@ link_libraries( set(LIB_NAME webview) +set(MODULESDIR ${CMAKE_INSTALL_LIBDIR}/dde-session-shell/modules) + aux_source_directory(. SRCS) # add_library(${LIB_NAME} STATIC ${SRCS}) @@ -22,4 +24,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 ${MODULESDIR}) diff --git a/modules/login/CMakeLists.txt b/modules/login/CMakeLists.txt index 4792fe9f0..4deab606b 100644 --- a/modules/login/CMakeLists.txt +++ b/modules/login/CMakeLists.txt @@ -14,6 +14,8 @@ link_libraries( set(LIB_NAME login) +set(MODULESDIR ${CMAKE_INSTALL_LIBDIR}/dde-session-shell/modules) + aux_source_directory(. SRCS) # add_library(${LIB_NAME} STATIC ${SRCS}) @@ -22,4 +24,4 @@ add_library(${LIB_NAME} SHARED ${SRCS}) set(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/modules) -install(TARGETS ${LIB_NAME} LIBRARY DESTINATION lib/dde-session-shell/modules) +install(TARGETS ${LIB_NAME} LIBRARY DESTINATION ${MODULESDIR}) diff --git a/modules/virtualkeyboard/CMakeLists.txt b/modules/virtualkeyboard/CMakeLists.txt index a167ad9f4..27e1bdf36 100644 --- a/modules/virtualkeyboard/CMakeLists.txt +++ b/modules/virtualkeyboard/CMakeLists.txt @@ -8,10 +8,12 @@ link_libraries( set(LIB_NAME virtualkeyboard) +set(MODULESDIR ${CMAKE_INSTALL_LIBDIR}/dde-session-shell/modules) + aux_source_directory(. SRCS) add_library(${LIB_NAME} SHARED ${SRCS}) set(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/modules) -install(TARGETS ${LIB_NAME} LIBRARY DESTINATION lib/dde-session-shell/modules) +install(TARGETS ${LIB_NAME} LIBRARY DESTINATION ${MODULESDIR}) diff --git a/src/global_util/modules_loader.cpp b/src/global_util/modules_loader.cpp index 09b9f67ed..f56124161 100644 --- a/src/global_util/modules_loader.cpp +++ b/src/global_util/modules_loader.cpp @@ -15,7 +15,7 @@ namespace dss { namespace module { -const QString ModulesDir = "/usr/lib/dde-session-shell/modules"; +const QString ModulesDir = QString("%1/dde-session-shell/modules"),arg(CMAKE_INSTALL_FULL_LIBDIR); ModulesLoader::ModulesLoader(QObject *parent) : QThread(parent) {