cmake: Fix tests that need helper binaries

Compile the binaries where they are expected not in builddir/bin

Change-Id: I5c9461424a4b3f9fb7f39f5b9d3cd9b96887cfbc
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This commit is contained in:
Albert Astals Cid 2019-06-04 12:02:41 +02:00
parent 6d1c695b0e
commit 4d72497e6e
4 changed files with 13 additions and 2 deletions

View File

@ -1,10 +1,15 @@
if(NOT WINRT)
add_qt_test_helper(qlogging_helper SOURCES app/main.cpp DEFINES QT_MESSAGELOGCONTEXT LIBRARIES Qt::Core)
add_qt_executable(qlogging_helper
NO_INSTALL # special case
OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} # special case
SOURCES app/main.cpp
DEFINES QT_MESSAGELOGCONTEXT
LIBRARIES Qt::Core)
endif()
add_qt_test(tst_qlogging SOURCES tst_qlogging.cpp
DEFINES
QT_MESSAGELOGCONTEXT
QT_DISABLE_DEPRECATED_BEFORE=0
HELPER_BINARY="qlogging_helper"
HELPER_BINARY="${CMAKE_CURRENT_BINARY_DIR}/qlogging_helper" # special case
)

View File

@ -5,6 +5,8 @@
#####################################################################
add_qt_executable(qmyserver
NO_INSTALL # special case
OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} # special case
SOURCES
../myobject.h
qmyserver.cpp

View File

@ -5,6 +5,8 @@
#####################################################################
add_qt_executable(qpinger
NO_INSTALL # special case
OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} # special case
SOURCES
../interface.cpp ../interface.h
qpinger.cpp

View File

@ -8,6 +8,8 @@
# already has a executable target named like that, so use
# a different target name and then rename the binary
add_qt_executable(qmyserver_qdbusinterface
NO_INSTALL # special case
OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} # special case
SOURCES
../myobject.h
qmyserver.cpp