Commit 70f7bb98 authored by Volker Krause's avatar Volker Krause
Browse files

Install CMake config files

Makes this usable externally.
parent 16d72eac
......@@ -15,7 +15,10 @@ include(KDECMakeSettings)
include(GenerateExportHeader)
set(CMAKE_AUTOMOC ON)
ecm_setup_version(PROJECT VARIABLE_PREFIX ITINERARY VERSION_HEADER itinerary_version.h)
ecm_setup_version(PROJECT VARIABLE_PREFIX ITINERARY
VERSION_HEADER itinerary_version.h
PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KPkPassConfigVersion.cmake"
)
find_package(Qt5 REQUIRED COMPONENTS Test Gui)
find_package(KF5 REQUIRED COMPONENTS Archive)
......@@ -25,3 +28,23 @@ add_subdirectory(src)
add_subdirectory(autotests)
feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)
set(CMAKECONFIG_INSTALL_DIR "${CMAKECONFIG_INSTALL_PREFIX}/KPkPass")
configure_package_config_file(
"${CMAKE_CURRENT_SOURCE_DIR}/KPkPassConfig.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/KPkPassConfig.cmake"
INSTALL_DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
)
install(FILES
"${CMAKE_CURRENT_BINARY_DIR}/KPkPassConfig.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/KPkPassConfigVersion.cmake"
DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
COMPONENT Devel)
install(EXPORT KPkPassTargets
DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
FILE KPkPassTargets.cmake
)
@PACKAGE_INIT@
find_package(Qt5 @Qt5Core_VERSION_MAJOR@.@Qt5Core_VERSION_MINOR@ NO_MODULE REQUIRED COMPONENTS Core Gui)
include("${CMAKE_CURRENT_LIST_DIR}/KPkPassTargets.cmake")
@PACKAGE_INCLUDE_QCHTARGETS@
......@@ -20,6 +20,7 @@ set_target_properties(KPkPass PROPERTIES
SOVERSION ${ITINERARY_SOVERSION}
EXPORT_NAME KPkPass
)
target_include_directories(KPkPass INTERFACE "$<INSTALL_INTERFACE:${KDE_INSTALL_INCLUDEDIR_KF5}>")
target_link_libraries(KPkPass
PUBLIC
Qt5::Gui
......@@ -34,7 +35,6 @@ ecm_generate_headers(KPkPass_HEADERS
Field
Location
Pass
PREFIX KPkPass
REQUIRED_HEADERS KPkPass_HEADERS
)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment