| 1 |
macro(lastfm_add_test test_class) |
| 2 |
include_directories("${PROJECT_SOURCE_DIR}/src" ${CMAKE_CURRENT_BINARY_DIR}) |
| 3 |
|
| 4 |
set(LASTFM_TEST_CLASS ${test_class}) |
| 5 |
configure_file(main.cpp.in Test${LASTFM_TEST_CLASS}.cpp) |
| 6 |
configure_file(Test${LASTFM_TEST_CLASS}.h Test${LASTFM_TEST_CLASS}.h) |
| 7 |
add_executable(${LASTFM_TEST_CLASS}Test Test${LASTFM_TEST_CLASS}.cpp) |
| 8 |
|
| 9 |
target_link_libraries(${LASTFM_TEST_CLASS}Test Qt::Core Qt::Test Qt::Xml Qt::Network |
| 10 |
${LASTFM_LIB_TARGET_NAME} |
| 11 |
) |
| 12 |
|
| 13 |
add_test(NAME ${LASTFM_TEST_CLASS}Test COMMAND ${LASTFM_TEST_CLASS}Test) |
| 14 |
endmacro() |