b5056976694041f1c608f6902d29ca71817c6255
[reactos.git] / rostests / kmtests / CMakeLists.txt
1 include_directories(
2 include)
3
4 #
5 # subdirectories containing special-purpose drivers
6 #
7 add_subdirectory(example)
8 add_subdirectory(ntos_io)
9
10 list(APPEND COMMON_SOURCE
11 rtl/RtlAvlTree.c
12 rtl/RtlMemory.c
13 rtl/RtlSplayTree.c)
14
15 #
16 # kmtest_drv.sys driver
17 #
18 list(APPEND KMTEST_DRV_SOURCE
19 kmtest_drv/kmtest_drv.c
20 kmtest_drv/testlist.c
21
22 example/Example.c
23 example/KernelType.c
24 ntos_ex/ExDoubleList.c
25 ntos_ex/ExFastMutex.c
26 ntos_ex/ExHardError.c
27 ntos_ex/ExInterlocked.c
28 ntos_ex/ExPools.c
29 ntos_ex/ExResource.c
30 ntos_ex/ExSequencedList.c
31 ntos_ex/ExSingleList.c
32 ntos_ex/ExTimer.c
33 ntos_fsrtl/FsRtlExpression.c
34 ntos_io/IoDeviceInterface.c
35 ntos_io/IoInterrupt.c
36 ntos_io/IoIrp.c
37 ntos_io/IoMdl.c
38 ntos_ke/KeApc.c
39 ntos_ke/KeDpc.c
40 ntos_ke/KeEvent.c
41 ntos_ke/KeGuardedMutex.c
42 ntos_ke/KeIrql.c
43 ntos_ke/KeProcessor.c
44 ntos_ke/KeSpinLock.c
45 ntos_ob/ObReference.c
46 ntos_ob/ObType.c
47 ${COMMON_SOURCE}
48
49 kmtest_drv/kmtest_drv.rc)
50
51 add_library(kmtest_drv SHARED ${KMTEST_DRV_SOURCE})
52
53 set_module_type(kmtest_drv kernelmodedriver)
54 target_link_libraries(kmtest_drv kmtest_printf ${PSEH_LIB})
55 add_importlibs(kmtest_drv ntoskrnl hal)
56 add_target_compile_definitions(kmtest_drv KMT_KERNEL_MODE NTDDI_VERSION=NTDDI_WS03SP1)
57 #add_pch(kmtest_drv include/kmt_test.h)
58
59 add_cd_file(TARGET kmtest_drv DESTINATION reactos/bin FOR all)
60
61 add_library(kmtest_printf
62 kmtest_drv/printf_stubs.c
63 ${REACTOS_SOURCE_DIR}/lib/sdk/crt/printf/streamout.c)
64 add_target_compile_definitions(kmtest_printf _LIBCNT_ _USER32_WSPRINTF wctomb=KmtWcToMb)
65 add_target_include_directories(kmtest_printf ${REACTOS_SOURCE_DIR}/lib/sdk/crt/include)
66
67 #
68 # kmtest.exe loader application
69 #
70 set_rc_compiler()
71
72 list(APPEND KMTEST_SOURCE
73 kmtest/kmtest.c
74 kmtest/service.c
75 kmtest/support.c
76 kmtest/testlist.c
77
78 example/Example_user.c
79 ntos_io/IoDeviceObject_user.c
80 ${COMMON_SOURCE}
81
82 kmtest/kmtest.rc)
83
84 add_executable(kmtest ${KMTEST_SOURCE})
85 set_module_type(kmtest win32cui)
86 target_link_libraries(kmtest ${PSEH_LIB})
87 add_importlibs(kmtest advapi32 msvcrt kernel32 ntdll)
88 add_target_compile_definitions(kmtest KMT_USER_MODE)
89 #add_pch(kmtest include/kmt_test.h)
90
91 set_target_properties(kmtest PROPERTIES OUTPUT_NAME "kmtest_")
92 add_cd_file(TARGET kmtest DESTINATION reactos/bin FOR all)
93
94 #
95 # Group targets
96 #
97 add_custom_target(kmtest_drivers)
98 add_dependencies(kmtest_drivers
99 kmtest_drv
100 example_drv
101 iodeviceobject_drv
102 iohelper_drv)
103
104 add_custom_target(kmtest_all)
105 add_dependencies(kmtest_all kmtest_drivers kmtest)