FindTCL.cmake 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. #
  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. #
  6. # TCL_LIBRARY = full path to the Tcl library (tcl tcl80 etc)
  7. # TCL_LIBRARY_DEBUG = full path to the Tcl library (debug)
  8. # TCL_STUB_LIBRARY = full path to the Tcl stub library
  9. # TCL_STUB_LIBRARY_DEBUG = full path to the Tcl stub library (debug)
  10. # TCL_INCLUDE_PATH = path to where tcl.h can be found
  11. # TCL_TCLSH = full path to the tclsh binary (tcl tcl80 etc)
  12. # TK_LIBRARY = full path to the Tk library (tk tk80 etc)
  13. # TK_LIBRARY_DEBUG = full path to the Tk library (debug)
  14. # TK_STUB_LIBRARY = full path to the Tk stub library
  15. # TK_STUB_LIBRARY_DEBUG = full path to the Tk stub library (debug)
  16. # TK_INCLUDE_PATH = path to where tk.h can be found
  17. # TK_INTERNAL_PATH = path to where tkWinInt.h can be found
  18. # TK_WISH = full path to the wish binary (wish wish80 etc)
  19. #
  20. INCLUDE(${CMAKE_ROOT}/Modules/FindTclsh.cmake)
  21. INCLUDE(${CMAKE_ROOT}/Modules/FindWish.cmake)
  22. GET_FILENAME_COMPONENT(TCL_TCLSH_PATH ${TCL_TCLSH} PATH)
  23. GET_FILENAME_COMPONENT(TK_WISH_PATH ${TK_WISH} PATH)
  24. SET (TCLTK_POSSIBLE_LIB_PATHS
  25. "${TCL_TCLSH_PATH}/../lib"
  26. "${TK_WISH_PATH}/../lib"
  27. /usr/lib
  28. /usr/local/lib
  29. "C:/Program Files/Tcl/lib"
  30. "C:/Tcl/lib"
  31. [HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.4;Root]/lib
  32. [HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.3;Root]/lib
  33. [HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.2;Root]/lib
  34. [HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.0;Root]/lib
  35. )
  36. FIND_LIBRARY(TCL_LIBRARY
  37. NAMES tcl tcl84 tcl8.4 tcl83 tcl8.3 tcl82 tcl8.2 tcl80 tcl8.0
  38. PATHS ${TCLTK_POSSIBLE_LIB_PATHS}
  39. )
  40. FIND_LIBRARY(TCL_LIBRARY_DEBUG
  41. NAMES tcld tcl84d tcl8.4d tcl83d tcl8.3d tcl82d tcl8.2d tcl80d tcl8.0d
  42. PATHS ${TCLTK_POSSIBLE_LIB_PATHS}
  43. )
  44. FIND_LIBRARY(TCL_STUB_LIBRARY
  45. NAMES tclstub tclstub84 tclstub8.4 tclstub83 tclstub8.3 tclstub82 tclstub8.2 tclstub80 tclstub8.0
  46. PATHS ${TCLTK_POSSIBLE_LIB_PATHS}
  47. )
  48. FIND_LIBRARY(TCL_STUB_LIBRARY_DEBUG
  49. NAMES tclstubd tclstub84d tclstub8.4d tclstub83d tclstub8.3d tclstub82d tclstub8.2d tclstub80d tclstub8.0d
  50. PATHS ${TCLTK_POSSIBLE_LIB_PATHS}
  51. )
  52. FIND_LIBRARY(TK_LIBRARY
  53. NAMES tk tk84 tk8.4 tk83 tk8.3 tk82 tk8.2 tk80 tk8.0
  54. PATHS ${TCLTK_POSSIBLE_LIB_PATHS}
  55. )
  56. FIND_LIBRARY(TK_LIBRARY_DEBUG
  57. NAMES tkd tk84d tk8.4d tk83d tk8.3d tk82d tk8.2d tk80d tk8.0d
  58. PATHS ${TCLTK_POSSIBLE_LIB_PATHS}
  59. )
  60. FIND_LIBRARY(TK_STUB_LIBRARY
  61. NAMES tkstub tkstub84 tkstub8.4 tkstub83 tkstub8.3 tkstub82 tkstub8.2 tkstub80 tkstub8.0
  62. PATHS ${TCLTK_POSSIBLE_LIB_PATHS}
  63. )
  64. FIND_LIBRARY(TK_STUB_LIBRARY_DEBUG
  65. NAMES tkstubd tkstub84d tkstub8.4d tkstub83d tkstub8.3d tkstub82d tkstub8.2d tkstub80d tkstub8.0d
  66. PATHS ${TCLTK_POSSIBLE_LIB_PATHS}
  67. )
  68. SET (TCLTK_POSSIBLE_INCLUDE_PATHS
  69. "${TCL_TCLSH_PATH}/../include"
  70. "${TK_WISH_PATH}/../include"
  71. /usr/include
  72. /usr/local/include
  73. /usr/include/tcl8.4
  74. /usr/include/tcl8.3
  75. /usr/include/tcl8.2
  76. /usr/include/tcl8.0
  77. "C:/Program Files/Tcl/include"
  78. "C:/Tcl/include"
  79. [HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.4;Root]/include
  80. [HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.3;Root]/include
  81. [HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.2;Root]/include
  82. [HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.0;Root]/include
  83. )
  84. FIND_PATH(TCL_INCLUDE_PATH tcl.h
  85. ${TCLTK_POSSIBLE_INCLUDE_PATHS}
  86. )
  87. FIND_PATH(TK_INCLUDE_PATH tk.h
  88. ${TCLTK_POSSIBLE_INCLUDE_PATHS}
  89. )
  90. IF (WIN32)
  91. FIND_PATH(TK_INTERNAL_PATH tkWinInt.h
  92. ${TCLTK_POSSIBLE_INCLUDE_PATHS}
  93. )
  94. MARK_AS_ADVANCED(TK_INTERNAL_PATH)
  95. MARK_AS_ADVANCED(
  96. TCL_TCLSH_PATH
  97. TK_WISH_PATH
  98. TCL_INCLUDE_PATH
  99. TK_INCLUDE_PATH
  100. TCL_LIBRARY
  101. TCL_LIBRARY_DEBUG
  102. TK_LIBRARY
  103. TK_LIBRARY_DEBUG
  104. )
  105. ENDIF(WIN32)
  106. MARK_AS_ADVANCED(
  107. TCL_STUB_LIBRARY
  108. TCL_STUB_LIBRARY_DEBUG
  109. TK_STUB_LIBRARY
  110. TK_STUB_LIBRARY_DEBUG
  111. )