cleanup cmake and use kde install dirs

This commit is contained in:
Patrick von Reth 2015-02-02 11:39:21 +01:00
parent 1292423c73
commit 4bc9c4cecb
5 changed files with 9 additions and 23 deletions

View File

@ -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)

View File

@ -61,14 +61,11 @@ $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>
$<INSTALL_INTERFACE:include>
$<INSTALL_INTERFACE:include/snore/core>)
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})

View File

@ -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);

View File

@ -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})

View File

@ -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)