Merge PR #283 "[USBPORT] Transaction Translator (TT) support bringup"
[reactos.git] / sdk / include / xdk / CMakeLists.txt
1
2 file(GLOB xdk_headers "*.h")
3
4 function(add_xdk_header _template _out)
5 get_filename_component(_out_filename ${_out} NAME)
6 set(_temp_file ${CMAKE_CURRENT_BINARY_DIR}/${_out_filename})
7 add_custom_command(
8 OUTPUT ${REACTOS_BINARY_DIR}/${_out}
9 COMMAND ${CMAKE_COMMAND} -E copy_if_different ${_temp_file} ${REACTOS_BINARY_DIR}/${_out}
10 DEPENDS ${_temp_file})
11
12 add_custom_command(
13 OUTPUT ${_temp_file}
14 COMMAND native-hpp ${_template} ${_temp_file}
15 DEPENDS ${_template} ${xdk_headers} native-hpp
16 WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
17 set(xdk_files "${xdk_files};${REACTOS_BINARY_DIR}/${_out}" PARENT_SCOPE)
18 endfunction()
19
20 add_xdk_header(wdm.template.h sdk/include/ddk/wdm.h)
21 add_xdk_header(ntddk.template.h sdk/include/ddk/ntddk.h)
22 add_xdk_header(ntifs.template.h sdk/include/ddk/ntifs.h)
23 add_xdk_header(devioctl.template.h sdk/include/psdk/devioctl.h)
24 add_xdk_header(ntdef.template.h sdk/include/psdk/ntdef.h)
25 add_xdk_header(winnt.template.h sdk/include/psdk/winnt.h)
26 add_custom_target(xdk DEPENDS ${xdk_files})