Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .devcontainer
Submodule .devcontainer updated 55 files
+106 −0 .github/actions/cmake-build/action.yml
+10 −16 .github/wf-templates/xpbuild.yml
+1 −2 .github/wf-templates/xprelease.yml
+52 −8 .github/workflows/README.md
+59 −70 .github/workflows/build-linux.yml
+7 −45 .github/workflows/build-macos.yml
+7 −53 .github/workflows/build-windows.yml
+72 −119 .github/workflows/release-from-build.yml
+3 −3 README.md
+0 −40 cmake/Findexdlpro.cmake
+63 −63 cmake/README.md
+1 −1 cmake/cpack/README.md
+62 −14 cmake/deps.cmake
+3 −2 cmake/deps.dot
+ cmake/deps.png
+499 −0 cmake/deps.svg
+0 −0 cmake/legacy/Findscript.cmake.in
+0 −0 cmake/legacy/cmsappendsuffix.cmake
+0 −0 cmake/legacy/cmsconfigurefile.cmake
+0 −0 cmake/legacy/cmscopyfilemd5.cmake
+0 −0 cmake/legacy/cmscopyfiles.cmake
+0 −0 cmake/legacy/cmscopymanuals.cmake
+0 −0 cmake/legacy/cmsdownload.cmake
+0 −0 cmake/legacy/launchWorkflow.cmake
+0 −0 cmake/legacy/macpro.cmake
+0 −1 cmake/legacy/sync.cmake
+0 −0 cmake/legacy/sync.sh.in
+928 −0 cmake/legacy/xpfunmac.cmake
+0 −0 cmake/legacy/xpopts.cmake.in
+0 −0 cmake/legacy/xpsolpkg.cmake
+0 −67 cmake/presets/xpDarwinMakefilesRelease.json
+0 −67 cmake/presets/xpLinuxMakefilesRelease.json
+124 −198 cmake/pros.cmake
+0 −7 cmake/usexp.cmake.in
+0 −22 cmake/usexpdev.cmake.in
+0 −0 cmake/web/NodePath.cmake
+0 −0 cmake/web/version.js.in
+0 −0 cmake/web/version.ts.in
+0 −0 cmake/web/versionjs.cmake
+0 −0 cmake/web/xpweb.cmake
+343 −1,050 cmake/xpfunmac.cmake
+6 −0 cmake/xproinc.cmake
+0 −1 cmake/xptoplevel.cmake
+6 −5 cmake/xpuse.cmake.in
+0 −1 compose.bld.sh
+0 −1 compose.ci.sh
+1 −1 compose.gpu.sh
+1 −2 compose.pro.sh
+0 −6 compose.xdl.sh
+7 −73 denv.sh
+66 −32 funcs.sh
+15 −10 graph/graph.dot
+ graph/graph.png
+1 −1 local.dockerfile
+90 −0 tools.sh
26 changes: 10 additions & 16 deletions .github/workflows/xpbuild.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
name: Build
permissions:
contents: read
pull-requests: write
on:
push:
branches: [ "dev" ]
Expand All @@ -7,24 +10,15 @@ on:
workflow_dispatch:
jobs:
linux:
uses: externpro/externpro/.github/workflows/build-linux.yml@25.06
with:
cmake-workflow-preset: Linux
runon: ubuntu-latest
secrets: inherit
linux-arm64:
uses: externpro/externpro/.github/workflows/build-linux.yml@25.06
with:
cmake-workflow-preset: Linux
runon: ubuntu-24.04-arm
permissions:
contents: read
pull-requests: write
packages: write
uses: externpro/externpro/.github/workflows/build-linux.yml@25.07.2
secrets: inherit
macos:
uses: externpro/externpro/.github/workflows/build-macos.yml@25.06
with:
cmake-workflow-preset: Darwin
uses: externpro/externpro/.github/workflows/build-macos.yml@25.07.2
secrets: inherit
windows:
uses: externpro/externpro/.github/workflows/build-windows.yml@25.06
with:
cmake-workflow-preset: Windows
uses: externpro/externpro/.github/workflows/build-windows.yml@25.07.2
secrets: inherit
3 changes: 1 addition & 2 deletions .github/workflows/xprelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,9 @@ on:
jobs:
# Upload build artifacts as release assets
release-from-build:
uses: externpro/externpro/.github/workflows/release-from-build.yml@25.06
uses: externpro/externpro/.github/workflows/release-from-build.yml@25.07.2
with:
workflow_run_url: ${{ github.event.inputs.workflow_run_url }}
artifact_pattern: "*.tar.xz"
permissions:
contents: write
id-token: write
Expand Down
38 changes: 21 additions & 17 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,22 +41,6 @@ set(CMAKE_PROJECT_TOP_LEVEL_INCLUDES .devcontainer/cmake/xproinc.cmake)
project(libssh2 C)
set(PROJECT_URL "https://www.libssh2.org/")
set(PROJECT_DESCRIPTION "The SSH library")
include(GNUInstallDirs)
include(xpflags)
set(targetsFile Libssh2Config)
if(NOT DEFINED XP_INSTALL_CMAKEDIR)
set(XP_INSTALL_CMAKEDIR ${CMAKE_INSTALL_DATADIR}/cmake)
endif()
if(DEFINED XP_NAMESPACE)
set(XP_OPT_INSTALL FALSE)
set(nameSpace ${XP_NAMESPACE}::)
xpPackageDevel(TARGETS_FILE ${targetsFile} DEPS openssl zlib
LIBRARIES ${XP_NAMESPACE}::${PROJECT_NAME}
)
else()
set(XP_OPT_INSTALL TRUE)
set(nameSpace Libssh2::)
endif()

