summaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorCristian Adam <cristian.adam@qt.io>2020-11-10 20:30:29 +0100
committerCristian Adam <cristian.adam@qt.io>2021-04-27 17:23:07 +0200
commit5981d44aec5bc09e092310b93f15134ab165d4bd (patch)
tree215d18b87f88633acd5e0ddc0f6c3b91766f1e5e /util
parentfea8ed0dcbff5d6adefc4db43a2e4f8563d8553b (diff)
pro2cmake: Add support for standalone CMake test configuration
This patchset adds the bits needed for manual tests to work standalone. Amends ebaa1c15a101579d9296336491e36c63b979f18d Pick-to: 6.1 Task-number: QTCREATORBUG-25389 Change-Id: Ifc70391bda2a3eea3c7492a58353a703cdc3114c Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'util')
-rwxr-xr-xutil/cmake/pro2cmake.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py
index f17248bf01..65ceacd20c 100755
--- a/util/cmake/pro2cmake.py
+++ b/util/cmake/pro2cmake.py
@@ -3193,6 +3193,12 @@ def write_main_part(
# collect all testdata and insert globbing commands
has_test_data = False
if typename == "Test":
+ cm_fh.write(f"{spaces(indent)}if (NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT)\n")
+ cm_fh.write(f"{spaces(indent+1)}cmake_minimum_required(VERSION 3.16)\n")
+ cm_fh.write(f"{spaces(indent+1)}project({name} LANGUAGES C CXX ASM)\n")
+ cm_fh.write(f"{spaces(indent+1)}find_package(Qt6BuildInternals COMPONENTS STANDALONE_TEST)\n")
+ cm_fh.write(f"{spaces(indent)}endif()\n\n")
+
test_data = scope.expand("TESTDATA")
if test_data:
has_test_data = True