Skip to content

cmake: sync and improve Find modules, add pkg-config native detection - #1445

Closed
vszakats wants to merge 24 commits into
libssh2:masterfrom
vszakats:cm-find-tidy
Closed

vszakats wants to merge 24 commits into
libssh2:masterfrom
vszakats:cm-find-tidy

Conversation

@vszakats

@vszakats vszakats commented Aug 17, 2024 •

Copy link
Copy Markdown
Member
  • sync code between Find modules.
  • wolfssl: replace pkg-config hints with native detection.
  • libgcrypt, mbedtls: add pkg-config-based native detection.
  • libgcrypt: add version detection.
  • limit pkg-config use for UNIX, vcpkg, and non-cross MinGW builds,
    and builds with no manual customization via *_INCLUDE_DIR or
    *_LIBRARY.
  • replace and sync Find module header comments.
  • ci: delete manual mbedTLS config that's now redundant.

Based on similar work done in curl.

Second attempt at #1420
Closes #1445


  • apply the non-hint pkg-config pattern used in Libgcrypt to mbedTLS and wolfSSL?
  • redo renaming based on cmakelint suggestions (FindUPPERCASE.cmake)? (As a separate PR after merging this patch) [SKIP, keep the capitalized/camelcase scheme]
  • move the renaming to a separate PR. [→ 570de0f]

w/o whitespace: https://github.com/libssh2/libssh2/pull/1445/files?w=1

@vszakats vszakats added the build label Aug 17, 2024
@vszakats
vszakats marked this pull request as draft August 17, 2024 22:44
vszakats added a commit that referenced this pull request Aug 18, 2024
To match the curl ones.

Cherry-picked from #1445
@vszakats
vszakats marked this pull request as ready for review August 18, 2024 18:25
@vszakats vszakats changed the title cmake: Find module fixups cmake: sync up and improve Find modules Aug 18, 2024
@vszakats
vszakats force-pushed the cm-find-tidy branch 2 times, most recently from fdcb9ae to fe6b288 Compare August 23, 2024 15:54
vszakats added a commit that referenced this pull request Oct 3, 2024
- `LIBRARIES` -> `LIBSSH2_LIBS`
- `SOCKET_LIBRARIES` -> `LIBSSH2_LIBS_SOCKET`

Also initialize them before use.

Cherry-picked from #1445
Closes #1464
@vszakats
vszakats force-pushed the cm-find-tidy branch 2 times, most recently from 13e288b to a433436 Compare October 4, 2024 00:26
vszakats added a commit to vszakats/libssh2 that referenced this pull request Oct 4, 2024
vszakats added a commit to vszakats/libssh2 that referenced this pull request Oct 4, 2024
@vszakats
vszakats force-pushed the cm-find-tidy branch 2 times, most recently from 7a098ca to ad19049 Compare October 4, 2024 11:49
It uses LIBGCRYPT_INCLUDE_DIRS as-is instead of forwarding it as a hint
to find_path(). The list includes the header path of a Libgcrypt
dependency, with its headers referenced by Libgcrypt's public headers.
We must keep this header path there for a successful build.
Though this might be restored in a separate commit,
together with the deleted logic.

Follow-up to 4159467 libssh2#1192
Hm, when using `mbedtls`, pkg-config picks up the mbedtls as the only
lib, and it fails while linking. Seems like the absolute path is meant
to point to the shared lib, while the bare lib to the static? Though
there is a separate STATIC version returned of each result variable.
@vszakats vszakats changed the title cmake: sync up and improve Find modules cmake: sync and improve Find modules, add pkg-config native detection Oct 4, 2024
@vszakats vszakats closed this in 4506413 Oct 5, 2024
@vszakats
vszakats deleted the cm-find-tidy branch October 5, 2024 19:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant