SQL/DB2: Add and document DB2_ROOT
Sync the cmake arguments to search for DB2 with the rest of the qsql find modules and provide a DB2_ROOT env or cmake var. Also allow the old variables as a fallback. Pick-to: 6.10 Change-Id: I587e519b5cf3513e9580f64f0fb9b46bf789da5c Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This commit is contained in:
parent
6489c41234
commit
4832f61212
@ -21,25 +21,31 @@
|
||||
# ``DB2::DB2``
|
||||
# The db2 client library
|
||||
|
||||
if(NOT DEFINED DB2_ROOT)
|
||||
if(DEFINED ENV{DB2_ROOT})
|
||||
set(DB2_ROOT "$ENV{DB2_ROOT}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (NOT DEFINED DB2_INCLUDE_DIR)
|
||||
find_path(DB2_INCLUDE_DIR
|
||||
NAMES sqlcli1.h
|
||||
HINTS ENV DB2_HOME
|
||||
HINTS "${DB2_ROOT}" ENV DB2_HOME
|
||||
PATH_SUFFIXES include)
|
||||
else()
|
||||
find_path(DB2_INCLUDE_DIR
|
||||
NAMES sqlcli1.h
|
||||
HINTS ${DB2_INCLUDE_DIR})
|
||||
HINTS "${DB2_INCLUDE_DIR}")
|
||||
endif()
|
||||
|
||||
if (NOT DEFINED DB2_LIBRARY_DIR)
|
||||
find_library(DB2_LIBRARY
|
||||
NAMES db2
|
||||
HINTS ENV DB2LIB)
|
||||
NAMES db2 db2cli64
|
||||
HINTS "${DB2_ROOT}" ENV DB2LIB)
|
||||
else()
|
||||
find_library(DB2_LIBRARY
|
||||
NAMES db2
|
||||
HINTS ${DB2_LIBRARY_DIR})
|
||||
HINTS "${DB2_LIBRARY_DIR}")
|
||||
endif()
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
|
@ -105,7 +105,7 @@ cmake --install .
|
||||
//! [18]
|
||||
mkdir build-sqldrivers
|
||||
cd build-sqldrivers
|
||||
qt-cmake -G Ninja <qt_source_directory>/qtbase/src/plugins/sqldrivers -DCMAKE_INSTALL_PREFIX=<qt_installation_path>/<platform> -DDB2_INCLUDE_DIR="/usr/local/db2/include" -DDB2_LIBRARY="/usr/local/db2/lib/libdb2.<so|dylib>"
|
||||
qt-cmake -G Ninja <qt_source_directory>/qtbase/src/plugins/sqldrivers -DCMAKE_INSTALL_PREFIX=<qt_installation_path>/<platform> -DDB2_ROOT="/usr/local/db2"
|
||||
cmake --build .
|
||||
cmake --install .
|
||||
//! [18]
|
||||
@ -114,7 +114,7 @@ cmake --install .
|
||||
//! [20]
|
||||
mkdir build-sqldrivers
|
||||
cd build-sqldrivers
|
||||
qt-cmake -G Ninja <qt_installation_path>\Src\qtbase\src\plugins\sqldrivers -DCMAKE_INSTALL_PREFIX=<qt_installation_path>\<platform> -DDB2_INCLUDE_DIR="C:\db2\include" -DDB2_LIBRARY="C:\db2\lib\db2.lib"
|
||||
qt-cmake -G Ninja <qt_installation_path>\Src\qtbase\src\plugins\sqldrivers -DCMAKE_INSTALL_PREFIX=<qt_installation_path>\<platform> -DDB2_ROOT="C:\db2"
|
||||
cmake --build .
|
||||
cmake --install .
|
||||
//! [20]
|
||||
|
Loading…
x
Reference in New Issue
Block a user