FindOracle.cmake 982 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
# - Locate Oracle library
# Defines:
#
#  ORACLE_FOUND
#  ORACLE_INCLUDE_DIR
#  ORACLE_INCLUDE_DIRS (not cached)
#  ORACLE_LIBRARY
#  ORACLE_LIBRARIES (not cached)
#  ORACLE_LIBRARY_DIRS (not cached)
10
#  SQLPLUS_EXECUTABLE
11
12
13
14
#  ORACLE_BINARY_PATH (not cached)

find_path(ORACLE_INCLUDE_DIR oci.h)
find_library(ORACLE_LIBRARY NAMES clntsh oci)
15
16
find_program(SQLPLUS_EXECUTABLE NAMES sqlplus
             HINTS ${ORACLE_INCLUDE_DIR}/../bin)
17

18
19
# handle the QUIETLY and REQUIRED arguments and set ORACLE_FOUND to TRUE if
# all listed variables are TRUE
20
INCLUDE(FindPackageHandleStandardArgs)
21
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Oracle DEFAULT_MSG ORACLE_INCLUDE_DIR ORACLE_LIBRARY)
22

23
mark_as_advanced(ORACLE_FOUND ORACLE_INCLUDE_DIR ORACLE_LIBRARY SQLPLUS_EXECUTABLE)
24
25
26

set(ORACLE_INCLUDE_DIRS ${ORACLE_INCLUDE_DIR})
get_filename_component(ORACLE_LIBRARY_DIRS ${ORACLE_LIBRARY} PATH)
27
get_filename_component(ORACLE_BINARY_PATH ${SQLPLUS_EXECUTABLE} PATH)
28
29

set(ORACLE_LIBRARIES ${ORACLE_LIBRARY})