From 4bc9c4cecb4bbb05c9aa243479b734d20137ae72 Mon Sep 17 00:00:00 2001 From: Patrick von Reth Date: Mon, 2 Feb 2015 11:39:21 +0100 Subject: [PATCH] cleanup cmake and use kde install dirs --- CMakeLists.txt | 8 ++------ src/core/CMakeLists.txt | 11 ++++------- src/core/plugins/plugincontainer.cpp | 6 ++---- src/daemon/CMakeLists.txt | 4 +--- src/plugins/CMakeLists.txt | 3 --- 5 files changed, 9 insertions(+), 23 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4905399..963083d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -54,17 +54,13 @@ endif(DOXYGEN_FOUND) -set(LIBSNORE_PLUGIN_PATH ${CMAKE_INSTALL_LIBDIR}/libsnore${SNORE_SUFFIX}) -set(LIBSNORE_FULL_PLUGIN_PATH ${CMAKE_INSTALL_FULL_LIBDIR}/libsnore${SNORE_SUFFIX}) +set(LIBSNORE_PLUGIN_PATH ${KDE_INSTALL_PLUGINDIR}/libsnore${SNORE_SUFFIX}) +set(LIBSNORE_FULL_PLUGIN_PATH ${KDE_INSTALL_FULL_PLUGINDIR}/libsnore${SNORE_SUFFIX}) set(SNORE_PLUGIN_INSTALL_PATH LIBRARY DESTINATION ${LIBSNORE_PLUGIN_PATH}) add_definitions(-DLIBSNORE_PLUGIN_PATH="${LIBSNORE_FULL_PLUGIN_PATH}" -DSNORE_SUFFIX="${SNORE_SUFFIX}") message(STATUS "Installing plugins to ${LIBSNORE_PLUGIN_PATH}") -set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) -set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) - - add_subdirectory(data) add_subdirectory(share) diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 6e28e43..9a4e1f3 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -61,14 +61,11 @@ $ $ $) -install(TARGETS libsnore EXPORT LibsnoreTarget - RUNTIME DESTINATION bin - LIBRARY DESTINATION lib - ARCHIVE DESTINATION lib) +install(TARGETS libsnore EXPORT LibsnoreTarget ${KDE_INSTALL_TARGETS_DEFAULT_ARGS}) -install(EXPORT LibsnoreTarget DESTINATION lib/cmake/libsnore${SNORE_CamelCase_SUFFIX} NAMESPACE Snore::) +install(EXPORT LibsnoreTarget DESTINATION ${KDE_INSTALL_CMAKEPACKAGEDIR}/libsnore${SNORE_CamelCase_SUFFIX} NAMESPACE Snore::) -install(FILES ${SnoreNotify_HDR} DESTINATION include/snore/core) +install(FILES ${SnoreNotify_HDR} DESTINATION ${KDE_INSTALL_INCLUDEDIR}/snore/core) -install(FILES ${CMAKE_CURRENT_BINARY_DIR}/Libsnore${SNORE_CamelCase_SUFFIX}Config.cmake DESTINATION lib/cmake/libsnore${SNORE_CamelCase_SUFFIX}) +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/Libsnore${SNORE_CamelCase_SUFFIX}Config.cmake DESTINATION ${KDE_INSTALL_CMAKEPACKAGEDIR}/libsnore${SNORE_CamelCase_SUFFIX}) diff --git a/src/core/plugins/plugincontainer.cpp b/src/core/plugins/plugincontainer.cpp index a3fc59b..0bf7290 100644 --- a/src/core/plugins/plugincontainer.cpp +++ b/src/core/plugins/plugincontainer.cpp @@ -175,10 +175,8 @@ const QDir &PluginContainer::pluginDir() } #endif list << appDir - << QString("%1/libsnore" SNORE_SUFFIX).arg(appDir) - << QString("%1/../lib/libsnore" SNORE_SUFFIX).arg(appDir) - << QString("%1/../lib64/libsnore" SNORE_SUFFIX).arg(appDir) - << QLatin1String(LIBSNORE_PLUGIN_PATH); + << QLatin1String(LIBSNORE_PLUGIN_PATH) + << QString("%1/libsnore" SNORE_SUFFIX).arg(appDir); foreach(const QString & p, list) { path = QDir(p); diff --git a/src/daemon/CMakeLists.txt b/src/daemon/CMakeLists.txt index 212d1a9..bdc0b83 100644 --- a/src/daemon/CMakeLists.txt +++ b/src/daemon/CMakeLists.txt @@ -5,9 +5,7 @@ if(WITH_SNORE_DAEMON) add_executable( snorenotify WIN32 main.cpp snorenotify.cpp trayicon.cpp ${SNORENOTIFY_DEAMON_DEPS}) target_link_libraries( snorenotify libsnore Qt5::Gui Qt5::Widgets ) - install(TARGETS snorenotify RUNTIME DESTINATION bin - LIBRARY DESTINATION lib - ARCHIVE DESTINATION lib) + install(TARGETS snorenotify ${KDE_INSTALL_TARGETS_DEFAULT_ARGS}) if(UNIX) ecm_install_icons(ICONS ${PROJECT_SOURCE_DIR}/data/128-apps-snore.png DESTINATION ${KDE_INSTALL_ICONDIR}) diff --git a/src/plugins/CMakeLists.txt b/src/plugins/CMakeLists.txt index 7ea31e5..9c00798 100644 --- a/src/plugins/CMakeLists.txt +++ b/src/plugins/CMakeLists.txt @@ -1,6 +1,3 @@ -set(CMAKE_SHARED_MODULE_PREFIX) -set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib/libsnore${SNORE_SUFFIX}") - add_subdirectory(backends) add_subdirectory(frontends) add_subdirectory(secondary_backends)