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
27 CABLE_EXECUTABLE_PATH)
29 IF(CABLE_LIBRARY_PATH)
30 FIND_LIBRARY(CABLE_TCL_LIBRARY NAMES CableTclFacility PATHS
32 ${CABLE_LIBRARY_PATH}/*)
33 ELSE(CABLE_LIBRARY_PATH)
34 FIND_LIBRARY(CABLE_TCL_LIBRARY NAMES CableTclFacility PATHS
35 ${CABLE_BINARY_DIR}/CableTclFacility
36 ${CABLE_BINARY_DIR}/CableTclFacility/*)
37 ENDIF(CABLE_LIBRARY_PATH)
39 IF(CABLE_EXECUTABLE_PATH)
40 FIND_PROGRAM(CABLE NAMES cable PATHS
41 ${CABLE_EXECUTABLE_PATH}
42 ${CABLE_EXECUTABLE_PATH}/*)
43 ELSE(CABLE_EXECUTABLE_PATH)
44 FIND_PROGRAM(CABLE NAMES cable PATHS
45 ${CABLE_BINARY_DIR}/Executables
46 ${CABLE_BINARY_DIR}/Executables/*)
47 ENDIF(CABLE_EXECUTABLE_PATH)
49 FIND_PATH(CABLE_INCLUDE_DIR CableTclFacility/ctCalls.h
52 # Find the cable executable in the path.
53 FIND_PROGRAM(CABLE NAMES cable)
55 # Get the path where the executable sits, but without the executable
57 GET_FILENAME_COMPONENT(CABLE_ROOT_BIN ${CABLE} PATH)
59 # Find the cable include directory in a path relative to the cable
61 FIND_PATH(CABLE_INCLUDE_DIR CableTclFacility/ctCalls.h
62 ${CABLE_ROOT_BIN}/../share/Cable/include)
64 # Find the WrapTclFacility library in a path relative to the cable
66 FIND_LIBRARY(CABLE_TCL_LIBRARY NAMES CableTclFacility PATHS
67 ${CABLE_ROOT_BIN}/../lib)
68 ENDIF(CABLE_BUILD_DIR)