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 path to the cable executable
6 # CABLE_TCL_LIBRARY the path to the Tcl wrapper library
7 # CABLE_INCLUDE_DIR the path to the 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.
13 #=============================================================================
14 # Copyright 2001-2009 Kitware, Inc.
16 # Distributed under the OSI-approved BSD License (the "License");
17 # see accompanying file Copyright.txt for details.
19 # This software is distributed WITHOUT ANY WARRANTY; without even the
20 # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
21 # See the License for more information.
22 #=============================================================================
23 # (To distribute this file outside of CMake, substitute the full
24 # License text for the above reference.)
27 find_path(CABLE_BUILD_DIR cableVersion.h)
31 load_cache(${CABLE_BUILD_DIR}
35 EXECUTABLE_OUTPUT_PATH
40 CABLE_EXECUTABLE_PATH)
42 if(CABLE_LIBRARY_PATH)
43 find_library(CABLE_TCL_LIBRARY NAMES CableTclFacility PATHS
45 ${CABLE_LIBRARY_PATH}/*)
47 find_library(CABLE_TCL_LIBRARY NAMES CableTclFacility PATHS
48 ${CABLE_BINARY_DIR}/CableTclFacility
49 ${CABLE_BINARY_DIR}/CableTclFacility/*)
52 if(CABLE_EXECUTABLE_PATH)
53 find_program(CABLE NAMES cable PATHS
54 ${CABLE_EXECUTABLE_PATH}
55 ${CABLE_EXECUTABLE_PATH}/*)
57 find_program(CABLE NAMES cable PATHS
58 ${CABLE_BINARY_DIR}/Executables
59 ${CABLE_BINARY_DIR}/Executables/*)
62 find_path(CABLE_INCLUDE_DIR CableTclFacility/ctCalls.h
65 # Find the cable executable in the path.
66 find_program(CABLE NAMES cable)
68 # Get the path where the executable sits, but without the executable
70 get_filename_component(CABLE_ROOT_BIN ${CABLE} PATH)
72 # Find the cable include directory in a path relative to the cable
74 find_path(CABLE_INCLUDE_DIR CableTclFacility/ctCalls.h
75 ${CABLE_ROOT_BIN}/../include/Cable)
77 # Find the WrapTclFacility library in a path relative to the cable
79 find_library(CABLE_TCL_LIBRARY NAMES CableTclFacility PATHS
80 ${CABLE_ROOT_BIN}/../lib/Cable)