2019-09-05 07:07:24 +00:00
|
|
|
#.rst:
|
|
|
|
# FindOracle
|
|
|
|
# ---------
|
|
|
|
#
|
|
|
|
# Try to locate the oracle client library.
|
|
|
|
# If found, this will define the following variables:
|
|
|
|
#
|
|
|
|
# ``Oracle_FOUND``
|
|
|
|
# True if the oracle library is available
|
|
|
|
# ``Oracle_INCLUDE_DIRS``
|
|
|
|
# The oracle include directories
|
|
|
|
# ``Oracle_LIBRARIES``
|
|
|
|
# The oracle libraries for linking
|
|
|
|
#
|
|
|
|
# If ``Oracle_FOUND`` is TRUE, it will also define the following
|
|
|
|
# imported target:
|
|
|
|
#
|
|
|
|
# ``Oracle::Oracle``
|
|
|
|
# The oracle instant client library
|
|
|
|
|
2021-01-07 10:05:07 +00:00
|
|
|
find_path(Oracle_INCLUDE_DIR
|
2019-09-05 07:07:24 +00:00
|
|
|
NAMES oci.h
|
|
|
|
HINTS ${Oracle_INCLUDE_DIR})
|
|
|
|
|
2021-01-06 13:50:03 +00:00
|
|
|
set(ORACLE_OCI_NAMES clntsh ociei oraociei12 oci)
|
2019-09-05 07:07:24 +00:00
|
|
|
|
2021-01-07 10:05:07 +00:00
|
|
|
find_library(Oracle_LIBRARY
|
|
|
|
NAMES ${ORACLE_OCI_NAMES}
|
2019-09-05 07:07:24 +00:00
|
|
|
HINTS ${Oracle_LIBRARY_DIR})
|
|
|
|
|
2021-01-07 10:05:07 +00:00
|
|
|
include(FindPackageHandleStandardArgs)
|
|
|
|
find_package_handle_standard_args(Oracle DEFAULT_MSG Oracle_LIBRARY Oracle_INCLUDE_DIR)
|
|
|
|
|
|
|
|
if(Oracle_FOUND)
|
|
|
|
set(Oracle_INCLUDE_DIRS "${Oracle_INCLUDE_DIR}")
|
|
|
|
set(Oracle_LIBRARIES "${Oracle_LIBRARY}")
|
|
|
|
if(NOT TARGET Oracle::OCI)
|
|
|
|
add_library(Oracle::OCI UNKNOWN IMPORTED)
|
|
|
|
set_target_properties(Oracle::OCI PROPERTIES
|
2019-09-05 07:07:24 +00:00
|
|
|
IMPORTED_LOCATION "${Oracle_LIBRARIES}"
|
|
|
|
INTERFACE_INCLUDE_DIRECTORIES "${Oracle_INCLUDE_DIRS}")
|
2021-01-07 10:05:07 +00:00
|
|
|
endif()
|
2019-09-05 07:07:24 +00:00
|
|
|
endif()
|
|
|
|
|
2021-01-07 10:05:07 +00:00
|
|
|
mark_as_advanced(Oracle_INCLUDE_DIR Oracle_LIBRARY)
|
2019-09-05 07:07:24 +00:00
|
|
|
|
|
|
|
include(FeatureSummary)
|
|
|
|
set_package_properties(Oracle PROPERTIES
|
|
|
|
URL "https://www.oracle.com"
|
|
|
|
DESCRIPTION "Oracle client library")
|