$OpenBSD: patch-Modules_FindWish_cmake,v 1.5 2016/11/28 09:15:13 dcoppa Exp $
--- Modules/FindWish.cmake.orig	Fri Nov 11 15:37:13 2016
+++ Modules/FindWish.cmake	Fri Nov 25 22:31:45 2016
@@ -19,14 +19,21 @@
 #
 # if UNIX is defined, then it will look for the cygwin version first
 
+set(MODTCL_VERSION $ENV{MODTCL_VERSION})
+set(MODTK_VERSION $ENV{MODTK_VERSION})
+
 if(UNIX)
   find_program(TK_WISH cygwish80 )
 endif()
 
 get_filename_component(TCL_TCLSH_PATH "${TCL_TCLSH}" PATH)
 get_filename_component(TCL_TCLSH_PATH_PARENT "${TCL_TCLSH_PATH}" PATH)
-string(REGEX REPLACE
-  "^.*tclsh([0-9]\\.*[0-9]).*$" "\\1" TCL_TCLSH_VERSION "${TCL_TCLSH}")
+if(MODTCL_VERSION)
+  set(TCL_TCLSH_VERSION "${MODTCL_VERSION}")
+else(MODTCL_VERSION)
+  string(REGEX REPLACE
+    "^.*tclsh([0-9]\\.*[0-9]).*$" "\\1" TCL_TCLSH_VERSION "${TCL_TCLSH}")
+endif(MODTCL_VERSION)
 
 get_filename_component(TCL_INCLUDE_PATH_PARENT "${TCL_INCLUDE_PATH}" PATH)
 get_filename_component(TK_INCLUDE_PATH_PARENT "${TK_INCLUDE_PATH}" PATH)
@@ -65,16 +72,22 @@ if(WIN32)
     )
 endif()
 
-set(TK_WISH_NAMES
-  wish
-  wish${TCL_LIBRARY_VERSION} wish${TK_LIBRARY_VERSION} wish${TCL_TCLSH_VERSION}
-  wish86 wish8.6
-  wish85 wish8.5
-  wish84 wish8.4
-  wish83 wish8.3
-  wish82 wish8.2
-  wish80 wish8.0
-  )
+if(MODTK_VERSION)
+  set(TK_WISH_NAMES
+    wish${MODTK_VERSION}
+    )
+else(MODTK_VERSION)
+  set(TK_WISH_NAMES
+    wish
+    wish${TCL_LIBRARY_VERSION} wish${TK_LIBRARY_VERSION} wish${TCL_TCLSH_VERSION}
+    wish86 wish8.6
+    wish85 wish8.5
+    wish84 wish8.4
+    wish83 wish8.3
+    wish82 wish8.2
+    wish80 wish8.0
+    )
+endif(MODTK_VERSION)
 
 find_program(TK_WISH
   NAMES ${TK_WISH_NAMES}
