diff options
author | Tobias Hunger <tobias.hunger@qt.io> | 2018-11-15 12:01:22 +0100 |
---|---|---|
committer | Tobias Hunger <tobias.hunger@qt.io> | 2018-11-22 15:19:41 +0000 |
commit | 13e1c93e370551a7398d8e819b8ec4710def0151 (patch) | |
tree | 1e4e1655b83b46fb29d883825d118afbdb476f7a /cmake/tests | |
parent | f4dc3dcacb61694915f45a0a0c47c85c21580d40 (diff) |
CMake: Add test for QRC and make it pass
Add a test for QRC file handling in cmake and fix the qrc file handling
to handle qrc files in subfolders properly.
Change-Id: Iff4224e59e7ee1badacce5fc00dbf68aef69bffe
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
Diffstat (limited to 'cmake/tests')
-rw-r--r-- | cmake/tests/CMakeLists.txt | 1 | ||||
-rw-r--r-- | cmake/tests/qrc/CMakeLists.txt | 31 | ||||
-rw-r--r-- | cmake/tests/qrc/dialog/dialog.qrc | 0 | ||||
-rw-r--r-- | cmake/tests/qrc/qrc.qrc | 0 |
4 files changed, 32 insertions, 0 deletions
diff --git a/cmake/tests/CMakeLists.txt b/cmake/tests/CMakeLists.txt index dd268bf254..3f51c24025 100644 --- a/cmake/tests/CMakeLists.txt +++ b/cmake/tests/CMakeLists.txt @@ -45,5 +45,6 @@ macro(add_cmake_test_generate name) endmacro() add_cmake_test_generate(features) +add_cmake_test_generate(qrc) add_cmake_test_generate(qt_make_output_file) add_cmake_test_generate(uic) diff --git a/cmake/tests/qrc/CMakeLists.txt b/cmake/tests/qrc/CMakeLists.txt new file mode 100644 index 0000000000..fc28390300 --- /dev/null +++ b/cmake/tests/qrc/CMakeLists.txt @@ -0,0 +1,31 @@ +cmake_minimum_required(VERSION 3.12.0) + +project(QrcTest + VERSION 1.0.0 + DESCRIPTION "Qrc test" + HOMEPAGE_URL "https://qt.io/" + LANGUAGES CXX +) + +## Add some paths to check for cmake modules: +list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../;${CMAKE_CURRENT_SOURCE_DIR}/../../3rdparty/extra-cmake-modules/find-modules;${CMAKE_CURRENT_SOURCE_DIR}/../../3rdparty/kwin") + +## Qt specific setup common for all modules: +include(QtSetup) + +include(../test.cmake) + +fake_moc_results() +add_qt_executable(test_executable + SOURCES + ../main.cpp + qrc.qrc +) + +fake_moc_results() +extend_target(test_executable SOURCES dialog/dialog.qrc) + +test_source_file(test_executable "${CMAKE_CURRENT_BINARY_DIR}/qrc_qrc.cpp" BUILD) +test_source_file(test_executable "${CMAKE_CURRENT_BINARY_DIR}/dialog/qrc_dialog.cpp" BUILD) + +test_include_directory(test_executable "${CMAKE_CURRENT_BINARY_DIR}/dialog" UNKNOWN) diff --git a/cmake/tests/qrc/dialog/dialog.qrc b/cmake/tests/qrc/dialog/dialog.qrc new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/cmake/tests/qrc/dialog/dialog.qrc diff --git a/cmake/tests/qrc/qrc.qrc b/cmake/tests/qrc/qrc.qrc new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/cmake/tests/qrc/qrc.qrc |