CMake/sql find modules: read foo_ROOT env var if available

Even though we set foo_ROOT in the provisioning scripts and CMake is
picking it up as the base dir, we should also use it as CMake variable
so we can look in other directories below foo_ROOT.

Change-Id: I193d8ff1c216a669162569d71891c3eb7b9b030f
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit c68277c41b99d6791e3c1a5998b70c6cbbf6dc15)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Christian Ehrlicher 2024-10-01 19:54:38 +02:00 committed by Qt Cherry-pick Bot
parent 85af817469
commit 5e8feb69df
3 changed files with 17 additions and 1 deletions

View File

@ -21,6 +21,12 @@
# ``Interbase::Interbase``
# The Interbase client library
if(NOT DEFINED Interbase_ROOT)
if(DEFINED ENV{Interbase_ROOT})
set(Interbase_ROOT "$ENV{Interbase_ROOT}")
endif()
endif()
find_path(Interbase_INCLUDE_DIR
NAMES ibase.h
HINTS "${Interbase_INCLUDEDIR}" "${Interbase_ROOT}/include"

View File

@ -40,7 +40,11 @@
# The mysql client library
if(NOT DEFINED MySQL_ROOT)
find_package(PkgConfig QUIET)
if(DEFINED ENV{MySQL_ROOT})
set(MySQL_ROOT "$ENV{MySQL_ROOT}")
else()
find_package(PkgConfig QUIET)
endif()
endif()
if(PkgConfig_FOUND AND NOT DEFINED MySQL_ROOT)
pkg_check_modules(PC_MySQL QUIET "mysqlclient")

View File

@ -21,6 +21,12 @@
# ``Oracle::Oracle``
# The oracle instant client library
if(NOT DEFINED Oracle_ROOT)
if(DEFINED ENV{Oracle_ROOT})
set(Oracle_ROOT "$ENV{Oracle_ROOT}")
endif()
endif()
find_path(Oracle_INCLUDE_DIR
NAMES oci.h
HINTS ${Oracle_INCLUDE_DIR} "${Oracle_ROOT}" "${Oracle_ROOT}/include" "${Oracle_ROOT}/sdk/include"