cmake: replace cmakelint with cmake-lint from cmakelang, fix issues

This linter detects formatting and naming issues with minimal amount of
noise. It seems to be an improvement over the existing linter which was
only detecting line width overruns.

Also: fix to exclude `CurlTests.c` from linter.

Ref: https://cmake-format.readthedocs.io/en/latest/cmake-lint.html
Ref: https://github.com/cheshirekow/cmake_format

Closes #17576
This commit is contained in:
Viktor Szakats 2025-06-10 18:25:57 +02:00
parent 56d5982312
commit b761eb5add
No known key found for this signature in database
GPG key ID: B5ABD165E2AEF201
12 changed files with 72 additions and 39 deletions

View file

@ -25,6 +25,7 @@
curl_transform_makefile_inc("Makefile.inc" "${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.cmake")
include("${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.cmake")
# Generate man pages
function(curl_add_manual_pages _listname)
# Maximum number of files per command to stay within shell/OS limits
if(CMAKE_HOST_UNIX)
@ -78,8 +79,8 @@ curl_add_manual_pages(man_MANS)
add_custom_target(curl-man ALL DEPENDS ${man_MANS})
if(NOT CURL_DISABLE_INSTALL)
set(_src "")
foreach(_f IN LISTS man_MANS)
list(APPEND _src "${CMAKE_CURRENT_BINARY_DIR}/${_f}")
foreach(_file IN LISTS man_MANS)
list(APPEND _src "${CMAKE_CURRENT_BINARY_DIR}/${_file}")
endforeach()
install(FILES ${_src} DESTINATION "${CMAKE_INSTALL_MANDIR}/man3")
unset(_src)

View file

@ -30,8 +30,8 @@ add_custom_target(curl-opts-man DEPENDS ${man_MANS})
add_dependencies(curl-man curl-opts-man)
if(NOT CURL_DISABLE_INSTALL)
set(_src "")
foreach(_f IN LISTS man_MANS)
list(APPEND _src "${CMAKE_CURRENT_BINARY_DIR}/${_f}")
foreach(_file IN LISTS man_MANS)
list(APPEND _src "${CMAKE_CURRENT_BINARY_DIR}/${_file}")
endforeach()
install(FILES ${_src} DESTINATION "${CMAKE_INSTALL_MANDIR}/man3")
endif()