mirror of
https://github.com/libssh2/libssh2.git
synced 2025-11-18 15:20:56 +03:00
This reverts commit b60dca8b64.
#547 doesn't build clean anymore with the keyboard interactive changes.
This commit is contained in:
@@ -217,17 +217,9 @@ if(WIN32)
|
|||||||
list(APPEND SOURCES ${PROJECT_SOURCE_DIR}/win32/libssh2.rc)
|
list(APPEND SOURCES ${PROJECT_SOURCE_DIR}/win32/libssh2.rc)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_library(libssh2 OBJECT ${SOURCES})
|
add_library(libssh2 ${SOURCES})
|
||||||
if(BUILD_BOTH_LIBS OR BUILD_SHARED_LIBS)
|
|
||||||
add_library(libssh2-shared SHARED $<TARGET_OBJECTS:libssh2>)
|
|
||||||
# we want it to be called libssh2 on all platforms
|
# we want it to be called libssh2 on all platforms
|
||||||
set_target_properties(libssh2-shared PROPERTIES PREFIX "" OUTPUT_NAME "libssh2")
|
set_target_properties(libssh2 PROPERTIES PREFIX "")
|
||||||
set_target_properties(libssh2 PROPERTIES POSITION_INDEPENDENT_CODE ON)
|
|
||||||
endif()
|
|
||||||
if(BUILD_BOTH_LIBS OR NOT BUILD_SHARED_LIBS)
|
|
||||||
add_library(libssh2-static STATIC $<TARGET_OBJECTS:libssh2>)
|
|
||||||
set_target_properties(libssh2-static PROPERTIES PREFIX "" OUTPUT_NAME "libssh2")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
target_compile_definitions(libssh2 PRIVATE ${PRIVATE_COMPILE_DEFINITIONS})
|
target_compile_definitions(libssh2 PRIVATE ${PRIVATE_COMPILE_DEFINITIONS})
|
||||||
target_include_directories(libssh2
|
target_include_directories(libssh2
|
||||||
@@ -246,10 +238,6 @@ endif(CLEAR_MEMORY)
|
|||||||
add_feature_info("Shared library" BUILD_SHARED_LIBS
|
add_feature_info("Shared library" BUILD_SHARED_LIBS
|
||||||
"creating libssh2 as a shared library (.so/.dll)")
|
"creating libssh2 as a shared library (.so/.dll)")
|
||||||
|
|
||||||
option(BUILD_BOTH_LIBS "Build both static and shared libraries" OFF)
|
|
||||||
add_feature_info("Static and Shared libraries" BUILD_BOTH_LIBS
|
|
||||||
"creating libssh2 as a both a static (.a) and shared library (.so/.dll)")
|
|
||||||
|
|
||||||
option(ENABLE_ZLIB_COMPRESSION "Use zlib for compression")
|
option(ENABLE_ZLIB_COMPRESSION "Use zlib for compression")
|
||||||
add_feature_info(Compression ENABLE_ZLIB_COMPRESSION
|
add_feature_info(Compression ENABLE_ZLIB_COMPRESSION
|
||||||
"using zlib for compression")
|
"using zlib for compression")
|
||||||
@@ -386,10 +374,6 @@ else()
|
|||||||
target_link_libraries(libssh2 PRIVATE ${LIBRARIES})
|
target_link_libraries(libssh2 PRIVATE ${LIBRARIES})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(BUILD_BOTH_LIBS OR BUILD_SHARED_LIBS)
|
|
||||||
target_link_libraries(libssh2-shared PUBLIC libssh2)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
install(FILES
|
install(FILES
|
||||||
@@ -398,28 +382,14 @@ install(FILES
|
|||||||
${PROJECT_SOURCE_DIR}/include/libssh2_sftp.h
|
${PROJECT_SOURCE_DIR}/include/libssh2_sftp.h
|
||||||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
|
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
|
||||||
|
|
||||||
if(BUILD_BOTH_LIBS OR BUILD_SHARED_LIBS)
|
|
||||||
install(TARGETS libssh2
|
install(TARGETS libssh2
|
||||||
EXPORT Libssh2Config
|
EXPORT Libssh2Config
|
||||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||||
install(TARGETS libssh2-shared
|
|
||||||
EXPORT Libssh2Config
|
|
||||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
|
||||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
|
||||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
|
||||||
endif()
|
|
||||||
if(BUILD_BOTH_LIBS OR NOT BUILD_SHARED_LIBS)
|
|
||||||
install(TARGETS libssh2-static
|
|
||||||
EXPORT Libssh2Config
|
|
||||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
|
||||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
|
||||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(BUILD_BOTH_LIBS OR BUILD_SHARED_LIBS)
|
if(BUILD_SHARED_LIBS)
|
||||||
list(APPEND _RUNTIME_DEPENDENCIES $<TARGET_FILE:libssh2-shared>)
|
list(APPEND _RUNTIME_DEPENDENCIES $<TARGET_FILE:libssh2>)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(RUNTIME_DEPENDENCIES ${_RUNTIME_DEPENDENCIES} CACHE INTERNAL
|
set(RUNTIME_DEPENDENCIES ${_RUNTIME_DEPENDENCIES} CACHE INTERNAL
|
||||||
@@ -451,16 +421,9 @@ install(
|
|||||||
|
|
||||||
## Versioning
|
## Versioning
|
||||||
|
|
||||||
if(BUILD_BOTH_LIBS OR BUILD_SHARED_LIBS)
|
set_target_properties(libssh2 PROPERTIES
|
||||||
set_target_properties(libssh2-shared PROPERTIES
|
|
||||||
SOVERSION 1
|
SOVERSION 1
|
||||||
VERSION 1.0.1)
|
VERSION 1.0.1)
|
||||||
endif()
|
|
||||||
if(BUILD_BOTH_LIBS OR NOT BUILD_SHARED_LIBS)
|
|
||||||
set_target_properties(libssh2-static PROPERTIES
|
|
||||||
SOVERSION 1
|
|
||||||
VERSION 1.0.1)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
include(CMakePackageConfigHelpers)
|
include(CMakePackageConfigHelpers)
|
||||||
write_basic_package_version_file(
|
write_basic_package_version_file(
|
||||||
|
|||||||
Reference in New Issue
Block a user