diff options
author | Alexey Edelev <alexey.edelev@qt.io> | 2023-01-18 22:06:08 +0100 |
---|---|---|
committer | Alexey Edelev <alexey.edelev@qt.io> | 2023-02-08 12:59:19 +0100 |
commit | 214c3a033a4e9191f0082bf6f88624d356a45384 (patch) | |
tree | 95f412ee2ab668e1b903ae1d002d32f3decd27ea /tests/auto/tools/qt_cmake_create/CMakeLists.txt | |
parent | 52150469a837a1eca7e31b8aaea077127db0432f (diff) |
Add simple project generation based on existing source files
Introduce the qt-cmake-create script. The script generates the simple
CMakeLists.txt based on the source files located in the current or
specified directory. The initial version can generate a CMake code for
the following file types:
- .c .cc .cpp .cxx .h .hh .hxx .hpp - generates the qt_add_executable
call with prerequisites.
- .qml .js .mjs - generates the qt_add_qml_module call with
prerequisites.
- .ui - adds the found ui files to the existing executable. Requires
C++ files be present in the directory too.
- .qrc - generates the qt_add_resources call and adds the resources
to the existing executable. Requires C++ files be present in the
directory too.
- .proto - generates qt_add_protobuf call with prerequisites.
The QtInitProject.cmake script contains the 'handle_type' function that
allows extending the script capabilities and establish simple relation
chains between the file types.
Note: The initial implementation doesn't deal with sub-directories, so
all files from sub-directories will be added to and handled in the
top-level CMakeLists.txt file. This can be extended by user request.
Task-number: QTBUG-104388
Change-Id: I5abd9e07da109e867ff95986572ed2bf02ef9d3d
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'tests/auto/tools/qt_cmake_create/CMakeLists.txt')
-rw-r--r-- | tests/auto/tools/qt_cmake_create/CMakeLists.txt | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/auto/tools/qt_cmake_create/CMakeLists.txt b/tests/auto/tools/qt_cmake_create/CMakeLists.txt new file mode 100644 index 0000000000..6611471388 --- /dev/null +++ b/tests/auto/tools/qt_cmake_create/CMakeLists.txt @@ -0,0 +1,14 @@ +# Copyright (C) 2023 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + +# Collect test data +file(GLOB_RECURSE test_data_glob + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + testdata/*) +list(APPEND test_data ${test_data_glob}) + +qt_internal_add_test(tst_qt_cmake_create + SOURCES + tst_qt_cmake_create.cpp + TESTDATA ${test_data} +) |