cmake: fix warning for later CMake versions by rizsotto · Pull Request #221 · librsync/librsync
When building this project with CMake (version 3.20.5), I got the following error message:
-- Found ZLIB: /usr/lib64/libz.so (found version "1.2.11")
-- ZLIB_INCLUDE_DIRS = /usr/include
-- ZLIB_LIBRARIES = /usr/lib64/libz.so
CMake Warning (dev) at /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:438 (message):
The package name passed to `find_package_handle_standard_args` (LIBB2) does
not match the name of the calling package (libb2). This can lead to
problems in calling code that expects `find_package` result variables
(e.g., `_FOUND`) to follow a certain pattern.
Call Stack (most recent call first):
cmake/Findlibb2.cmake:16 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
CMakeLists.txt:183 (find_package)
This warning is for project developers. Use -Wno-dev to suppress it.
-- Found LIBB2: /usr/lib64/libb2.so
-- LIBB2_INCLUDE_DIRS = /usr/include
-- LIBB2_LIBRARIES = /usr/lib64/libb2.so
To fix it, I've just followed the error message instruction and renamed the cmake/Findlibb2.cmake to cmake/FindLIBB2.cmake. (Plus, I've converted the CMake commands to lowercase to match with the rest of the project.)