Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/ceguilua/cmake/FindTCL.cmake @ 1875

Last change on this file since 1875 was 1776, checked in by landauf, 16 years ago

Many changes in almost all FindXYZ.cmake files. They now throw errors if something wasn't found.

  • Property svn:eol-style set to native
File size: 2.6 KB
Line 
1# - Find Tcl includes and libraries.
2# This module finds if TCL is installed and determines where the
3# include files and libraries are. It also determines what the name of
4# the library is. This code sets the following variables:
5#  TCL_LIBRARY        = path to Tcl library (tcl tcl80)
6#  TCL_LIBRARY_DEBUG  = path to Tcl library (debug)
7#  TCL_INCLUDE_PATH   = path to where tcl.h can be found
8#
9# Several changes and additions by Fabian 'x3n' Landau
10#                 > www.orxonox.net <
11
12IF (TCL_LIBRARY AND TCL_INCLUDE_PATH)
13  SET(TCL_FIND_QUIETLY TRUE)
14ENDIF (TCL_LIBRARY AND TCL_INCLUDE_PATH)
15
16SET (TCLTK_POSSIBLE_LIB_PATHS
17  "${TCL_TCLSH_PATH}/../lib"
18  "${TK_WISH_PATH}/../lib"
19  "${TCL_INCLUDE_PATH}/../lib"
20  "${TK_INCLUDE_PATH}/../lib"
21  "$ENV{ProgramFiles}/Tcl/Lib"
22  "C:/Program Files/Tcl/lib" 
23  "C:/Tcl/lib" 
24  [HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.5;Root]/lib
25  [HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.4;Root]/lib
26  /usr/lib 
27  /usr/local/lib
28  /usr/pack/tcltk-8.4.9.linux-mo/lib
29  ../libs/tcl8.5.2/win
30  ../libs/tcl8.5.2/unix
31  ../libs/tcl8.5.2/macosx
32)
33
34FIND_LIBRARY(TCL_LIBRARY
35  NAMES tcl tcl85 tcl8.5 tcl84 tcl8.4
36  PATHS ${TCLTK_POSSIBLE_LIB_PATHS}
37)
38
39FIND_LIBRARY(TCL_LIBRARY_DEBUG
40  NAMES tcld tcl85d tcl8.5d tcl84d tcl8.4d
41  PATHS ${TCLTK_POSSIBLE_LIB_PATHS}
42)
43
44SET (TCLTK_POSSIBLE_INCLUDE_PATHS
45  ${TCL_TCLSH_PATH}/../include
46  ${TK_WISH_PATH}/../include
47  "${TCL_LIBRARY_PATH}/../include"
48  "${TK_LIBRARY_PATH}/../include"
49  [HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.5;Root]/include
50  [HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.4;Root]/include
51  "$ENV{ProgramFiles}/Tcl/include"
52  "C:/Program Files/Tcl/include"
53  C:/Tcl/include
54  /usr/include
55  /usr/local/include
56  /usr/include/tcl8.5
57  /usr/include/tcl8.4
58  ../libs/tcl8.5.2/generic
59)
60
61FIND_PATH(TCL_INCLUDE_PATH tcl.h
62  ${TCL_FRAMEWORK_INCLUDES} ${TCLTK_POSSIBLE_INCLUDE_PATHS}
63)
64
65
66IF (TCL_LIBRARY AND TCL_INCLUDE_PATH)
67  IF (NOT TCL_FIND_QUIETLY)
68    MESSAGE(STATUS "Tcl was found")
69    IF (VERBOSE_FIND)
70      MESSAGE (STATUS "  include path: ${TCL_INCLUDE_PATH}")
71      MESSAGE (STATUS "  library path: ${TCL_LIBRARY}")
72      MESSAGE (STATUS "  libraries:    tcld tcl85d tcl8.5d tcl84d tcl8.4d")
73    ENDIF (VERBOSE_FIND)
74  ENDIF (NOT TCL_FIND_QUIETLY)
75ELSE (TCL_LIBRARY AND TCL_INCLUDE_PATH)
76  IF (NOT TCL_INCLUDE_PATH)
77    MESSAGE(SEND_ERROR "Tcl include path was not found.")
78  ENDIF (NOT TCL_INCLUDE_PATH)
79  IF (NOT TCL_LIBRARY )
80    MESSAGE(SEND_ERROR "Tcl library was not found.")
81  ENDIF (NOT TCL_LIBRARY )
82ENDIF (TCL_LIBRARY AND TCL_INCLUDE_PATH)
83
84IF(TCL_INCLUDE_PATH)
85  IF(TCL_LIBRARY)
86    SET(TCL_FOUND 1)
87  ENDIF(TCL_LIBRARY)
88ENDIF(TCL_INCLUDE_PATH)
Note: See TracBrowser for help on using the repository browser.