summaryrefslogtreecommitdiff
path: root/Modules/FindTclsh.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-08-10 15:19:14 +0000
committerKitware Robot <kwrobot@kitware.com>2020-08-10 11:25:10 -0400
commit69d26f150246bab12659ded37999bc2ff385c32c (patch)
tree822bf3f7108b986ec0a876f42966697ba92bae11 /Modules/FindTclsh.cmake
parent804d324880924221d22cf8fd3420210c7361c8f4 (diff)
parent98844ec9db5fe4dc4e236f3852d4f3e88a4a9e76 (diff)
downloadcmake-69d26f150246bab12659ded37999bc2ff385c32c.tar.gz
Merge topic 'FPHSA-name-mismatches-chained-via-include'
98844ec9db FPHSA: detect inclusion between find modules Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Logan Barnes <barneslt63@gmail.com> Merge-request: !5107
Diffstat (limited to 'Modules/FindTclsh.cmake')
-rw-r--r--Modules/FindTclsh.cmake9
1 files changed, 9 insertions, 0 deletions
diff --git a/Modules/FindTclsh.cmake b/Modules/FindTclsh.cmake
index f306d5b78f..594d0ec81f 100644
--- a/Modules/FindTclsh.cmake
+++ b/Modules/FindTclsh.cmake
@@ -85,8 +85,17 @@ if(TCL_TCLSH)
endif()
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+if (CMAKE_FIND_PACKAGE_NAME STREQUAL "TCL" OR
+ CMAKE_FIND_PACKAGE_NAME STREQUAL "TclStub")
+ # FindTCL include()'s this module. It's an old pattern, but rather than
+ # trying to suppress this from outside the module (which is then sensitive to
+ # the contents, detect the case in this module and suppress it explicitly.
+ # Transitively, FindTclStub includes FindTCL.
+ set(FPHSA_NAME_MISMATCHED 1)
+endif ()
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Tclsh
REQUIRED_VARS TCL_TCLSH
VERSION_VAR TCLSH_VERSION_STRING)
+unset(FPHSA_NAME_MISMATCHED)
mark_as_advanced(TCL_TCLSH)