Add CMake config file
This commit is contained in:
parent
42db0f2d4d
commit
80b668a074
|
@ -1,6 +1,13 @@
|
||||||
cmake_minimum_required(VERSION 2.8)
|
cmake_minimum_required(VERSION 2.8)
|
||||||
project(qtkeychain)
|
project(qtkeychain)
|
||||||
|
|
||||||
|
###
|
||||||
|
|
||||||
|
set(QTKEYCHAIN_VERSION 0)
|
||||||
|
set(QTKEYCHAIN_SOVERSION 0)
|
||||||
|
|
||||||
|
###
|
||||||
|
|
||||||
set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH}" "${PROJECT_SOURCE_DIR}/cmake/Modules")
|
set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH}" "${PROJECT_SOURCE_DIR}/cmake/Modules")
|
||||||
include(GNUInstallDirs)
|
include(GNUInstallDirs)
|
||||||
|
|
||||||
|
@ -56,15 +63,16 @@ else()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set_target_properties(qtkeychain PROPERTIES
|
set_target_properties(qtkeychain PROPERTIES
|
||||||
VERSION 0
|
VERSION ${QTKEYCHAIN_VERSION}
|
||||||
SOVERSION 0
|
SOVERSION ${QTKEYCHAIN_SOVERSION}
|
||||||
)
|
)
|
||||||
|
|
||||||
install(FILES keychain.h
|
install(FILES keychain.h qkeychain_export.h
|
||||||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/qtkeychain/
|
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/qtkeychain/
|
||||||
)
|
)
|
||||||
|
|
||||||
install(TARGETS qtkeychain
|
install(TARGETS qtkeychain
|
||||||
|
EXPORT QtKeychainLibraryDepends
|
||||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||||
|
@ -72,3 +80,27 @@ install(TARGETS qtkeychain
|
||||||
|
|
||||||
add_executable( testclient testclient.cpp )
|
add_executable( testclient testclient.cpp )
|
||||||
target_link_libraries( testclient qtkeychain)
|
target_link_libraries( testclient qtkeychain)
|
||||||
|
|
||||||
|
|
||||||
|
###
|
||||||
|
### CMake config file
|
||||||
|
###
|
||||||
|
|
||||||
|
export(TARGETS qtkeychain FILE "${PROJECT_BINARY_DIR}/QtKeychainLibraryDepends.cmake")
|
||||||
|
export(PACKAGE QtKeychain)
|
||||||
|
|
||||||
|
configure_file(QtKeychainBuildTreeSettings.cmake.in
|
||||||
|
"${PROJECT_BINARY_DIR}/QtKeychainBuildTreeSettings.cmake" @ONLY)
|
||||||
|
configure_file(QtKeychainConfig.cmake.in
|
||||||
|
"${PROJECT_BINARY_DIR}/QtKeychainConfig.cmake" @ONLY)
|
||||||
|
configure_file(QtKeychainConfigVersion.cmake.in
|
||||||
|
"${PROJECT_BINARY_DIR}/QtKeychainConfigVersion.cmake" @ONLY)
|
||||||
|
|
||||||
|
install(EXPORT QtKeychainLibraryDepends
|
||||||
|
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/QtKeychain"
|
||||||
|
)
|
||||||
|
|
||||||
|
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/QtKeychainConfig.cmake
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}/QtKeychainConfigVersion.cmake
|
||||||
|
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/QtKeychain
|
||||||
|
)
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
set(QTKEYCHAIN_INCLUDE_DIRS
|
||||||
|
"@PROJECT_SOURCE_DIR@"
|
||||||
|
"@PROJECT_BINARY_DIR@"
|
||||||
|
)
|
|
@ -0,0 +1,20 @@
|
||||||
|
# - Config file for the FooBar package
|
||||||
|
# It defines the following variables
|
||||||
|
# FOOBAR_INCLUDE_DIRS - include directories for FooBar
|
||||||
|
# FOOBAR_LIBRARIES - libraries to link against
|
||||||
|
# FOOBAR_EXECUTABLE - the bar executable
|
||||||
|
|
||||||
|
# Compute paths
|
||||||
|
get_filename_component(QTKEYCHAIN_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
|
||||||
|
if(EXISTS "${QTKEYCHAIN_CMAKE_DIR}/CMakeCache.txt")
|
||||||
|
# In build tree
|
||||||
|
include("${QTKEYCHAIN_CMAKE_DIR}/QtKeychainBuildTreeSettings.cmake")
|
||||||
|
else()
|
||||||
|
set(QTKEYCHAIN_INCLUDE_DIRS "@CMAKE_INSTALL_FULL_INCLUDEDIR@")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Our library dependencies (contains definitions for IMPORTED targets)
|
||||||
|
include("${QTKEYCHAIN_CMAKE_DIR}/QtKeychainLibraryDepends.cmake")
|
||||||
|
|
||||||
|
# These are IMPORTED targets created by FooBarLibraryDepends.cmake
|
||||||
|
set(QTKEYCHAIN_LIBRARIES qtkeychain)
|
|
@ -0,0 +1,11 @@
|
||||||
|
set(PACKAGE_VERSION "@QTKEYCHAIN_VERSION@")
|
||||||
|
|
||||||
|
# Check whether the requested PACKAGE_FIND_VERSION is compatible
|
||||||
|
if("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}")
|
||||||
|
set(PACKAGE_VERSION_COMPATIBLE FALSE)
|
||||||
|
else()
|
||||||
|
set(PACKAGE_VERSION_COMPATIBLE TRUE)
|
||||||
|
if ("${PACKAGE_VERSION}" VERSION_EQUAL "${PACKAGE_FIND_VERSION}")
|
||||||
|
set(PACKAGE_VERSION_EXACT TRUE)
|
||||||
|
endif()
|
||||||
|
endif()
|
Loading…
Reference in New Issue