cmake: fix broken dependency chain for cmdline-opts, tidy-ups

- make `curl.1` and `curl.txt` depend on `DPAGES`.
  To trigger a rebuild when an individual manpage is updated.

- tell CMake that the cmdline-opts command also creates `curl.txt`.

- make `tool_hugehelp.c` depend on `curl.txt` (was: `curl.1`), to match
  what it actually uses for input.

- stop using `generate-curl.1` as an indirect way to create `curl.txt`
  in time for `tool_hugehelp.c`. After the fixes above there is a direct
  depedency chain between them.

- move `ASCIIPAGE` and `MANPAGE` variables to top-level, re-use them in
  `src` and prefix them with `CURL_` to avoid clashing with other
  projects.

- drop double quotes from `generate-curl.1` as a hint that it is not
  a filename, but a target name.

- src: tidy up order of dependency lists.

Closes #14883
This commit is contained in:
Viktor Szakats 2024-09-12 15:16:51 +02:00
parent 5cefda1b93
commit 496da69aa0
No known key found for this signature in database
GPG key ID: B5ABD165E2AEF201
3 changed files with 16 additions and 16 deletions

View file

@ -30,18 +30,14 @@ if(ENABLE_CURL_MANUAL AND HAVE_MANUAL_TOOLS)
OUTPUT "tool_hugehelp.c"
COMMAND ${CMAKE_COMMAND} -E echo "#include \"tool_setup.h\"" > "tool_hugehelp.c"
COMMAND ${CMAKE_COMMAND} -E echo "#ifndef HAVE_LIBZ" >> "tool_hugehelp.c"
COMMAND "${PERL_EXECUTABLE}" "${CMAKE_CURRENT_SOURCE_DIR}/mkhelp.pl"
< "${CURL_BINARY_DIR}/docs/cmdline-opts/curl.txt" >> "tool_hugehelp.c"
COMMAND "${PERL_EXECUTABLE}" "${CMAKE_CURRENT_SOURCE_DIR}/mkhelp.pl" < "${CURL_ASCIIPAGE}" >> "tool_hugehelp.c"
COMMAND ${CMAKE_COMMAND} -E echo "#else" >> "tool_hugehelp.c"
COMMAND "${PERL_EXECUTABLE}" "${CMAKE_CURRENT_SOURCE_DIR}/mkhelp.pl" -c
< "${CURL_BINARY_DIR}/docs/cmdline-opts/curl.txt" >> "tool_hugehelp.c"
COMMAND "${PERL_EXECUTABLE}" "${CMAKE_CURRENT_SOURCE_DIR}/mkhelp.pl" -c < "${CURL_ASCIIPAGE}" >> "tool_hugehelp.c"
COMMAND ${CMAKE_COMMAND} -E echo "#endif /* HAVE_LIBZ */" >> "tool_hugehelp.c"
DEPENDS
"generate-curl.1"
"${CURL_BINARY_DIR}/docs/cmdline-opts/curl.1"
"${CMAKE_CURRENT_SOURCE_DIR}/mkhelp.pl"
"${CMAKE_CURRENT_SOURCE_DIR}/tool_hugehelp.h"
"${CURL_ASCIIPAGE}"
VERBATIM)
else()
add_custom_command(
@ -64,8 +60,8 @@ if(CURL_CA_EMBED_SET)
COMMAND "${PERL_EXECUTABLE}" "${CMAKE_CURRENT_SOURCE_DIR}/mk-file-embed.pl" --var curl_ca_embed
< "${CURL_CA_EMBED}" > "tool_ca_embed.c"
DEPENDS
"${CURL_CA_EMBED}"
"${CMAKE_CURRENT_SOURCE_DIR}/mk-file-embed.pl"
"${CURL_CA_EMBED}"
VERBATIM)
list(APPEND CURL_CFILES "tool_ca_embed.c")
else()