mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-04 12:20:42 +09:00
cmake: use imported targets for OpenSSL and zlib
Imported targets are highly preferred over the individual variables for includes and libs because they will be used in a coherent way and any spelling mistakes or unavailability won't go unnoticed. Also it will prevent bugs like conan-io/conan-center-index#16900 or using mismatching header/libs combinations. Signed-off-by: Gregor Jasny <gjasny@googlemail.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
committed by
Jakub Jelen
parent
486d2289fa
commit
6ad455a8ac
@@ -6,9 +6,7 @@ endif (BSD OR SOLARIS OR OSX)
|
||||
|
||||
set(TORTURE_LIBRARY torture)
|
||||
|
||||
include_directories(${OPENSSL_INCLUDE_DIR}
|
||||
${CMOCKA_INCLUDE_DIR}
|
||||
${ZLIB_INCLUDE_DIR}
|
||||
include_directories(${CMOCKA_INCLUDE_DIR}
|
||||
${libssh_BINARY_DIR}/include
|
||||
${libssh_BINARY_DIR}
|
||||
${libssh_SOURCE_DIR}/src
|
||||
|
||||
@@ -44,7 +44,7 @@ else ()
|
||||
${libssh_SOURCE_DIR}/src/md_crypto.c
|
||||
)
|
||||
set(override_libs
|
||||
${OPENSSL_CRYPTO_LIBRARIES}
|
||||
OpenSSL::Crypto
|
||||
)
|
||||
endif (WITH_GCRYPT)
|
||||
|
||||
|
||||
@@ -5,7 +5,6 @@ if (WITH_SERVER AND UNIX AND NOT WIN32)
|
||||
include_directories(${libssh_SOURCE_DIR}/include
|
||||
${libssh_BINARY_DIR}/include
|
||||
${CMOCKA_INCLUDE_DIR}
|
||||
${ZLIB_INCLUDE_DIR}
|
||||
${CMAKE_BINARY_DIR}
|
||||
${libssh_SOURCE_DIR}/src
|
||||
${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
project(unittests C)
|
||||
|
||||
include_directories(${OPENSSL_INCLUDE_DIR})
|
||||
|
||||
set(LIBSSH_UNIT_TESTS
|
||||
torture_bignum
|
||||
torture_buffer
|
||||
|
||||
Reference in New Issue
Block a user