Commit Graph

6 Commits

Author SHA1 Message Date
Viktor Szakats
14d5b6c7a7
cmake: replace deprecated PERL_FOUND with Perl_FOUND
`Perl_FOUND` available since CMake v3.3.
`PERL_FOUND` deprecated since v4.2.

Ref: https://cmake.org/cmake/help/v4.2/module/FindPerl.html

Closes #20011
2025-12-17 17:56:32 +01:00
Viktor Szakats
c1c99054ab
cmake: install shell completions for cross-builds
Also:
- omit auto-detecting `CURL_COMPLETION_FISH_DIR` via `pkg-config`
  for cross-builds and when `CMAKE_INSTALL_PREFIX` is set.
- flatten nested `if`s.

Note:
On macOS with Homebrew, `pkg-config --variable completionsdir fish`
returns the version-specific Cellar path instead of the permanent path
`/opt/homebrew/share/fish/vendor_completions.d/`. This mimics what
autotools does, but may need further fixing, possibly upstream.
9c13e62b00/Formula/f/fish.rb
ce631fd2fb/cmake/Install.cmake (L15-L21)

Ref: #17147
Ref: 51170b52d1 #17159
Bug: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1103938

Closes #17145
2025-04-24 10:04:17 +02:00
Viktor Szakats
73b6f8d2fe
cmake: fix fish install directory detection via pkg-config
Follow-up to c8b0f0c9ad #16833

Closes #17147
2025-04-23 11:34:27 +02:00
Viktor Szakats
f616704980
cmake: fix shell completion install when just one flavor is enabled
Also:
- tidy up the `if` tree.
- drop `include(GNUInstallDirs)` in favor of the upper-level one.

Reported-by: Daniel Engberg
Bug: https://github.com/curl/curl/issues/16946#issuecomment-2814663246
Follow-up to c8b0f0c9ad #16833

Closes #17094
2025-04-18 10:34:11 +02:00
Viktor Szakats
b809629f8c
cmake: use absolute paths for completion targets
Fixing potential:
```
CMake Error at scripts/CMakeLists.txt:72 (install):
  install FILES given directory "/usr/ports/ftp/curl/work/.build/scripts/" to
  install.
```

Reported-by: Daniel Engberg
Fixes #16946
Follow-up to c8b0f0c9ad #16833
Closes #16954
2025-04-04 02:34:52 +02:00
Viktor Szakats
c8b0f0c9ad
cmake: add shell completion support
Add the last (*) missing bit for feature parity with autotools.

Also test in CI. Add a new `cmake install` step to GHA/macos.

(*) AFAIK. Let us know if there's something else missing.

Closes #16833
2025-03-28 13:51:38 +01:00