summaryrefslogtreecommitdiff
path: root/tests/lib/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lib/CMakeLists.txt')
-rw-r--r--tests/lib/CMakeLists.txt22
1 files changed, 20 insertions, 2 deletions
diff --git a/tests/lib/CMakeLists.txt b/tests/lib/CMakeLists.txt
index 2a96336f..1755ddc3 100644
--- a/tests/lib/CMakeLists.txt
+++ b/tests/lib/CMakeLists.txt
@@ -1,9 +1,27 @@
include_directories(
${CMAKE_CURRENT_BINARY_DIR})
+set(tp_qt_tests_SRCS
+ test.cpp
+ test-thread-helper.cpp
+)
+
+set(tp_qt_tests_MOC_SRCS
+ test.h
+ test-thread-helper.h
+)
+
file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/_gen")
-tpqt_generate_moc_i(test.h ${CMAKE_CURRENT_BINARY_DIR}/_gen/test.h.moc.hpp)
-add_library(tp-qt-tests test.cpp ${CMAKE_CURRENT_BINARY_DIR}/_gen/test.h.moc.hpp)
+
+foreach(moc_src ${tp_qt_tests_MOC_SRCS})
+ set(generated_file _gen/${moc_src})
+ string(REPLACE ".h" ".h.moc.hpp" generated_file ${generated_file})
+ tpqt_generate_moc_i(${CMAKE_CURRENT_SOURCE_DIR}/${moc_src}
+ ${CMAKE_CURRENT_BINARY_DIR}/${generated_file})
+ list(APPEND tp_qt_tests_SRCS ${CMAKE_CURRENT_BINARY_DIR}/${generated_file})
+endforeach(moc_src ${tp_qt_tests_MOC_SRCS})
+
+add_library(tp-qt-tests ${tp_qt_tests_SRCS})
target_link_libraries(tp-qt-tests ${QT_QTCORE_LIBRARY} ${QT_QTDBUS_LIBRARY} telepathy-qt${QT_VERSION_MAJOR})
if(ENABLE_TP_GLIB_TESTS)