diff options
author | Sebastian Holtermann <sebholt@xwmw.org> | 2019-04-12 11:01:09 (GMT) |
---|---|---|
committer | Sebastian Holtermann <sebholt@xwmw.org> | 2019-04-15 14:07:14 (GMT) |
commit | 58f04b6ecf853e4ee5cce2bfb258fa7d4cc75b79 (patch) | |
tree | a077c43e29f0e419e52c47c756b4bb1b9e4be3ec /Tests/QtAutogen/ManySources/CMakeLists.txt | |
parent | a3f062091f488237c0151f3f4753e0668f37c60d (diff) | |
download | CMake-58f04b6ecf853e4ee5cce2bfb258fa7d4cc75b79.zip CMake-58f04b6ecf853e4ee5cce2bfb258fa7d4cc75b79.tar.gz CMake-58f04b6ecf853e4ee5cce2bfb258fa7d4cc75b79.tar.bz2 |
Autogen: Add ManySources test
The QtAutogen/ManySources test generates a number of source, header, .ui and
.qrc files that get AUTOMOC, AUTOUIC and AUTORCC processed. This stresses the
concurrency framework in `cmQtAutoMocUic` and should reveal any issues
with that.
Diffstat (limited to 'Tests/QtAutogen/ManySources/CMakeLists.txt')
-rw-r--r-- | Tests/QtAutogen/ManySources/CMakeLists.txt | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/Tests/QtAutogen/ManySources/CMakeLists.txt b/Tests/QtAutogen/ManySources/CMakeLists.txt new file mode 100644 index 0000000..df8a2a6 --- /dev/null +++ b/Tests/QtAutogen/ManySources/CMakeLists.txt @@ -0,0 +1,35 @@ +cmake_minimum_required(VERSION 3.10) +project(ManySources) +include("../AutogenGuiTest.cmake") + +# Test AUTOMOC and AUTOUIC on many source files to stress the concurrent +# parsing and processing framework. + +set(CSD ${CMAKE_CURRENT_SOURCE_DIR}) +set(CBD ${CMAKE_CURRENT_BINARY_DIR}) + +set(SRCS main.cpp) +set(MAIN_INCLUDES "\n// Item includes\n") +set(MAIN_ITEMS "\n// Items\n") + +set(NUM 24) +foreach(III RANGE 1 ${NUM}) + configure_file(${CSD}/object.h.in ${CBD}/object_${III}.h) + configure_file(${CSD}/item.h.in ${CBD}/item_${III}.h) + configure_file(${CSD}/item.cpp.in ${CBD}/item_${III}.cpp) + configure_file(${CSD}/view.ui.in ${CBD}/view_${III}.ui) + configure_file(${CSD}/data.qrc.in ${CBD}/data_${III}.qrc) + + list(APPEND SRCS ${CBD}/item_${III}.cpp) + list(APPEND SRCS ${CBD}/data_${III}.qrc) + + string(APPEND MAIN_INCLUDES "#include \"item_${III}.h\"\n") + string(APPEND MAIN_ITEMS "Item_${III} item_${III};\n") + string(APPEND MAIN_ITEMS "item_${III}.TheSlot();\n") +endforeach() + +configure_file(${CSD}/main.cpp.in ${CBD}/main.cpp) + +add_executable(manySources ${SRCS} ${CBD}/main.cpp) +target_link_libraries(manySources ${QT_LIBRARIES}) +set_target_properties(manySources PROPERTIES AUTOMOC 1 AUTOUIC 1 AUTORCC 1) |