Commit 86aab979 authored by Luca Giambonini's avatar Luca Giambonini

Create a Config.cmake and a ConfigVersion.cmake

parent 26ae9115
@PACKAGE_INIT@
# Required components to use this framework
include(CMakeFindDependencyMacro)
find_dependency(Qt5Core "@REQUIRED_QT_VERSION@")
find_dependency(Qt5Test "@REQUIRED_QT_VERSION@")
find_dependency(Qt5Concurrent "@REQUIRED_QT_VERSION@")
find_dependency(Qt5DBus "@REQUIRED_QT_VERSION@")
find_dependency(Qt5Widgets "@REQUIRED_QT_VERSION@")
include("${CMAKE_CURRENT_LIST_DIR}/AkabeiCoreConfig.cmake")
@PACKAGE_INCLUDE_QCHTARGETS@
......@@ -47,7 +47,9 @@ add_definitions(#-DQT_NO_CAST_TO_ASCII
-DQT_USE_QSTRINGBUILDER
)
find_package(Qt5 5.2.0 REQUIRED CONFIG COMPONENTS Core Test Network Concurrent DBus Widgets)
include(CMakePackageConfigHelpers) # Used to create CMake config files
find_package(Qt5 5.2.0 REQUIRED CONFIG COMPONENTS Core Test Concurrent DBus Widgets)
find_package(LibArchive REQUIRED)
find_package(Sqlite REQUIRED)
find_package(PolkitQt5-1 REQUIRED)
......@@ -59,12 +61,27 @@ set(LIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/lib" CACHE "Akabei library installa
set(INCLUDES_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/include/akabeicore" CACHE "Akabei includes installation directory" STRING)
set(STATE_DIR "/var" CACHE "Directory to store cache data and log files, usually under ${STATE_DIR}/{cache,log,etc...})" STRING)
set(CONFIGURATION_DIR "/etc" CACHE "Directory to store Akabei’s configuration files" STRING)
CONFIGURE_FILE(
"${CMAKE_CURRENT_SOURCE_DIR}/akabeicoreconfig.h.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/akabeicoreconfig.h"
IMMEDIATE @ONLY)
# Create a Config.cmake and a ConfigVersion.cmake file and install them
set(CMAKECONFIG_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}/cmake/akabeicore")
# Create the CMake Config files
configure_package_config_file(
"${CMAKE_CURRENT_SOURCE_DIR}/AkabeiCoreConfig.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/AkabeiCoreConfig.cmake"
INSTALL_DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
)
write_basic_package_version_file(
"${CMAKE_CURRENT_BINARY_DIR}/AkabeiCoreConfigVersion.cmake"
VERSION ${AKABEI_VERSION_STRING}
COMPATIBILITY AnyNewerVersion
)
install(FILES
"${CMAKE_CURRENT_BINARY_DIR}/AkabeiCoreConfig.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/AkabeiCoreConfigVersion.cmake"
DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
COMPONENT Devel)
include_directories("${CMAKE_CURRENT_BINARY_DIR}")
......
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