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