- Add IDL generated headers to build.

svn path=/branches/cmake-bringup/; revision=48441
This commit is contained in:
Amine Khaldi 2010-08-03 21:51:59 +00:00
parent 9e90eaa575
commit 2939360909
2 changed files with 52 additions and 2 deletions

View file

@ -75,6 +75,7 @@ include_directories(./include/reactos/libs)
add_subdirectory(include/psdk) add_subdirectory(include/psdk)
add_subdirectory(include/dxsdk) add_subdirectory(include/dxsdk)
add_subdirectory(include/reactos/idl)
add_subdirectory(include/reactos/mc) add_subdirectory(include/reactos/mc)
add_subdirectory(base) add_subdirectory(base)
@ -110,8 +111,6 @@ ADD_CUSTOM_COMMAND(
DEPENDS native-nci ${nci_folders} DEPENDS native-nci ${nci_folders}
) )
SET_SOURCE_FILES_PROPERTIES(${nci_output} PROPERTIES GENERATED TRUE)
ADD_CUSTOM_TARGET(ntdll_S ALL DEPENDS ${REACTOS_BINARY_DIR}/lib/ntdllsys/ntdll.S) ADD_CUSTOM_TARGET(ntdll_S ALL DEPENDS ${REACTOS_BINARY_DIR}/lib/ntdllsys/ntdll.S)
ADD_CUSTOM_TARGET(win32k_S ALL DEPENDS ${REACTOS_BINARY_DIR}/lib/win32ksys/win32k.S) ADD_CUSTOM_TARGET(win32k_S ALL DEPENDS ${REACTOS_BINARY_DIR}/lib/win32ksys/win32k.S)
ADD_CUSTOM_TARGET(ntsys_pspec ALL DEPENDS ${REACTOS_BINARY_DIR}/dll/ntdll/def/ntsys.pspec) ADD_CUSTOM_TARGET(ntsys_pspec ALL DEPENDS ${REACTOS_BINARY_DIR}/dll/ntdll/def/ntsys.pspec)

View file

@ -0,0 +1,51 @@
remove_definitions(-DWINVER=0x502)
add_definitions(-DWINVER=0x600)
include_directories(.)
get_directory_property(defines COMPILE_DEFINITIONS)
get_directory_property(includes INCLUDE_DIRECTORIES)
foreach(arg ${defines})
set(result_defs ${result_defs} -D${arg})
endforeach(arg ${defines})
foreach(arg ${includes})
set(result_incs -I${arg} ${result_incs})
endforeach(arg ${includes})
MACRO (MACRO_IDL_FILES)
FOREACH(_in_FILE ${ARGN})
get_filename_component(FILE ${_in_FILE} NAME_WE)
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_s.h ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_s.c
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
DEPENDS native-widl
)
set_source_files_properties(
${CMAKE_CURRENT_BINARY_DIR}/${FILE}_s.h ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_s.c
PROPERTIES GENERATED TRUE
)
add_custom_target(${FILE}_server ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_s.h ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_s.c)
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_c.h ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_c.c
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
DEPENDS native-widl
)
set_source_files_properties(
${CMAKE_CURRENT_BINARY_DIR}/${FILE}_c.h ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_c.c
PROPERTIES GENERATED TRUE
)
add_custom_target(${FILE}_client ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_c.h ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_c.c)
ENDFOREACH(_in_FILE ${ARGN})
ENDMACRO (MACRO_IDL_FILES)
file(GLOB_RECURSE SOURCE "*.idl")
LIST(REMOVE_ITEM SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/ms-dtyp.idl)
MACRO_IDL_FILES(${SOURCE})