nextcloud-desktop/test/owncloud_add_test.cmake

22 lines
952 B
CMake
Raw Normal View History

2012-10-26 22:24:12 +04:00
macro(owncloud_add_test test_class)
include_directories(${QT_INCLUDES} "${PROJECT_SOURCE_DIR}/src" ${CMAKE_CURRENT_BINARY_DIR})
set(OWNCLOUD_TEST_CLASS ${test_class})
string(TOLOWER "${OWNCLOUD_TEST_CLASS}" OWNCLOUD_TEST_CLASS_LOWERCASE)
configure_file(main.cpp.in test${OWNCLOUD_TEST_CLASS_LOWERCASE}.cpp)
configure_file(test${OWNCLOUD_TEST_CLASS_LOWERCASE}.h test${OWNCLOUD_TEST_CLASS_LOWERCASE}.h)
2013-09-05 20:06:00 +04:00
qt_wrap_cpp(${OWNCLOUD_TEST_CLASS}_MOCS test${OWNCLOUD_TEST_CLASS_LOWERCASE}.h)
2012-10-26 22:24:12 +04:00
add_executable(${OWNCLOUD_TEST_CLASS}Test test${OWNCLOUD_TEST_CLASS_LOWERCASE}.cpp ${${OWNCLOUD_TEST_CLASS}_MOCS})
2014-02-04 15:55:06 +04:00
qt5_use_modules(${OWNCLOUD_TEST_CLASS}Test Test Sql Xml)
2012-10-26 22:24:12 +04:00
target_link_libraries(${OWNCLOUD_TEST_CLASS}Test
updater
${APPLICATION_EXECUTABLE}sync
2012-10-26 22:24:12 +04:00
${QT_QTTEST_LIBRARY}
${QT_QTCORE_LIBRARY}
)
add_test(NAME ${OWNCLOUD_TEST_CLASS}Test COMMAND ${OWNCLOUD_TEST_CLASS}Test)
2013-08-09 14:56:43 +04:00
endmacro()