diff --git a/src/corelib/Qt5CTestMacros.cmake b/src/corelib/Qt5CTestMacros.cmake index 6451f65b55..a1044fa89a 100644 --- a/src/corelib/Qt5CTestMacros.cmake +++ b/src/corelib/Qt5CTestMacros.cmake @@ -39,6 +39,9 @@ if (CMAKE_VERBOSE_MAKEFILE) list(APPEND BUILD_OPTIONS_LIST "-DCMAKE_VERBOSE_MAKEFILE=1") endif() +if (NO_GUI) + list(APPEND BUILD_OPTIONS_LIST "-DNO_GUI=True") +endif() if (NO_WIDGETS) list(APPEND BUILD_OPTIONS_LIST "-DNO_WIDGETS=True") endif() diff --git a/tests/auto/auto.pro b/tests/auto/auto.pro index cc916edbad..f7c38e4422 100644 --- a/tests/auto/auto.pro +++ b/tests/auto/auto.pro @@ -24,7 +24,7 @@ ios: SUBDIRS = corelib gui wince: SUBDIRS -= printsupport cross_compile: SUBDIRS -= tools !qtHaveModule(opengl): SUBDIRS -= opengl -!qtHaveModule(gui): SUBDIRS -= gui cmake installed_cmake +!qtHaveModule(gui): SUBDIRS -= gui !qtHaveModule(widgets): SUBDIRS -= widgets !qtHaveModule(printsupport): SUBDIRS -= printsupport !qtHaveModule(concurrent): SUBDIRS -= concurrent diff --git a/tests/auto/cmake/CMakeLists.txt b/tests/auto/cmake/CMakeLists.txt index 1abbef0d68..c780096854 100644 --- a/tests/auto/cmake/CMakeLists.txt +++ b/tests/auto/cmake/CMakeLists.txt @@ -116,13 +116,18 @@ endif() set(qt_module_includes Core QObject - Gui QImage Network QHostInfo Sql QSqlError Test QTestEventList Xml QDomDocument ) +if (NOT NO_GUI) + list(APPEND qt_module_includes + Gui QImage + ) +endif() + if (NOT NO_WIDGETS) list(APPEND qt_module_includes Widgets QWidget diff --git a/tests/auto/cmake/test_testlib_definitions/CMakeLists.txt b/tests/auto/cmake/test_testlib_definitions/CMakeLists.txt index cc54bf5bc3..6fe7e56d24 100644 --- a/tests/auto/cmake/test_testlib_definitions/CMakeLists.txt +++ b/tests/auto/cmake/test_testlib_definitions/CMakeLists.txt @@ -34,7 +34,9 @@ macro(test_testlib_project _module) endmacro() add_subdirectory(core_only) -add_subdirectory(gui) +if(NOT NO_GUI) + add_subdirectory(gui) +endif() if(NOT NO_WIDGETS) add_subdirectory(widgets) endif()