FindTCL triggers find_package_handle_standard_args warning for Tclsh
This simple CMakeLists.txt
file
cmake_minimum_required(VERSION 3.18)
project(TestFindTCL)
find_package(TCL)
triggers this warning:
CMake Warning (dev) at /usr/share/cmake-3.18/Modules/FindPackageHandleStandardArgs.cmake:273 (message):
The package name passed to `find_package_handle_standard_args` (Tclsh) does
not match the name of the calling package (TCL). 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):
/usr/share/cmake-3.18/Modules/FindTclsh.cmake:95 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
/usr/share/cmake-3.18/Modules/FindTCL.cmake:49 (include)
CMakeLists.txt:5 (find_package)
This warning is for project developers. Use -Wno-dev to suppress it.
FindTCL.cmake
seems to include FindTclsh.cmake
so when find_package_handle_standard_args
is run it thinks it is in the TLC package instead of the Tclsh package:
# FindTCL.cmake
...
include(${CMAKE_CURRENT_LIST_DIR}/CMakeFindFrameworks.cmake)
include(${CMAKE_CURRENT_LIST_DIR}/FindTclsh.cmake)
include(${CMAKE_CURRENT_LIST_DIR}/FindWish.cmake)
...
I couldn't figure out how to suppress the warning or propagate NAME_MISMATCHED
from the find_package command but it's possible I missed something in the docs.