install version config for libsnore

This commit is contained in:
Patrick von Reth 2015-03-08 19:39:34 +01:00
parent 6746c248c9
commit 490935302f
5 changed files with 27 additions and 23 deletions

View File

@ -17,7 +17,8 @@ include(KDECMakeSettings)
include(ECMAddAppIcon)
include(ECMInstallIcons)
include(ECMSetupVersion)
include(ECMPackageConfigHelpers)
include(GenerateExportHeader)
@ -30,7 +31,6 @@ option(WITH_SNORE_DAEMON "Build the Snore daemon, which redirects notifications"
set(SNORE_VERSION_MAJOR 0)
set(SNORE_VERSION_MINOR 5)
set(SNORE_VERSION_PATCH 90)
set(SNORE_VERSION_SUFFIX "")
set(SNORE_SUFFIX "-qt5")
set(SNORE_CamelCase_SUFFIX "Qt5")

View File

@ -7,7 +7,6 @@ if(NOT SNORE_REVISION)
endif()
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/version.cpp.in" "${CMAKE_CURRENT_BINARY_DIR}/version.cpp")
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/LibsnoreConfig.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/Libsnore${SNORE_CamelCase_SUFFIX}Config.cmake" @ONLY)
QT5_ADD_RESOURCES(SNORENOTIFY_RCS ${SNORE_RCS})
@ -72,11 +71,25 @@ $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>
$<INSTALL_INTERFACE:include>
$<INSTALL_INTERFACE:include/snore/core>)
install(TARGETS libsnore EXPORT LibsnoreTarget ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
install(EXPORT LibsnoreTarget DESTINATION ${KDE_INSTALL_CMAKEPACKAGEDIR}/libsnore${SNORE_CamelCase_SUFFIX} NAMESPACE Snore::)
ecm_setup_version("${SNORE_VERSION_MAJOR}.${SNORE_VERSION_MINOR}.${SNORE_VERSION_PATCH}" VARIABLE_PREFIX SOLID
PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/Libsnore${SNORE_CamelCase_SUFFIX}ConfigVersion.cmake"
SOVERSION ${SNORE_VERSION_MAJOR})
ecm_configure_package_config_file( "${CMAKE_CURRENT_SOURCE_DIR}/LibsnoreConfig.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/Libsnore${SNORE_CamelCase_SUFFIX}Config.cmake"
INSTALL_DESTINATION ${KDE_INSTALL_CMAKEPACKAGEDIR}/libsnore${SNORE_CamelCase_SUFFIX}
)
install(TARGETS libsnore EXPORT Libsnore${SNORE_CamelCase_SUFFIX}Target ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
install(EXPORT Libsnore${SNORE_CamelCase_SUFFIX}Target DESTINATION ${KDE_INSTALL_CMAKEPACKAGEDIR}/libsnore${SNORE_CamelCase_SUFFIX} NAMESPACE Snore::)
install(FILES ${SnoreNotify_HDR} DESTINATION ${KDE_INSTALL_INCLUDEDIR}/snore/core)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/Libsnore${SNORE_CamelCase_SUFFIX}Config.cmake DESTINATION ${KDE_INSTALL_CMAKEPACKAGEDIR}/libsnore${SNORE_CamelCase_SUFFIX})
install(FILES
${CMAKE_CURRENT_BINARY_DIR}/Libsnore${SNORE_CamelCase_SUFFIX}Config.cmake
${CMAKE_CURRENT_BINARY_DIR}/Libsnore${SNORE_CamelCase_SUFFIX}ConfigVersion.cmake
DESTINATION
${KDE_INSTALL_CMAKEPACKAGEDIR}/libsnore${SNORE_CamelCase_SUFFIX})

View File

@ -1,7 +1,9 @@
find_package(Qt5Network REQUIRED)
find_package(Qt5Widgets REQUIRED)
@PACKAGE_INIT@
include("${CMAKE_CURRENT_LIST_DIR}/LibsnoreTarget.cmake")
find_dependency(Qt5Core REQUIRED)
find_dependency(Qt5Network REQUIRED)
find_dependency(Qt5Widgets REQUIRED)
find_dependency(Qt5Quick REQUIRED)
include("${CMAKE_CURRENT_LIST_DIR}/Libsnore@SNORE_CamelCase_SUFFIX@Target.cmake")
set(LIBSNORE_FOUND TRUE)
set(LIBSNORE_LIBRARIES Snore::Libsnore)

View File

@ -4,7 +4,7 @@ namespace Snore{
const QString Version::version()
{
return QLatin1String("${SNORE_VERSION_MAJOR}.${SNORE_VERSION_MINOR}.${SNORE_VERSION_PATCH}${SNORE_VERSION_SUFFIX}");
return QLatin1String("${SNORE_VERSION_MAJOR}.${SNORE_VERSION_MINOR}.${SNORE_VERSION_PATCH}");
}
const QString Version::major(){
@ -19,11 +19,6 @@ const QString Version::patch(){
return QLatin1String("${SNORE_VERSION_PATCH}");
}
const QString Version::suffix(){
return QLatin1String("${SNORE_VERSION_SUFFIX}");
}
const QString Version::revision(){
return QLatin1String("${SNORE_REVISION}");
}

View File

@ -41,12 +41,6 @@ public:
*/
static const QString patch();
/**
*
* @return the suffix ("pre", "alpha", "beta", "")
*/
static const QString suffix();
/**
*
* @return the git revision, can be empty in a release