- Improve the IDL macro, along with some dependencies.

svn path=/branches/cmake-bringup/; revision=48965
This commit is contained in:
Amine Khaldi 2010-10-02 17:09:48 +00:00
parent 0281bf63e6
commit e7caf66239
2 changed files with 32 additions and 31 deletions

View file

@ -12,6 +12,6 @@ target_link_libraries(xmllite
${CMAKE_CURRENT_BINARY_DIR}/xmllite.def
wine)
add_importlibs(xmllite msvcrt kernel32 ntdll)
add_importlibs(xmllite kernel32 ntdll)
add_dependencies(xmllite xmllite_def psdk buildno_header)

View file

@ -8,44 +8,45 @@ get_directory_property(defines COMPILE_DEFINITIONS)
get_directory_property(includes INCLUDE_DIRECTORIES)
foreach(arg ${defines})
set(result_defs ${result_defs} -D${arg})
set(result_defs ${result_defs} -D${arg})
endforeach(arg ${defines})
foreach(arg ${includes})
set(result_incs -I${arg} ${result_incs})
set(result_incs -I${arg} ${result_incs})
endforeach(arg ${includes})
MACRO (MACRO_IDL_FILES)
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_library(${FILE}_server ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_s.c)
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_library(${FILE}_server ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_s.c)
add_dependencies(${FILE}_server psdk)
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_library(${FILE}_client ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_c.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_library(${FILE}_client ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_c.c)
add_dependencies(${FILE}_client psdk)
endforeach(_in_FILE ${ARGN})
ENDFOREACH(_in_FILE ${ARGN})
endmacro (MACRO_IDL_FILES)
ENDMACRO (MACRO_IDL_FILES)
list(APPEND SOURCE
eventlogrpc.idl
lsa.idl
pnp.idl
svcctl.idl
wlansvc.idl)
file(GLOB_RECURSE SOURCE "*.idl")
LIST(REMOVE_ITEM SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/ms-dtyp.idl)
MACRO_IDL_FILES(${SOURCE})