diff options
author | Andreas Schneider <asn@cryptomilk.org> | 2019-11-06 09:06:05 +0100 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2019-11-07 16:14:46 +0100 |
commit | 5de765ebd5066e5eea5895050d944ccc6ae96dd2 (patch) | |
tree | 80ce986d54b89359e81247ec12243a832bb06c2b | |
parent | 9de970160d82d64601bcb707571486676a95277c (diff) | |
download | libssh-5de765ebd5066e5eea5895050d944ccc6ae96dd2.tar.gz libssh-5de765ebd5066e5eea5895050d944ccc6ae96dd2.tar.xz libssh-5de765ebd5066e5eea5895050d944ccc6ae96dd2.zip |
cmake: Rename static library
This is only compiled for tests and fuzzers!
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Reviewed-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
(cherry picked from commit 8c36a865f267ca99562238f61c34e3578cb05098)
-rw-r--r-- | src/CMakeLists.txt | 18 | ||||
-rw-r--r-- | tests/CMakeLists.txt | 3 | ||||
-rw-r--r-- | tests/pkd/CMakeLists.txt | 2 |
3 files changed, 13 insertions, 10 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 5904ac67..485f6ed4 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -365,16 +365,20 @@ install(EXPORT libssh-config DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}) if (BUILD_STATIC_LIB) - add_library(${LIBSSH_STATIC_LIBRARY} STATIC ${libssh_SRCS}) - target_compile_options(${LIBSSH_STATIC_LIBRARY} + add_library(ssh-static STATIC ${libssh_SRCS}) + target_compile_options(ssh-static PRIVATE ${DEFAULT_C_COMPILE_FLAGS} -D_GNU_SOURCE) - target_include_directories(${LIBSSH_STATIC_LIBRARY} - PRIVATE ${LIBSSH_PUBLIC_INCLUDE_DIRS} ${LIBSSH_PRIVATE_INCLUDE_DIRS}) - target_link_libraries(${LIBSSH_STATIC_LIBRARY} + target_include_directories(ssh-static + PUBLIC + $<BUILD_INTERFACE:${libssh_SOURCE_DIR}/include> + $<INSTALL_INTERFACE:include> + PRIVATE ${LIBSSH_PRIVATE_INCLUDE_DIRS}) + target_link_libraries(ssh-static PUBLIC ${LIBSSH_LINK_LIBRARIES}) + add_library(ssh::static ALIAS ssh-static) if (MSVC) set(OUTPUT_SUFFIX static) @@ -382,7 +386,7 @@ if (BUILD_STATIC_LIB) set(OUTPUT_SUFFIX ) endif (MSVC) set_target_properties( - ${LIBSSH_STATIC_LIBRARY} + ssh-static PROPERTIES VERSION ${LIBRARY_VERSION} @@ -396,7 +400,7 @@ if (BUILD_STATIC_LIB) if (WIN32) set_target_properties( - ${LIBSSH_STATIC_LIBRARY} + ssh-static PROPERTIES COMPILE_FLAGS "-DLIBSSH_STATIC" diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 05e97dbb..e8b5482f 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -18,8 +18,7 @@ include_directories( set(TORTURE_LINK_LIBRARIES ${CMOCKA_LIBRARY} - ${LIBSSH_STATIC_LIBRARY} - ${LIBSSH_LINK_LIBRARIES}) + ssh::static) # create test library add_library(${TORTURE_LIBRARY} diff --git a/tests/pkd/CMakeLists.txt b/tests/pkd/CMakeLists.txt index 3eefae87..5a543010 100644 --- a/tests/pkd/CMakeLists.txt +++ b/tests/pkd/CMakeLists.txt @@ -20,7 +20,7 @@ set(pkd_hello_src set(pkd_libs ${CMOCKA_LIBRARY} - ${LIBSSH_STATIC_LIBRARY} + ssh::static ${ARGP_LIBRARIES} pthread ) |