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.

Pick-to: 6.8
Change-Id: I193d8ff1c216a669162569d71891c3eb7b9b030f
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
This commit is contained in:
Christian Ehrlicher 2024-10-01 19:54:38 +02:00
parent d399bdddc6
commit c68277c41b
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"