From 1d0569e79d4f33b2f73c217f0c26f024efad4213 Mon Sep 17 00:00:00 2001 From: Brad King Date: Fri, 20 Dec 2002 09:42:19 -0500 Subject: [PATCH] ENH: Use the Mac -framework for Tcl if it is available. --- Modules/FindTCL.cmake | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/Modules/FindTCL.cmake b/Modules/FindTCL.cmake index e6c747e40..3021b62d3 100644 --- a/Modules/FindTCL.cmake +++ b/Modules/FindTCL.cmake @@ -79,6 +79,12 @@ FIND_LIBRARY(TK_STUB_LIBRARY_DEBUG ) SET (TCLTK_POSSIBLE_INCLUDE_PATHS + ~/Library/Frameworks/Tcl.framework/Headers + ~/Library/Frameworks/Tk.framework/Headers + ~/Library/Frameworks/Tk.framework/PrivateHeaders + /Library/Frameworks/Tcl.framework/Headers + /Library/Frameworks/Tk.framework/Headers + /Library/Frameworks/Tk.framework/PrivateHeaders "${TCL_TCLSH_PATH}/../include" "${TK_WISH_PATH}/../include" /usr/include @@ -121,6 +127,34 @@ IF (WIN32) ) ENDIF(WIN32) +IF(APPLE) + IF(EXISTS ~/Library/Frameworks/Tcl.framework) + SET(TCL_HAVE_FRAMEWORK 1) + ENDIF(EXISTS ~/Library/Frameworks/Tcl.framework) + IF(EXISTS /Library/Frameworks/Tcl.framework) + SET(TCL_HAVE_FRAMEWORK 1) + ENDIF(EXISTS /Library/Frameworks/Tcl.framework) + IF(EXISTS ~/Library/Frameworks/Tk.framework) + SET(TCL_TK_HAVE_FRAMEWORK 1) + ENDIF(EXISTS ~/Library/Frameworks/Tk.framework) + IF(EXISTS /Library/Frameworks/Tk.framework) + SET(TCL_TK_HAVE_FRAMEWORK 1) + ENDIF(EXISTS /Library/Frameworks/Tk.framework) + IF("${TCL_INCLUDE_PATH}" MATCHES "Tcl\\.framework") + SET(TCL_LIBRARY "") + ENDIF("${TCL_INCLUDE_PATH}" MATCHES "Tcl\\.framework") + IF(TCL_HAVE_FRAMEWORK) + IF(NOT TCL_LIBRARY) + SET (TCL_LIBRARY "-framework Tcl" CACHE FILEPATH "Tcl Framework" FORCE) + ENDIF(NOT TCL_LIBRARY) + ENDIF(TCL_HAVE_FRAMEWORK) + IF(TCL_TK_HAVE_FRAMEWORK) + IF(NOT TK_LIBRARY) + SET (TK_LIBRARY "-framework Tk" CACHE FILEPATH "Tk Framework" FORCE) + ENDIF(NOT TK_LIBRARY) + ENDIF(TCL_TK_HAVE_FRAMEWORK) +ENDIF(APPLE) + MARK_AS_ADVANCED( TCL_STUB_LIBRARY TCL_STUB_LIBRARY_DEBUG