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