I'm trying to create a test application in QT to test another QT application's UI using qtlib. I learned that you also need to use QTEST_MAIN() macro which expands to a simple main() method that runs all the test functions.
QTEST_MAIN(TestAppUI)
#include "testapp.moc"
I'm compiling it using "make" and somewhere in my CMakeLists.txt I have
SET(TEST_APP_SRCS
ui/menu/testapp.cpp
)
SET(TEST_APP_SRCS_MOC_SRCS
ui/menu/testapp.hpp
)
QT4_WRAP_CPP(TEST_APP_SRCS ${TEST_APP_SRCS_MOC_SRCS})
My problem is, during compilation I'm getting this error.
error: testapp.moc: No such file or directory
I don't know what's wrong... Any ideas?
I just figured what's wrong. I needed to add ${QT_LIBRARIES} ${QT_QTTEST_LIBRARY} in TARGET_LINK_LIBRARIES ... :) and remove #include "testapp.moc"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With