qt5base-lts/cmake/FindOracle.cmake
Lucie Gérard fb1b20eab3 Add license headers to cmake files
CMakeLists.txt and .cmake files of significant size
(more than 2 lines according to our check in tst_license.pl)
now have the copyright and license header.

Existing copyright statements remain intact

Task-number: QTBUG-88621
Change-Id: I3b98cdc55ead806ec81ce09af9271f9b95af97fa
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-08-03 17:14:55 +02:00

54 lines
1.5 KiB
CMake

# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#.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
find_path(Oracle_INCLUDE_DIR
NAMES oci.h
HINTS ${Oracle_INCLUDE_DIR})
set(ORACLE_OCI_NAMES clntsh ociei oraociei12 oci)
find_library(Oracle_LIBRARY
NAMES ${ORACLE_OCI_NAMES}
HINTS ${Oracle_LIBRARY_DIR})
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
IMPORTED_LOCATION "${Oracle_LIBRARIES}"
INTERFACE_INCLUDE_DIRECTORIES "${Oracle_INCLUDE_DIRS}")
endif()
endif()
mark_as_advanced(Oracle_INCLUDE_DIR Oracle_LIBRARY)
include(FeatureSummary)
set_package_properties(Oracle PROPERTIES
URL "https://www.oracle.com"
DESCRIPTION "Oracle client library")