5d5bc38e2d27dcccfb2302ddaeb1933612f2b974
[reactos.git] / include / reactos / idl / CMakeLists.txt
1
2 remove_definitions(-DWINVER=0x502)
3 add_definitions(-DWINVER=0x600)
4
5 include_directories(.)
6
7 get_directory_property(defines COMPILE_DEFINITIONS)
8 get_directory_property(includes INCLUDE_DIRECTORIES)
9
10 foreach(arg ${defines})
11 set(result_defs ${result_defs} -D${arg})
12 endforeach(arg ${defines})
13
14 foreach(arg ${includes})
15 set(result_incs -I${arg} ${result_incs})
16 endforeach(arg ${includes})
17
18 MACRO (MACRO_IDL_FILES)
19
20 FOREACH(_in_FILE ${ARGN})
21
22 get_filename_component(FILE ${_in_FILE} NAME_WE)
23 add_custom_command(
24 OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_s.h ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_s.c
25 COMMAND native-widl ${result_incs} ${result_defs} -m32 --win32 -h -H ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_s.h -s -S ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_s.c ${CMAKE_CURRENT_SOURCE_DIR}/${FILE}.idl
26 DEPENDS native-widl
27 )
28 set_source_files_properties(
29 ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_s.h ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_s.c
30 PROPERTIES GENERATED TRUE
31 )
32 add_custom_target(${FILE}_server ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_s.h ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_s.c)
33
34 add_custom_command(
35 OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_c.h ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_c.c
36 COMMAND native-widl ${result_incs} ${result_defs} -m32 --win32 -h -H ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_c.h -c -C ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_c.c ${CMAKE_CURRENT_SOURCE_DIR}/${FILE}.idl
37 DEPENDS native-widl
38 )
39 set_source_files_properties(
40 ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_c.h ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_c.c
41 PROPERTIES GENERATED TRUE
42 )
43 add_custom_target(${FILE}_client ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_c.h ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_c.c)
44
45 ENDFOREACH(_in_FILE ${ARGN})
46
47 ENDMACRO (MACRO_IDL_FILES)
48
49 file(GLOB_RECURSE SOURCE "*.idl")
50 LIST(REMOVE_ITEM SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/ms-dtyp.idl)
51 MACRO_IDL_FILES(${SOURCE})