openbsd-ports/devel/cmake/patches/patch-Modules_FindTCL_cmake
dcoppa 498b61a3b2 Update to cmake-2.8.8
OK sthen@
2012-05-07 07:06:20 +00:00

238 lines
6.4 KiB
Plaintext

$OpenBSD: patch-Modules_FindTCL_cmake,v 1.3 2012/05/07 07:06:20 dcoppa Exp $
--- Modules/FindTCL.cmake.orig Mon Apr 30 11:24:38 2012
+++ Modules/FindTCL.cmake Mon Apr 30 11:35:24 2012
@@ -48,19 +48,36 @@ INCLUDE(CMakeFindFrameworks)
INCLUDE(FindTclsh)
INCLUDE(FindWish)
-IF(TCLSH_VERSION_STRING)
- SET(TCL_TCLSH_VERSION "${TCLSH_VERSION_STRING}")
-ELSE(TCLSH_VERSION_STRING)
- 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}")
-ENDIF(TCLSH_VERSION_STRING)
+SET(MODTCL_VERSION $ENV{MODTCL_VERSION})
+SET(MODTK_VERSION $ENV{MODTK_VERSION})
+SET(MODTCL_INCDIR $ENV{MODTCL_INCDIR})
+SET(MODTK_INCDIR $ENV{MODTK_INCDIR})
+SET(MODTCL_LIB $ENV{MODTCL_LIB})
+SET(MODTK_LIB $ENV{MODTK_LIB})
+SET(MODTCL_LIBDIR $ENV{MODTCL_LIBDIR})
+SET(MODTK_LIBDIR $ENV{MODTK_LIBDIR})
+IF(MODTCL_VERSION)
+ SET(TCL_TCLSH_VERSION "${MODTCL_VERSION}")
+ELSE(MODTCL_VERSION)
+ IF(TCLSH_VERSION_STRING)
+ SET(TCL_TCLSH_VERSION "${TCLSH_VERSION_STRING}")
+ ELSE(TCLSH_VERSION_STRING)
+ 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}")
+ ENDIF(TCLSH_VERSION_STRING)
+ENDIF(MODTCL_VERSION)
+
GET_FILENAME_COMPONENT(TK_WISH_PATH "${TK_WISH}" PATH)
GET_FILENAME_COMPONENT(TK_WISH_PATH_PARENT "${TK_WISH_PATH}" PATH)
-STRING(REGEX REPLACE
- "^.*wish([0-9]\\.*[0-9]).*$" "\\1" TK_WISH_VERSION "${TK_WISH}")
+IF(MODTK_VERSION)
+ SET(TK_WISH_VERSION "${MODTK_VERSION}")
+ELSE(MODTK_VERSION)
+ STRING(REGEX REPLACE
+ "^.*wish([0-9]\\.*[0-9]).*$" "\\1" TK_WISH_VERSION "${TK_WISH}")
+ENDIF(MODTK_VERSION)
GET_FILENAME_COMPONENT(TCL_INCLUDE_PATH_PARENT "${TCL_INCLUDE_PATH}" PATH)
GET_FILENAME_COMPONENT(TK_INCLUDE_PATH_PARENT "${TK_INCLUDE_PATH}" PATH)
@@ -75,17 +92,37 @@ GET_FILENAME_COMPONENT(TK_LIBRARY_PATH_PARENT "${TK_LI
STRING(REGEX REPLACE
"^.*tk([0-9]\\.*[0-9]).*$" "\\1" TK_LIBRARY_VERSION "${TK_LIBRARY}")
-SET(TCLTK_POSSIBLE_LIB_PATHS
- "${TCL_INCLUDE_PATH_PARENT}/lib"
- "${TK_INCLUDE_PATH_PARENT}/lib"
- "${TCL_LIBRARY_PATH}"
- "${TK_LIBRARY_PATH}"
- "${TCL_TCLSH_PATH_PARENT}/lib"
- "${TK_WISH_PATH_PARENT}/lib"
- /usr/lib
- /usr/local/lib
- )
+IF(MODTCL_LIBDIR)
+ SET(TCLTK_OPENBSD_LIB_PATHS
+ "${TCLTK_OPENBSD_LIB_PATHS}"
+ "${MODTCL_LIBDIR}"
+ )
+ENDIF(MODTCL_LIBDIR)
+IF(MODTK_LIBDIR)
+ SET(TCLTK_OPENBSD_LIB_PATHS
+ "${TCLTK_OPENBSD_LIB_PATHS}"
+ "${MODTK_LIBDIR}"
+ )
+ENDIF(MODTK_LIBDIR)
+
+IF(TCLTK_OPENBSD_LIB_PATHS)
+ SET(TCLTK_POSSIBLE_LIB_PATHS
+ "${TCLTK_OPENBSD_LIB_PATHS}"
+ )
+ELSE(TCLTK_OPENBSD_LIB_PATHS)
+ SET(TCLTK_POSSIBLE_LIB_PATHS
+ "${TCL_INCLUDE_PATH_PARENT}/lib"
+ "${TK_INCLUDE_PATH_PARENT}/lib"
+ "${TCL_LIBRARY_PATH}"
+ "${TK_LIBRARY_PATH}"
+ "${TCL_TCLSH_PATH_PARENT}/lib"
+ "${TK_WISH_PATH_PARENT}/lib"
+ /usr/lib
+ /usr/local/lib
+ )
+ENDIF(TCLTK_OPENBSD_LIB_PATHS)
+
IF(WIN32)
GET_FILENAME_COMPONENT(
ActiveTcl_CurrentVersion
@@ -105,31 +142,47 @@ IF(WIN32)
)
ENDIF(WIN32)
-FIND_LIBRARY(TCL_LIBRARY
- NAMES
- tcl
- tcl${TCL_LIBRARY_VERSION} tcl${TCL_TCLSH_VERSION} tcl${TK_WISH_VERSION}
- tcl86 tcl8.6
- tcl85 tcl8.5
- tcl84 tcl8.4
- tcl83 tcl8.3
- tcl82 tcl8.2
- tcl80 tcl8.0
- PATHS ${TCLTK_POSSIBLE_LIB_PATHS}
- )
+IF(MODTCL_LIB)
+ FIND_LIBRARY(TCL_LIBRARY
+ NAMES
+ ${MODTCL_LIB}
+ PATHS ${TCLTK_POSSIBLE_LIB_PATHS}
+ )
+ELSE(MODTCL_LIB)
+ FIND_LIBRARY(TCL_LIBRARY
+ NAMES
+ tcl
+ tcl${TCL_LIBRARY_VERSION} tcl${TCL_TCLSH_VERSION} tcl${TK_WISH_VERSION}
+ tcl86 tcl8.6
+ tcl85 tcl8.5
+ tcl84 tcl8.4
+ tcl83 tcl8.3
+ tcl82 tcl8.2
+ tcl80 tcl8.0
+ PATHS ${TCLTK_POSSIBLE_LIB_PATHS}
+ )
+ENDIF(MODTCL_LIB)
-FIND_LIBRARY(TK_LIBRARY
- NAMES
- tk
- tk${TK_LIBRARY_VERSION} tk${TCL_TCLSH_VERSION} tk${TK_WISH_VERSION}
- tk86 tk8.6
- tk85 tk8.5
- tk84 tk8.4
- tk83 tk8.3
- tk82 tk8.2
- tk80 tk8.0
- PATHS ${TCLTK_POSSIBLE_LIB_PATHS}
- )
+IF(MODTK_LIB)
+ FIND_LIBRARY(TK_LIBRARY
+ NAMES
+ ${MODTK_LIB}
+ PATHS ${TCLTK_POSSIBLE_LIB_PATHS}
+ )
+ELSE(MODTK_LIB)
+ FIND_LIBRARY(TK_LIBRARY
+ NAMES
+ tk
+ tk${TK_LIBRARY_VERSION} tk${TCL_TCLSH_VERSION} tk${TK_WISH_VERSION}
+ tk86 tk8.6
+ tk85 tk8.5
+ tk84 tk8.4
+ tk83 tk8.3
+ tk82 tk8.2
+ tk80 tk8.0
+ PATHS ${TCLTK_POSSIBLE_LIB_PATHS}
+ )
+ENDIF(MODTK_LIB)
CMAKE_FIND_FRAMEWORKS(Tcl)
CMAKE_FIND_FRAMEWORKS(Tk)
@@ -153,26 +206,46 @@ IF(Tk_FRAMEWORKS)
ENDIF(NOT TK_INCLUDE_PATH)
ENDIF(Tk_FRAMEWORKS)
-SET(TCLTK_POSSIBLE_INCLUDE_PATHS
- "${TCL_LIBRARY_PATH_PARENT}/include"
- "${TK_LIBRARY_PATH_PARENT}/include"
- "${TCL_INCLUDE_PATH}"
- "${TK_INCLUDE_PATH}"
- ${TCL_FRAMEWORK_INCLUDES}
- ${TK_FRAMEWORK_INCLUDES}
- "${TCL_TCLSH_PATH_PARENT}/include"
- "${TK_WISH_PATH_PARENT}/include"
- /usr/include
- /usr/local/include
- /usr/include/tcl${TK_LIBRARY_VERSION}
- /usr/include/tcl${TCL_LIBRARY_VERSION}
- /usr/include/tcl8.6
- /usr/include/tcl8.5
- /usr/include/tcl8.4
- /usr/include/tcl8.3
- /usr/include/tcl8.2
- /usr/include/tcl8.0
- )
+IF(MODTCL_INCDIR)
+ SET(TCLTK_OPENBSD_INCLUDE_PATHS
+ "${TCLTK_OPENBSD_INCLUDE_PATHS}"
+ "${MODTCL_INCDIR}"
+ )
+ENDIF(MODTCL_INCDIR)
+
+IF(MODTK_INCDIR)
+ SET(TCLTK_OPENBSD_INCLUDE_PATHS
+ "${TCLTK_OPENBSD_INCLUDE_PATHS}"
+ "${MODTK_INCDIR}"
+ )
+ENDIF(MODTK_INCDIR)
+
+IF(TCLTK_OPENBSD_INCLUDE_PATHS)
+ SET(TCLTK_POSSIBLE_INCLUDE_PATHS
+ "${TCLTK_OPENBSD_INCLUDE_PATHS}"
+ )
+ELSE(TCLTK_OPENBSD_INCLUDE_PATHS)
+ SET(TCLTK_POSSIBLE_INCLUDE_PATHS
+ "${TCL_LIBRARY_PATH_PARENT}/include"
+ "${TK_LIBRARY_PATH_PARENT}/include"
+ "${TCL_INCLUDE_PATH}"
+ "${TK_INCLUDE_PATH}"
+ ${TCL_FRAMEWORK_INCLUDES}
+ ${TK_FRAMEWORK_INCLUDES}
+ "${TCL_TCLSH_PATH_PARENT}/include"
+ "${TK_WISH_PATH_PARENT}/include"
+ /usr/include
+ /usr/local/include
+ /usr/include/tcl${TK_LIBRARY_VERSION}
+ /usr/include/tcl${TCL_LIBRARY_VERSION}
+ /usr/include/tcl8.6
+ /usr/include/tcl8.5
+ /usr/include/tcl8.4
+ /usr/include/tcl8.3
+ /usr/include/tcl8.2
+ /usr/include/tcl8.0
+ )
+ENDIF(TCLTK_OPENBSD_INCLUDE_PATHS)
IF(WIN32)
SET(TCLTK_POSSIBLE_INCLUDE_PATHS ${TCLTK_POSSIBLE_INCLUDE_PATHS}