diff --git a/ci/cmakelint.sh b/ci/cmakelint.sh index 85ecb678..88506384 100755 --- a/ci/cmakelint.sh +++ b/ci/cmakelint.sh @@ -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 \ diff --git a/cmake/libssh2-config.cmake.in b/cmake/libssh2-config.in.cmake similarity index 100% rename from cmake/libssh2-config.cmake.in rename to cmake/libssh2-config.in.cmake diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index dd989a2f..d5821c94 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -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"