FindOracle.cmake 1.1 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# - 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)
#  ORACLE_EXECUTABLE
#  ORACLE_BINARY_PATH (not cached)

find_path(ORACLE_INCLUDE_DIR oci.h)
find_library(ORACLE_LIBRARY NAMES clntsh oci)
find_program(ORACLE_EXECUTABLE NAMES sqlplus)

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

mark_as_advanced(ORACLE_FOUND ORACLE_INCLUDE_DIR ORACLE_LIBRARY ORACLE_EXECUTABLE)

set(ORACLE_INCLUDE_DIRS ${ORACLE_INCLUDE_DIR})
get_filename_component(ORACLE_LIBRARY_DIRS ${ORACLE_LIBRARY} PATH)
get_filename_component(ORACLE_BINARY_PATH ${ORACLE_EXECUTABLE} PATH)

set(ORACLE_LIBRARIES ${ORACLE_LIBRARY})

# Oracle-specific environment variables (as in LCGCMT)
set(ORACLE_ENVIRONMENT SET NLS_LANG american_america.WE8ISO8859P1
                       SET ORA_FPU_PRECISION EXTENDED)