diff options
author | Stephen Kelly <stephen.kelly@kdab.com> | 2013-03-14 14:08:55 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-03-18 20:17:10 +0100 |
commit | 4111a676f1073e2f29de2c042785a941dbfb9458 (patch) | |
tree | 5750889bd6cf75766d511f8a879129040f14a6c3 /tests/auto/cmake | |
parent | 374fc337ae03b44903768c18eb3f16c0e5451f81 (diff) |
Make the qtbase cmake tests work without the Widgets module.
Task-number: QTBUG-28540
Change-Id: I916d104c8aba551ee9a5b34da3fd85dcb26bbf64
Reviewed-by: Alexander Neundorf <neundorf@kde.org>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Diffstat (limited to 'tests/auto/cmake')
-rw-r--r-- | tests/auto/cmake/CMakeLists.txt | 31 | ||||
-rw-r--r-- | tests/auto/cmake/test_testlib_definitions/CMakeLists.txt | 4 |
2 files changed, 23 insertions, 12 deletions
diff --git a/tests/auto/cmake/CMakeLists.txt b/tests/auto/cmake/CMakeLists.txt index 6da0c9bfa6..4cc0505a8c 100644 --- a/tests/auto/cmake/CMakeLists.txt +++ b/tests/auto/cmake/CMakeLists.txt @@ -55,10 +55,12 @@ else() message("CMake version older than 2.8.9 (Found ${CMAKE_VERSION}). Not running test \"test_use_modules_function\"") endif() expect_pass(test_wrap_cpp_and_resources) -expect_pass(test_dependent_modules) +if (NOT NO_WIDGETS) + expect_pass(test_dependent_modules) + expect_pass("test(needsquoting)dirname") +endif() expect_fail(test_add_resource_options) expect_fail(test_wrap_cpp_options) -expect_pass("test(needsquoting)dirname") expect_pass(test_platform_defs_include) expect_pass(test_qtmainwin_library) @@ -78,29 +80,36 @@ expect_pass(test_testlib_definitions) expect_pass(test_json_plugin_includes) expect_fail(test_testlib_no_link_gui) -expect_fail(test_testlib_no_link_widgets) - execute_process(COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/test_testlib_definitions/main.cpp" "${CMAKE_CURRENT_BINARY_DIR}/failbuild/test_testlib_no_link_gui/test_testlib_no_link_gui/" ) -execute_process(COMMAND ${CMAKE_COMMAND} -E copy - "${CMAKE_CURRENT_SOURCE_DIR}/test_testlib_definitions/main.cpp" - "${CMAKE_CURRENT_BINARY_DIR}/failbuild/test_testlib_no_link_widgets/test_testlib_no_link_widgets/" -) + +if (NOT NO_WIDGETS) + expect_fail(test_testlib_no_link_widgets) + execute_process(COMMAND ${CMAKE_COMMAND} -E copy + "${CMAKE_CURRENT_SOURCE_DIR}/test_testlib_definitions/main.cpp" + "${CMAKE_CURRENT_BINARY_DIR}/failbuild/test_testlib_no_link_widgets/test_testlib_no_link_widgets/" + ) +endif() set(qt_module_includes Core QObject Gui QImage - Widgets QWidget Network QHostInfo - OpenGL QGLBuffer Sql QSqlError Test QTestEventList Xml QDomDocument - PrintSupport QPrintDialog ) +if (NOT NO_WIDGETS) + list(APPEND qt_module_includes + Widgets QWidget + OpenGL QGLBuffer + PrintSupport QPrintDialog + ) +endif() + if (UNIX AND NOT APPLE AND NOT QNXNTO) list(APPEND qt_module_includes DBus QDBusMessage diff --git a/tests/auto/cmake/test_testlib_definitions/CMakeLists.txt b/tests/auto/cmake/test_testlib_definitions/CMakeLists.txt index c370e8effa..cc54bf5bc3 100644 --- a/tests/auto/cmake/test_testlib_definitions/CMakeLists.txt +++ b/tests/auto/cmake/test_testlib_definitions/CMakeLists.txt @@ -35,4 +35,6 @@ endmacro() add_subdirectory(core_only) add_subdirectory(gui) -add_subdirectory(widgets) +if(NOT NO_WIDGETS) + add_subdirectory(widgets) +endif() |