6a6209cdca6e0f163bff200ee8f3b1ba7036c720
[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(kernel32)
9 add_subdirectory(ntos_io)
10
11 list(APPEND COMMON_SOURCE
12 example/GuardedMemory.c
13 rtl/RtlAvlTree.c
14 rtl/RtlException.c
15 rtl/RtlIntSafe.c
16 rtl/RtlMemory.c
17 rtl/RtlRegistry.c
18 rtl/RtlSplayTree.c
19 rtl/RtlUnicodeString.c)
20
21 #
22 # kmtest_drv.sys driver
23 #
24 list(APPEND KMTEST_DRV_SOURCE
25 kmtest_drv/guid.c
26 kmtest_drv/kmtest_drv.c
27 kmtest_drv/testlist.c
28
29 example/Example.c
30 example/KernelType.c
31 npfs/NpfsConnect.c
32 npfs/NpfsCreate.c
33 npfs/NpfsHelpers.c
34 npfs/NpfsReadWrite.c
35 npfs/NpfsVolumeInfo.c
36 ntos_ex/ExCallback.c
37 ntos_ex/ExDoubleList.c
38 ntos_ex/ExFastMutex.c
39 ntos_ex/ExHardError.c
40 ntos_ex/ExInterlocked.c
41 ntos_ex/ExPools.c
42 ntos_ex/ExResource.c
43 ntos_ex/ExSequencedList.c
44 ntos_ex/ExSingleList.c
45 ntos_ex/ExTimer.c
46 ntos_fsrtl/FsRtlExpression.c
47 ntos_fsrtl/FsRtlMcb.c
48 ntos_fsrtl/FsRtlTunnel.c
49 ntos_io/IoDeviceInterface.c
50 ntos_io/IoEvent.c
51 ntos_io/IoInterrupt.c
52 ntos_io/IoIrp.c
53 ntos_io/IoMdl.c
54 ntos_ke/KeApc.c
55 ntos_ke/KeDevQueue.c
56 ntos_ke/KeDpc.c
57 ntos_ke/KeEvent.c
58 ntos_ke/KeGuardedMutex.c
59 ntos_ke/KeIrql.c
60 ntos_ke/KeMutex.c
61 ntos_ke/KeProcessor.c
62 ntos_ke/KeSpinLock.c
63 ntos_ke/KeTimer.c
64 ntos_mm/MmSection.c
65 ntos_mm/ZwAllocateVirtualMemory.c
66 ntos_mm/ZwCreateSection.c
67 ntos_mm/ZwMapViewOfSection.c
68 ntos_ob/ObReference.c
69 ntos_ob/ObType.c
70 ntos_ob/ObTypes.c
71 ntos_ps/PsNotify.c
72 ntos_se/SeQueryInfoToken.c
73 ${COMMON_SOURCE}
74
75 kmtest_drv/kmtest_drv.rc)
76
77 add_library(kmtest_drv SHARED ${KMTEST_DRV_SOURCE})
78
79 set_module_type(kmtest_drv kernelmodedriver)
80 target_link_libraries(kmtest_drv kmtest_printf chkstk ${PSEH_LIB})
81 add_importlibs(kmtest_drv ntoskrnl hal)
82 add_dependencies(kmtest_drv bugcodes)
83 add_target_compile_definitions(kmtest_drv KMT_KERNEL_MODE NTDDI_VERSION=NTDDI_WS03SP1)
84 #add_pch(kmtest_drv include/kmt_test.h)
85
86 add_cd_file(TARGET kmtest_drv DESTINATION reactos/bin FOR all)
87
88 add_library(kmtest_printf
89 kmtest_drv/printf_stubs.c
90 ${REACTOS_SOURCE_DIR}/lib/sdk/crt/string/strnlen.c
91 ${REACTOS_SOURCE_DIR}/lib/sdk/crt/string/wcsnlen.c
92 ${REACTOS_SOURCE_DIR}/lib/sdk/crt/printf/streamout.c)
93 add_target_compile_definitions(kmtest_printf _LIBCNT_ _USER32_WSPRINTF wctomb=KmtWcToMb)
94 add_target_include_directories(kmtest_printf ${REACTOS_SOURCE_DIR}/lib/sdk/crt/include)
95
96 #
97 # kmtest.exe loader application
98 #
99
100 list(APPEND KMTEST_SOURCE
101 kmtest/kmtest.c
102 kmtest/service.c
103 kmtest/support.c
104 kmtest/testlist.c
105
106 example/Example_user.c
107 kernel32/FindFile_user.c
108 ntos_io/IoDeviceObject_user.c
109 ${COMMON_SOURCE}
110
111 kmtest/kmtest.rc)
112
113 add_executable(kmtest ${KMTEST_SOURCE})
114 set_module_type(kmtest win32cui)
115 target_link_libraries(kmtest ${PSEH_LIB})
116 add_importlibs(kmtest advapi32 msvcrt kernel32 ntdll)
117 add_target_compile_definitions(kmtest KMT_USER_MODE)
118 #add_pch(kmtest include/kmt_test.h)
119
120 set_target_properties(kmtest PROPERTIES OUTPUT_NAME "kmtest_")
121 add_cd_file(TARGET kmtest DESTINATION reactos/bin FOR all)
122
123 #
124 # Group targets
125 #
126 add_custom_target(kmtest_drivers)
127 add_dependencies(kmtest_drivers
128 kmtest_drv
129 example_drv
130 iodeviceobject_drv
131 iohelper_drv)
132
133 add_custom_target(kmtest_all)
134 add_dependencies(kmtest_all kmtest_drivers kmtest)