CPackDeb: file utility is not available. CPACK_DEBIAN_PACKAGE_SHLIBDEPS and CPACK_DEBIAN_PACKAGE_GENERATE_SHLIBS options are not available

When installing CMake via the github release artifact as follows:

CMAKE_VERSION="3.27.7"
echo "Installing CMake ${CMAKE_VERSION}"
wget https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-linux-x86_64.sh
wget https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-linux-x86_64.tar.gz
chmod u+x cmake-${CMAKE_VERSION}-linux-x86_64.sh
./cmake-${CMAKE_VERSION}-linux-x86_64.sh --skip-license --exclude-subdir --prefix=/usr/local
rm cmake-${CMAKE_VERSION}-linux-x86_64.sh
rm cmake-${CMAKE_VERSION}-linux-x86_64.tar.gz

and then attempting to use cpack to build a library into a debian package I get the following error:

 cpack -G DEB
CPack: Create package using DEB
CPack: Install projects
CPack: - Run preinstall target for: carma-clock
CPack: - Install project: carma-clock []
CPack: Create package
CMake Error at /usr/local/share/cmake-3.22/Modules/Internal/CPack/CPackDeb.cmake:165 (message):
  CPackDeb: file utility is not available.  CPACK_DEBIAN_PACKAGE_SHLIBDEPS
  and CPACK_DEBIAN_PACKAGE_GENERATE_SHLIBS options are not available.
Call Stack (most recent call first):
  /usr/local/share/cmake-3.22/Modules/Internal/CPack/CPackDeb.cmake:793 (cpack_deb_prepare_package_vars)


CPack Error: Error while execution CPackDeb.cmake
CPack Error: Problem compressing the directory
CPack Error: Error when generating package: carma-clock-1
Error: Process completed with exit code 1.

The build process is as follows

cmake -Bbuild -DCMAKE_CXX_FLAGS= -DCMAKE_BUILD_TYPE=Release -DPACKAGE_VERSION_SUFFIX=20231110.git38.d03b666
cd build
cmake --build .
cpack -G DEB

Any help is greatly appreciated. Seems to work fine for CMAKE installed via apt. Not sure why there would be any difference. For more build output see github action CI output Update build.yml · usdot-fhwa-stol/carma-time-lib@d35a85b · GitHub

Have you tried to install the file utility? apt update && apt install file