[CMAKE]: Add wmc to host tools, and export it as native-wmc.
[reactos.git] / include / reactos / mc / CMakeLists.txt
1
2 MACRO (MACRO_ADD_RESOURCES)
3
4 FOREACH(_in_FILE ${ARGN})
5
6 GET_FILENAME_COMPONENT(FILE ${_in_FILE} NAME_WE)
7
8 ADD_CUSTOM_COMMAND(
9 OUTPUT ${REACTOS_BINARY_DIR}/include/reactos/${FILE}.h
10 COMMAND native-wmc -i -H ${REACTOS_BINARY_DIR}/include/reactos/${FILE}.h -o ${REACTOS_BINARY_DIR}/include/reactos/mc/${FILE}.rc ${REACTOS_SOURCE_DIR}/include/reactos/mc/${FILE}.mc
11 DEPENDS native-wmc
12 )
13
14 SET_SOURCE_FILES_PROPERTIES(
15 ${REACTOS_BINARY_DIR}/include/reactos/${FILE}.h
16 PROPERTIES
17 GENERATED TRUE
18 )
19
20 LIST(APPEND RESOURCES ${REACTOS_BINARY_DIR}/include/reactos/${FILE}.h)
21
22 ENDFOREACH(_in_FILE ${ARGN})
23
24 ENDMACRO (MACRO_ADD_RESOURCES)
25
26 file(GLOB_RECURSE SOURCE "*.mc")
27
28 MACRO_ADD_RESOURCES(${SOURCE})
29
30 ADD_CUSTOM_TARGET(build_resources ALL DEPENDS ${RESOURCES})