From 5453fc8035b4aaad1a9bbfbeace4fac210fabde8 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Sun, 13 Aug 2023 09:07:26 +0000 Subject: [PATCH] cmake: add `LIB_NAME` variable It holds the name `libssh2`. Mainly to document its uses, and also syncing up with the same variable in libcurl. Closes #1159 --- CMakeLists.txt | 5 +++-- cmake/libssh2-config.cmake.in | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c1050b19..240f70c5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -118,8 +118,9 @@ if(NOT BUILD_STATIC_LIBS AND NOT BUILD_SHARED_LIBS) set(BUILD_STATIC_LIBS ON) endif() -set(LIB_STATIC "libssh2_static") -set(LIB_SHARED "libssh2_shared") +set(LIB_NAME "libssh2") +set(LIB_STATIC "${LIB_NAME}_static") +set(LIB_SHARED "${LIB_NAME}_shared") # lib flavour selected for example and test programs. if(BUILD_SHARED_LIBS) diff --git a/cmake/libssh2-config.cmake.in b/cmake/libssh2-config.cmake.in index bbcc1db8..4b73f93a 100644 --- a/cmake/libssh2-config.cmake.in +++ b/cmake/libssh2-config.cmake.in @@ -4,7 +4,7 @@ include("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@-targets.cmake") # Alias for either shared or static library -add_library(@PROJECT_NAME@::libssh2 ALIAS @PROJECT_NAME@::@LIB_SELECTED@) +add_library(@PROJECT_NAME@::@LIB_NAME@ ALIAS @PROJECT_NAME@::@LIB_SELECTED@) # Compatibility alias -add_library(Libssh2::libssh2 ALIAS @PROJECT_NAME@::@LIB_SELECTED@) +add_library(Libssh2::@LIB_NAME@ ALIAS @PROJECT_NAME@::@LIB_SELECTED@)