summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Małek <michalm@jabster.pl>2014-08-07 20:13:46 (GMT)
committerMichał Małek <michalm@jabster.pl>2014-08-07 20:13:46 (GMT)
commitaf905c92f3333442b2d67eb11e02c8bde8eb4858 (patch)
treea584f5b028eb4090bbb55f8049277cde784f3a8b
parentf31cfdd44820561a7f73235d0a29912696c34aca (diff)
Set correct library version based on the current version of KF5
-rw-r--r--CMakeLists.txt14
-rw-r--r--libkcddb/CMakeLists.txt2
2 files changed, 13 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d923113..9fa06d4 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -10,11 +10,14 @@ include(KDECompilerSettings)
include(KDECMakeSettings)
include(FeatureSummary)
include(GenerateExportHeader)
+include(ECMSetupVersion)
find_package(Qt5 REQUIRED COMPONENTS Network Widgets Test)
find_package(KF5 REQUIRED COMPONENTS Config DocTools Codecs I18n KIO WidgetsAddons)
-include_directories(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
+ecm_setup_version(${KF5_VERSION}
+ VARIABLE_PREFIX KCDDB
+ PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/LibkcddbConfigVersion.cmake")
find_package(MusicBrainz5)
set_package_properties(MusicBrainz5 PROPERTIES
@@ -31,15 +34,22 @@ endif()
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config-musicbrainz.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-musicbrainz.h )
+include_directories(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
+
add_subdirectory( test )
add_subdirectory( kcmcddb )
add_subdirectory( libkcddb )
+feature_summary(WHAT PACKAGES_NOT_FOUND FATAL_ON_MISSING_REQUIRED_PACKAGES)
+
# Figure out the relative path from the installed Config.cmake file to the install prefix (which may be at
# runtime different from the chosen CMAKE_INSTALL_PREFIX if under Windows the package was installed anywhere)
# This relative path will be configured into LibkcddbConfig.cmake
file(RELATIVE_PATH relInstallDir ${CMAKE_INSTALL_PREFIX}/${LIB_INSTALL_DIR}/cmake/libkcddb ${CMAKE_INSTALL_PREFIX})
configure_file(LibkcddbConfig.cmake.in ${CMAKE_BINARY_DIR}/LibkcddbConfig.cmake @ONLY)
-install(FILES ${CMAKE_BINARY_DIR}/LibkcddbConfig.cmake DESTINATION ${LIB_INSTALL_DIR}/cmake/libkcddb)
+install(FILES
+ ${CMAKE_BINARY_DIR}/LibkcddbConfig.cmake
+ ${CMAKE_BINARY_DIR}/LibkcddbConfigVersion.cmake
+ DESTINATION ${LIB_INSTALL_DIR}/cmake/libkcddb)
install(EXPORT LibkcddbTargets DESTINATION ${LIB_INSTALL_DIR}/cmake/libkcddb/ FILE LibkcddbTargets.cmake NAMESPACE KDE::Libkcddb::)
diff --git a/libkcddb/CMakeLists.txt b/libkcddb/CMakeLists.txt
index 164cdb1..79406f6 100644
--- a/libkcddb/CMakeLists.txt
+++ b/libkcddb/CMakeLists.txt
@@ -66,7 +66,7 @@ endif()
generate_export_header(kcddb)
-set_target_properties(kcddb PROPERTIES VERSION ${GENERIC_LIB_VERSION} SOVERSION ${GENERIC_LIB_SOVERSION})
+set_target_properties(kcddb PROPERTIES VERSION ${KCDDB_VERSION} SOVERSION ${KCDDB_SOVERSION})
install(TARGETS kcddb EXPORT LibkcddbTargets ${INSTALL_TARGETS_DEFAULT_ARGS})