2 # This module finds if CABLE is installed and determines where the
3 # include files and libraries are. This code sets the following variables:
5 # CABLE = the full path to the cable executable
6 # CABLE_TCL_LIBRARY = the full path to the Tcl wrapper facility library
7 # CABLE_INCLUDE_DIR = the full path to the cable include directory
9 # To build Tcl wrappers, you should add shared library and link it to
10 # ${CABLE_TCL_LIBRARY}. You should also add ${CABLE_INCLUDE_DIR} as
11 # an include directory.
15 FIND_PATH(CABLE_BUILD_DIR cableVersion.h)
19 LOAD_CACHE(${CABLE_BUILD_DIR}
23 EXECUTABLE_OUTPUT_PATH
28 CABLE_EXECUTABLE_PATH)
30 IF(CABLE_LIBRARY_PATH)
31 FIND_LIBRARY(CABLE_TCL_LIBRARY NAMES CableTclFacility PATHS
33 ${CABLE_LIBRARY_PATH}/*)
34 ELSE(CABLE_LIBRARY_PATH)
35 FIND_LIBRARY(CABLE_TCL_LIBRARY NAMES CableTclFacility PATHS
36 ${CABLE_BINARY_DIR}/CableTclFacility
37 ${CABLE_BINARY_DIR}/CableTclFacility/*)
38 ENDIF(CABLE_LIBRARY_PATH)
40 IF(CABLE_EXECUTABLE_PATH)
41 FIND_PROGRAM(CABLE NAMES cable PATHS
42 ${CABLE_EXECUTABLE_PATH}
43 ${CABLE_EXECUTABLE_PATH}/*)
44 ELSE(CABLE_EXECUTABLE_PATH)
45 FIND_PROGRAM(CABLE NAMES cable PATHS
46 ${CABLE_BINARY_DIR}/Executables
47 ${CABLE_BINARY_DIR}/Executables/*)
48 ENDIF(CABLE_EXECUTABLE_PATH)
50 FIND_PATH(CABLE_INCLUDE_DIR CableTclFacility/ctCalls.h
53 # Find the cable executable in the path.
54 FIND_PROGRAM(CABLE NAMES cable)
56 # Get the path where the executable sits, but without the executable
58 GET_FILENAME_COMPONENT(CABLE_ROOT_BIN ${CABLE} PATH)
60 # Find the cable include directory in a path relative to the cable
62 FIND_PATH(CABLE_INCLUDE_DIR CableTclFacility/ctCalls.h
63 ${CABLE_ROOT_BIN}/../include/Cable)
65 # Find the WrapTclFacility library in a path relative to the cable
67 FIND_LIBRARY(CABLE_TCL_LIBRARY NAMES CableTclFacility PATHS
68 ${CABLE_ROOT_BIN}/../lib/Cable)
69 ENDIF(CABLE_BUILD_DIR)