summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMichal Klocek <michal.klocek@qt.io>2021-09-02 15:37:36 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-09-05 17:26:17 +0000
commit9e8e00301f3db39011a1a604dd4da83f23036509 (patch)
treeccb99f2858429386264b9f4e6e7d4e4e5b790d7f /tests
parentf9399ffa81bbb3b617e22710e03bd5487581e183 (diff)
Fix automoc for test in case of topLevel build
In top level build , main configure can complain that moc does not exist during generator phase. Mark moc as enabled. Change-Id: I55db6ada209939cc4cbedab4654b654cd741c535 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> (cherry picked from commit 7e2016039132538fedfe51e4be51998f9b7be929) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/httpserver/httpserver.cmake7
1 files changed, 3 insertions, 4 deletions
diff --git a/tests/auto/httpserver/httpserver.cmake b/tests/auto/httpserver/httpserver.cmake
index d67648f9c..84b350c0e 100644
--- a/tests/auto/httpserver/httpserver.cmake
+++ b/tests/auto/httpserver/httpserver.cmake
@@ -1,9 +1,5 @@
if (NOT TARGET Test::HttpServer)
- if(NOT QT_SUPERBUILD AND NOT QT_CONFIGURE_RUNNING)
- set(CMAKE_AUTOMOC ON)
- endif()
-
add_library(httpserver STATIC
${CMAKE_CURRENT_LIST_DIR}/httpreqrep.cpp
${CMAKE_CURRENT_LIST_DIR}/httpreqrep.h
@@ -13,6 +9,9 @@ if (NOT TARGET Test::HttpServer)
${CMAKE_CURRENT_LIST_DIR}/proxy_server.cpp
)
+ # moc binary might not exist in case of top level build
+ qt_autogen_tools(httpserver ENABLE_AUTOGEN_TOOLS "moc")
+
if(QT_FEATURE_ssl)
target_sources(httpserver INTERFACE ${CMAKE_CURRENT_LIST_DIR}/httpsserver.h)
endif()