From f0b2c39d2fecfa989cd6c455f2736fb914db80ec Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Sun, 8 Mar 2009 12:11:10 +0000 Subject: Fix crypto/gcrypt detection and prepare for cross compilation. git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@245 7dcaeef0-15fb-0310-b436-a5af3365683c --- CMakeLists.txt | 8 ++++---- include/libssh/CMakeLists.txt | 2 ++ libssh/CMakeLists.txt | 29 +++++++++++++++++++++++++---- 3 files changed, 31 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2a8af3b7..59422478 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -40,12 +40,12 @@ find_package(ZLIB REQUIRED) find_package(OpenSSL) -if (NOT CRYPTO_FOUND) +if (NOT CRYPTO_LIBRARY) find_package(GCrypt) - if (NOT GCRYPT_FOUND) + if (NOT GCRYPT_LIBRARY) message(FATAL_ERROR "Could not find OpenSSL or GCrypt") - endif (NOT GCRYPT_FOUND) -endif (NOT CRYPTO_FOUND) + endif (NOT GCRYPT_LIBRARY) +endif (NOT CRYPTO_LIBRARY) # config.h checks include(ConfigureChecks.cmake) diff --git a/include/libssh/CMakeLists.txt b/include/libssh/CMakeLists.txt index 3e1c3d50..05605106 100644 --- a/include/libssh/CMakeLists.txt +++ b/include/libssh/CMakeLists.txt @@ -14,5 +14,7 @@ INSTALL( ${libssh_HDRS} DESTINATION ${INCLUDE_INSTALL_DIR}/${APPLICATION_NAME} + COMPONENT + libraries ) diff --git a/libssh/CMakeLists.txt b/libssh/CMakeLists.txt index a3e5e210..62bf4b92 100644 --- a/libssh/CMakeLists.txt +++ b/libssh/CMakeLists.txt @@ -9,8 +9,6 @@ set(LIBSSH_PUBLIC_INCLUDE_DIRS set(LIBSSH_PRIVATE_INCLUDE_DIRS ${CMAKE_BINARY_DIR} - ${OPENSSL_INCLUDE_DIRS} - ${GCRYPT_INCLUDE_DIRS} ${ZLIB_INCLUDE_DIRS} ) @@ -21,11 +19,32 @@ set(LIBSSH_LIBRARY set(LIBSSH_LINK_LIBRARIES ${LIBSSH_LIBRARY} - ${CRYPTO_LIBRARY} - ${GCRYPT_LIBRARY} ${ZLIB_LIBRARIES} ) +if (CRYPTO_LIBRARY) + set(LIBSSH_PRIVATE_INCLUDE_DIRS + ${LIBSSH_PRIVATE_INCLUDE_DIRS} + ${OPENSSL_INCLUDE_DIRS} + ) + set(LIBSSH_LINK_LIBRARIES + ${LIBSSH_LINK_LIBRARIES} + ${CRYPTO_LIBRARY} + ) +endif (CRYPTO_LIBRARY) + +if (GCRYPT_LIBRARY) + set(LIBSSH_PRIVATE_INCLUDE_DIRS + ${LIBSSH_PRIVATE_INCLUDE_DIRS} + ${GCRYPT_INCLUDE_DIRS} + ) + set(LIBSSH_LINK_LIBRARIES + ${LIBSSH_LINK_LIBRARIES} + ${GCRYPT_LIBRARY} + ) +endif (GCRYPT_LIBRARY) + + set(libssh_SRCS agent.c auth1.c @@ -87,5 +106,7 @@ install( ${LIBSSH_LIBRARY} DESTINATION ${LIB_INSTALL_DIR} + COMPONENT + libraries ) -- cgit v1.2.3