Merge pull request #78 from TheOneRing/depend

Use find_dependency to find the dependencies
This commit is contained in:
Frank Osterfeld 2016-08-05 11:22:03 +02:00 committed by GitHub
commit 8f42ff627a
2 changed files with 23 additions and 6 deletions

View File

@ -114,10 +114,10 @@ endif()
if(APPLE) if(APPLE)
list(APPEND qtkeychain_SOURCES keychain_mac.cpp) list(APPEND qtkeychain_SOURCES keychain_mac.cpp)
find_library(COREFOUNDATION_LIBRARY CoreFoundation) find_library(COREFOUNDATION_LIBRARY CoreFoundation REQUIRED)
list(APPEND qtkeychain_LIBRARIES ${COREFOUNDATION_LIBRARY}) list(APPEND qtkeychain_LIBRARIES ${COREFOUNDATION_LIBRARY})
find_library(SECURITY_LIBRARY Security) find_library(SECURITY_LIBRARY Security REQUIRED)
list(APPEND qtkeychain_LIBRARIES ${SECURITY_LIBRARY}) list(APPEND qtkeychain_LIBRARIES ${SECURITY_LIBRARY})
endif() endif()
@ -192,7 +192,7 @@ install(TARGETS ${QTKEYCHAIN_TARGET_NAME}
) )
add_executable( testclient testclient.cpp ) add_executable( testclient testclient.cpp )
target_link_libraries( testclient ${QTKEYCHAIN_TARGET_NAME} ${qtkeychain_LIBRARIES}) target_link_libraries( testclient ${QTKEYCHAIN_TARGET_NAME})
### ###

View File

@ -12,6 +12,23 @@ else()
set(QTKEYCHAIN_INCLUDE_DIRS "@CMAKE_INSTALL_FULL_INCLUDEDIR@") set(QTKEYCHAIN_INCLUDE_DIRS "@CMAKE_INSTALL_FULL_INCLUDEDIR@")
endif() endif()
include(CMakeFindDependencyMacro)
if("@QTKEYCHAIN_VERSION_INFIX@" STREQUAL "5")
find_dependency(Qt5Core)
if(UNIX AND NOT APPLE)
find_dependency(Qt5DBus)
endif()
else()
find_dependency(Qt4 COMPONENTS QtCore)
endif()
if(APPLE)
find_dependency(COREFOUNDATION_LIBRARY CoreFoundation)
find_dependency(SECURITY_LIBRARY Security)
endif()
# Our library dependencies (contains definitions for IMPORTED targets) # Our library dependencies (contains definitions for IMPORTED targets)
include("${QTKEYCHAIN_CMAKE_DIR}/Qt@QTKEYCHAIN_VERSION_INFIX@KeychainLibraryDepends.cmake") include("${QTKEYCHAIN_CMAKE_DIR}/Qt@QTKEYCHAIN_VERSION_INFIX@KeychainLibraryDepends.cmake")