I think this goes in the right direction. What do you think? Index: cmake.port.mk =================================================================== RCS file: /cvs/ports/devel/cmake/cmake.port.mk,v retrieving revision 1.66 diff -u -p -r1.66 cmake.port.mk --- cmake.port.mk 25 May 2020 05:12:00 -0000 1.66 +++ cmake.port.mk 6 Nov 2020 06:27:10 -0000 @@ -75,16 +75,21 @@ CONFIGURE_ARGS += -DLUA_INCLUDE_DIR=${MO CONFIGURE_ARGS += -DRUBY_EXECUTABLE=${RUBY} .endif -# XXX Remove hackish patches -# Tcl/Tk +# TCL +.if ${MODULES:Mlang/tcl} CONFIGURE_ENV += MODTCL_VERSION=${MODTCL_VERSION} \ - MODTK_VERSION=${MODTK_VERSION} \ MODTCL_INCDIR=${MODTCL_INCDIR} \ - MODTK_INCDIR=${MODTK_INCDIR} \ MODTCL_LIBDIR=${MODTCL_LIBDIR} \ + MODTCL_LIB=${MODTCL_LIB} +.endif + +# TK +.if ${MODULES:Mx11/tk} +CONFIGURE_ENV += MODTK_VERSION=${MODTK_VERSION} \ + MODTK_INCDIR=${MODTK_INCDIR} \ MODTK_LIBDIR=${MODTK_LIBDIR} \ - MODTCL_LIB=${MODTCL_LIB} \ MODTK_LIB=${MODTK_LIB} +.endif MODCMAKE_DEBUG ?= No