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