Merge pull request #78 from TheOneRing/depend
Use find_dependency to find the dependencies
This commit is contained in:
commit
8f42ff627a
|
@ -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})
|
||||||
|
|
||||||
|
|
||||||
###
|
###
|
||||||
|
|
|
@ -6,10 +6,27 @@
|
||||||
# Compute paths
|
# Compute paths
|
||||||
get_filename_component(QTKEYCHAIN_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
|
get_filename_component(QTKEYCHAIN_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
|
||||||
if(EXISTS "${QTKEYCHAIN_CMAKE_DIR}/CMakeCache.txt")
|
if(EXISTS "${QTKEYCHAIN_CMAKE_DIR}/CMakeCache.txt")
|
||||||
# In build tree
|
# In build tree
|
||||||
include("${QTKEYCHAIN_CMAKE_DIR}/Qt@QTKEYCHAIN_VERSION_INFIX@KeychainBuildTreeSettings.cmake")
|
include("${QTKEYCHAIN_CMAKE_DIR}/Qt@QTKEYCHAIN_VERSION_INFIX@KeychainBuildTreeSettings.cmake")
|
||||||
else()
|
else()
|
||||||
set(QTKEYCHAIN_INCLUDE_DIRS "@CMAKE_INSTALL_FULL_INCLUDEDIR@")
|
set(QTKEYCHAIN_INCLUDE_DIRS "@CMAKE_INSTALL_FULL_INCLUDEDIR@")
|
||||||
|
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()
|
endif()
|
||||||
|
|
||||||
# Our library dependencies (contains definitions for IMPORTED targets)
|
# Our library dependencies (contains definitions for IMPORTED targets)
|
||||||
|
|
Loading…
Reference in New Issue