Changeset View
Changeset View
Standalone View
Standalone View
autotests/CMakeLists.txt
1 | add_definitions(-DKSCREENLOCKER_UNIT_TEST) | 1 | add_definitions(-DKSCREENLOCKER_UNIT_TEST) | ||
---|---|---|---|---|---|
2 | include(ECMMarkAsTest) | 2 | include(ECMMarkAsTest) | ||
3 | 3 | | |||
4 | ####################################### | 4 | ####################################### | ||
5 | # LogindTest | 5 | # LogindTest | ||
6 | ####################################### | 6 | ####################################### | ||
7 | set(logindTest_SRCS | 7 | set(logindTest_SRCS | ||
8 | logindtest.cpp | 8 | logindtest.cpp | ||
9 | fakelogind.cpp | 9 | fakelogind.cpp | ||
10 | ../logind.cpp | 10 | ../logind.cpp | ||
11 | ../kscreenlocker_logging.cpp | ||||
11 | ) | 12 | ) | ||
13 | | ||||
12 | add_executable(logindTest ${logindTest_SRCS}) | 14 | add_executable(logindTest ${logindTest_SRCS}) | ||
13 | target_link_libraries(logindTest Qt5::DBus Qt5::Test KF5::I18n) | 15 | target_link_libraries(logindTest Qt5::DBus Qt5::Test KF5::I18n) | ||
14 | add_test(NAME ksmserver-logindTest COMMAND logindTest) | 16 | add_test(NAME ksmserver-logindTest COMMAND logindTest) | ||
15 | ecm_mark_as_test(logindTest) | 17 | ecm_mark_as_test(logindTest) | ||
16 | 18 | | |||
17 | ####################################### | 19 | ####################################### | ||
18 | # KSldTest | 20 | # KSldTest | ||
19 | ####################################### | 21 | ####################################### | ||
20 | add_executable(ksldTest ksldtest.cpp) | 22 | add_executable(ksldTest ksldtest.cpp) | ||
21 | target_link_libraries(ksldTest Qt5::Test Qt5::Widgets KF5::IdleTime XCB::XTEST KScreenLocker) | 23 | target_link_libraries(ksldTest Qt5::Test Qt5::Widgets KF5::IdleTime XCB::XTEST KScreenLocker) | ||
22 | add_test(NAME ksmserver-ksldTest COMMAND ksldTest) | 24 | add_test(NAME ksmserver-ksldTest COMMAND ksldTest) | ||
romangg: Any idea how to reuse the declaration from the top-directory CMake file? | |||||
Make sure the include() call is before the add_subdirectory(). That's why we usually put them together on top right under the find_package() together with include(ECMGenerateHeaders). apol: Make sure the include() call is before the add_subdirectory().
That's why we usually put them… | |||||
Put the include on top and the other trick was to just include the generated cpp file. Thanks. romangg: Put the include on top and the other trick was to just include the generated cpp file. Thanks. | |||||
23 | ecm_mark_as_test(ksldTest) | 25 | ecm_mark_as_test(ksldTest) | ||
24 | 26 | | |||
25 | ####################################### | 27 | ####################################### | ||
26 | # KeyboardGrabber | 28 | # KeyboardGrabber | ||
27 | ####################################### | 29 | ####################################### | ||
28 | add_executable(keyboardGrabber keyboardgrabber.cpp) | 30 | add_executable(keyboardGrabber keyboardgrabber.cpp) | ||
29 | target_link_libraries(keyboardGrabber Qt5::Core XCB::XCB) | 31 | target_link_libraries(keyboardGrabber Qt5::Core XCB::XCB) | ||
30 | ecm_mark_as_test(keyboardGrabber) | 32 | ecm_mark_as_test(keyboardGrabber) | ||
31 | 33 | | |||
32 | ####################################### | 34 | ####################################### | ||
33 | # PointerGrabber | 35 | # PointerGrabber | ||
34 | ####################################### | 36 | ####################################### | ||
35 | add_executable(pointerGrabber pointergrabber.cpp) | 37 | add_executable(pointerGrabber pointergrabber.cpp) | ||
36 | target_link_libraries(pointerGrabber Qt5::Core XCB::XCB) | 38 | target_link_libraries(pointerGrabber Qt5::Core XCB::XCB) | ||
37 | ecm_mark_as_test(pointerGrabber) | 39 | ecm_mark_as_test(pointerGrabber) | ||
38 | 40 | | |||
39 | ####################################### | 41 | ####################################### | ||
40 | # LockWindowTest | 42 | # LockWindowTest | ||
41 | ####################################### | 43 | ####################################### | ||
42 | set(x11LockerTest_SRCS x11lockertest.cpp ../x11locker.cpp ../globalaccel.cpp ../abstractlocker.cpp) | 44 | set(x11LockerTest_SRCS | ||
45 | x11lockertest.cpp | ||||
46 | ../x11locker.cpp | ||||
47 | ../globalaccel.cpp | ||||
48 | ../abstractlocker.cpp | ||||
49 | ../kscreenlocker_logging.cpp | ||||
50 | ) | ||||
51 | | ||||
43 | add_executable(x11LockerTest ${x11LockerTest_SRCS}) | 52 | add_executable(x11LockerTest ${x11LockerTest_SRCS}) | ||
44 | target_link_libraries(x11LockerTest | 53 | target_link_libraries(x11LockerTest | ||
45 | KF5::GlobalAccel | 54 | KF5::GlobalAccel | ||
46 | KF5::I18n | 55 | KF5::I18n | ||
47 | KF5::WindowSystem | 56 | KF5::WindowSystem | ||
48 | Qt5::Test | 57 | Qt5::Test | ||
49 | Qt5::X11Extras | 58 | Qt5::X11Extras | ||
50 | Qt5::Widgets | 59 | Qt5::Widgets | ||
Show All 19 Lines |
Any idea how to reuse the declaration from the top-directory CMake file?