FindOracle.cmake 1003 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
find_package(Libaio)
18

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

24
mark_as_advanced(ORACLE_FOUND ORACLE_INCLUDE_DIR ORACLE_LIBRARY SQLPLUS_EXECUTABLE)
25
26
27

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

set(ORACLE_LIBRARIES ${ORACLE_LIBRARY})