if (CMAKE_VERSION VERSION_LESS "3.1")
if (CMAKE_C_COMPILER_ID STREQUAL "GNU")
Expand Down Expand Up @@ -94,6 +78,26 @@ if(NOT LIBSSH2_VERSION OR
"${CMAKE_CURRENT_SOURCE_DIR}/include/libssh2.h")
endif()

set(targetsFile Libssh2Config)
if(DEFINED XP_NAMESPACE)
xpExternPackage(NAMESPACE ${XP_NAMESPACE} ALIAS_NAMESPACE Libssh2
TARGETS_FILE ${targetsFile} LIBRARIES ${PROJECT_NAME}
BASE ${PROJECT_NAME}-${LIBSSH2_VERSION_MAJOR}.${LIBSSH2_VERSION_MINOR}.${LIBSSH2_VERSION_PATCH}
XPDIFF "patch" DEPS openssl zlib
WEB "http://www.libssh2.org/" UPSTREAM "github.com/libssh2/libssh2"
DESC "client-side C library implementing SSH2 protocol"
LICENSE "[BSD-3-Clause](http://www.libssh2.org/license.html 'BSD 3-Clause New or Revised License')"
)
set(CMAKE_OPT_INSTALL FALSE)
set(CMAKE_NAMESPACE ${XP_NAMESPACE})
set(CMAKE_INSTALL_CMAKEDIR ${XP_INSTALL_CMAKEDIR})
else()
set(CMAKE_OPT_INSTALL TRUE)
set(CMAKE_NAMESPACE Libssh2)
set(CMAKE_INSTALL_CMAKEDIR lib/cmake/libssh2)
endif()

include(GNUInstallDirs)
install(
FILES docs/AUTHORS COPYING docs/HACKING README RELEASE-NOTES NEWS
DESTINATION ${CMAKE_INSTALL_DOCDIR})
Expand Down Expand Up @@ -122,6 +126,6 @@ set(CPACK_PACKAGE_VERSION_MAJOR ${LIBSSH2_VERSION_MAJOR})
set(CPACK_PACKAGE_VERSION_MINOR ${LIBSSH2_VERSION_MINOR})
set(CPACK_PACKAGE_VERSION_PATCH ${LIBSSH2_VERSION_PATCH})
set(CPACK_PACKAGE_VERSION ${LIBSSH2_VERSION})
if(XP_OPT_INSTALL)
if(CMAKE_OPT_INSTALL)
include(CPack)
endif()
2 changes: 1 addition & 1 deletion docs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,6 @@ set(MAN_PAGES
libssh2_version.3)

include(GNUInstallDirs)
if(XP_OPT_INSTALL)
if(CMAKE_OPT_INSTALL)
install(FILES ${MAN_PAGES} DESTINATION ${CMAKE_INSTALL_MANDIR}/man3)
endif()
10 changes: 5 additions & 5 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -394,12 +394,12 @@ set(RUNTIME_DEPENDENCIES ${_RUNTIME_DEPENDENCIES} CACHE INTERNAL

## During package installation, install Libssh2Config.cmake
install(EXPORT ${targetsFile}
NAMESPACE ${nameSpace}
DESTINATION ${XP_INSTALL_CMAKEDIR})
NAMESPACE ${CMAKE_NAMESPACE}::
DESTINATION ${CMAKE_INSTALL_CMAKEDIR})

## During build, register directly from build tree
# create Libssh2Config.cmake
export(TARGETS libssh2 NAMESPACE ${nameSpace} FILE ${targetsFile}.cmake)
export(TARGETS libssh2 NAMESPACE ${CMAKE_NAMESPACE}:: FILE ${targetsFile}.cmake)
export(PACKAGE Libssh2) # register it

## Export a .pc file for client projects not using CMaek
Expand All @@ -410,7 +410,7 @@ if(PC_LIBS)
string(REPLACE ";" " " PC_LIBS "${PC_LIBS}")
endif()
configure_file(libssh2.pc.in libssh2.pc @ONLY)
if(XP_OPT_INSTALL)
if(CMAKE_OPT_INSTALL)
install(
FILES ${CMAKE_CURRENT_BINARY_DIR}/libssh2.pc
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
Expand All @@ -429,4 +429,4 @@ write_basic_package_version_file(
COMPATIBILITY SameMajorVersion)
install(
FILES ${CMAKE_CURRENT_BINARY_DIR}/${targetsFile}Version.cmake
DESTINATION ${XP_INSTALL_CMAKEDIR})
DESTINATION ${CMAKE_INSTALL_CMAKEDIR})