diff options
author | Christian Stenger <christian.stenger@qt.io> | 2022-02-21 11:10:54 +0100 |
---|---|---|
committer | Christian Stenger <christian.stenger@qt.io> | 2022-02-22 05:33:10 +0000 |
commit | eccbc0fbcc5d23c4a4d0d7961f28dfbcb497affa (patch) | |
tree | d7f3552dac780b274fcffde4dfb9f7516e51ff20 /tests | |
parent | e59b7612b171c6f0378f990b7235353b67b2ee7d (diff) | |
download | qt-creator-eccbc0fbcc5d23c4a4d0d7961f28dfbcb497affa.tar.gz |
Qbs: Factor out gtest dependency check
..to make it re-usable.
Change-Id: I7653ee7b3ced5fb9d2b7262aecdab12438628928
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/unit/unittest/unittest.qbs | 46 |
1 files changed, 2 insertions, 44 deletions
diff --git a/tests/unit/unittest/unittest.qbs b/tests/unit/unittest/unittest.qbs index 83c6260c5a..5401aa09e1 100644 --- a/tests/unit/unittest/unittest.qbs +++ b/tests/unit/unittest/unittest.qbs @@ -4,52 +4,10 @@ import qbs.FileInfo Project { name: "Unit test & helper products" - Product { - name: "qtc_gtest_gmock" - - Export { - property bool useExternalLibs: preferExternalLibs && externalLibsPresent - property bool useRepo: !useExternalLibs && hasRepo - property bool preferExternalLibs: true - property bool externalLibsPresent: preferExternalLibs && gtest.present && gmock.present - property string repoDir: FileInfo.joinPaths(path, "3rdparty", "googletest") - property string gtestDir: FileInfo.joinPaths(repoDir, "googletest") - property string gmockDir: FileInfo.joinPaths(repoDir, "googlemock") - property bool hasRepo: File.exists(gtestDir) - - Depends { name: "pkgconfig"; condition: preferExternalLibs; required: false } - Depends { name: "gtest"; condition: preferExternalLibs; required: false } - Depends { name: "gmock"; condition: preferExternalLibs; required: false } - - Depends { name: "cpp" } - Group { - name: "Files from repository" - condition: qtc_gtest_gmock.useRepo - cpp.includePaths: [ - qtc_gtest_gmock.gtestDir, - qtc_gtest_gmock.gmockDir, - FileInfo.joinPaths(qtc_gtest_gmock.gtestDir, "include"), - FileInfo.joinPaths(qtc_gtest_gmock.gmockDir, "include"), - ] - files: [ - FileInfo.joinPaths(qtc_gtest_gmock.gtestDir, "src", "gtest-all.cc"), - FileInfo.joinPaths(qtc_gtest_gmock.gmockDir, "src", "gmock-all.cc"), - ] - } - - Properties { - condition: useRepo - cpp.includePaths: [ - FileInfo.joinPaths(gtestDir, "include"), - FileInfo.joinPaths(gmockDir, "include"), - ] - } - } - } - QtcProduct { name: "Unit test" condition: qtc_gtest_gmock.hasRepo || qtc_gtest_gmock.externalLibsPresent + type: ["application", "autotest"] consoleApplication: true destinationDirectory: FileInfo.joinPaths(project.buildDirectory, @@ -72,7 +30,7 @@ Project { Depends { name: "pkgconfig"; required: false } Depends { name: "benchmark"; required: false } - Depends { name: "qtc_gtest_gmock" } + Depends { name: "qtc_gtest_gmock"; required: false } sqlite_sources.buildSharedLib: false |