1
0
mirror of https://github.com/libssh2/libssh2.git synced 2026-01-06 14:21:57 +03:00

cmake: rename libssh2-config.cmake.in to libssh2-config.in.cmake

To:
- match filename suffix with file content.
- simplify recognizing CMake sources.
- ensure syntax highlighters use the correct file type.

Also:
- cmakelint.sh: simplify, alpha sort the filelist.

Closes #1765
This commit is contained in:
Viktor Szakats
2025-12-25 18:59:20 +01:00
parent 631e2f82a3
commit 35e1c653bd
3 changed files with 6 additions and 8 deletions

View File

@@ -14,7 +14,7 @@
# cmake-lint can be installed from PyPi with the command "python3 -m pip
# install cmakelang".
#
# The xargs invocation is portable, but does not preserve spaces in file names.
# The xargs invocation is portable, but does not preserve spaces in filenames.
# If such a file is ever added, then this can be portably fixed by switching to
# "xargs -I{}" and appending {} to the end of the xargs arguments (which will
# call cmakelint once per file) or by using the GNU extension "xargs -d'\n'".
@@ -25,15 +25,13 @@ cd "$(dirname "$0")"/..
{
if [ -n "${1:-}" ]; then
for A in "$@"; do printf "%s\n" "$A"; done
for A in "$@"; do printf '%s\n' "$A"; done
elif git rev-parse --is-inside-work-tree >/dev/null 2>&1; then
git ls-files
git ls-files '**CMakeLists.txt' '*.cmake'
else
# strip off the leading ./ to make the grep regexes work properly
find . -type f | sed 's@^\./@@'
find . -type f \( -name 'CMakeLists.txt' -o -name '*.cmake' \)
fi
} | grep -E '(^CMake|/CMake|\.cmake$|\.cmake\.in$)' | grep -v -E '(\.h\.cmake|\.c)$' \
| xargs \
} | sort | xargs \
cmake-lint \
--suppress-decorations \
--disable \

View File

@@ -218,7 +218,7 @@ if(NOT LIBSSH2_DISABLE_INSTALL)
export(PACKAGE ${PROJECT_NAME}) # register it
# Generate libssh2-config.cmake into build tree and install it with dependencies
configure_file("${PROJECT_SOURCE_DIR}/cmake/libssh2-config.cmake.in" "${PROJECT_NAME}-config.cmake" @ONLY)
configure_file("${PROJECT_SOURCE_DIR}/cmake/libssh2-config.in.cmake" "${PROJECT_NAME}-config.cmake" @ONLY)
install(
FILES
"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config.cmake"