Commit Graph

8 Commits

Author SHA1 Message Date
Johannes Kauffmann
029e118a4e CMake: Unify usage of pkg_check_modules
According to the CMake documentation, IMPORTED_TARGET should be
specified before the moduleSpec, and after QUIET.

Additionally, double-quote the moduleSpec everywhere, since before, it
was only quoted in some cases.

While this is not required for pkg_check_modules to work, it unifies the
coding style.

Pick-to: 6.5
Change-Id: Ic8ad708a8146f9b39ee40e9a719412441e231452
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2023-01-06 17:57:17 +01:00
Joerg Bornemann
84c76d6205 CMake: Make it possible to specify a debug MySQL client library
An MSVC debug-and-release build of Qt with the MySQL plugin requires
separate builds of the MySQL client library: a debug and a release
build. There was no way to specify the debug version of the library.

Now, it's possible to configure Qt like this:
cmake ... \
    -DMySQL_ROOT=D:\mysql-connector-c-6.1.11-winx64 \
    -DMySQL_LIBRARY_DIR=D:\mysql-connector-c-6.1.11-winx64\lib\vs14

This will automatically detect the include dir and the debug and release
library files. We expect that the debug build of the MySQL client
library resides in a "debug" subdirectory below MySQL_LIBRARY_DIR.

If the automatic detection doesn't work to due a different layout on the
build machine, one can set the variable MySQL_LIBRARY_DEBUG to specify
the debug variant of the MySQL client library.

[ChangeLog][CMake] If pkg-config is not used, a debug build of the MySQL
client library can be specified with
-DMySQL_LIBRARY_DEBUG=<path-to-library>. The debug and release variants
of the library are automatically detected. Setting MySQL_ROOT and
MySQL_LIBRARY_DIR is sufficient in most cases.

Pick-to: 6.2 6.4
Task-number: QTQAINFRA-4999
Change-Id: I663fb8ac1dbd07bc73484791be9cc21bff2f4a9b
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2022-12-01 08:53:19 +01:00
Lucie Gérard
32df595275 Change the license of all CMakeLists.txt and *.cmake files to BSD
Task-number: QTBUG-105718
Change-Id: I5d3ef70a31235868b9be6cb479b7621bf2a8ba39
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-08-23 23:58:42 +02:00
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
Alexey Edelev
e74fd6897b Adjust database packages FindFoo.cmake files to CMake convention
Replace package _LIBRARIES by _LIBRARY and _INCLUDE_DIRS by
_INCLUDE_DIR. Move find_package_handle_standard_args for Oracle and DB2,
since this call should set _FOUND variable but not separate condition.

Fixes: QTBUG-89866
Change-Id: I54be2c2c4d7ba4b849a27139702861ecd937c444
Reviewed-by: Craig Scott <craig.scott@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-01-19 13:17:55 +00:00
Li Xinwei
0c7042defa CMake: improve FindMySQL.cmake
On Windows, Qt should libmysql.lib instead of mysqlclient.lib.

Add support for mariadb.

Re-indent FindMySQL.cmake.

Fixes: QTBUG-88661
Fixes: QTBUG-89775
Pick-to: 6.0
Change-Id: I6bdf195b8976c59230a12af335a838af55df0caf
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-01-09 00:16:34 +08:00
Alexandru Croitor
375831a3dc CMake: Mark all find_package(PkgConfig) to be quiet
This reduces the amount of warning messages when the pkg-config
feature is disabled.

Task-number: QTBUG-85276
Change-Id: I11a6dfb6273a1e48c47d1ef5c1a5f70ba990fbc0
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-06-29 12:23:10 +02:00
Ville Voutilainen
3ff31ed020 Enable building of the mysql plugin
Change-Id: I8cb97afaaed46ee64b5a133e797179d7ddecdeef
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-09-02 15:16:42 +00:00