Author: tkreuzer
Date: Thu Mar 29 15:57:55 2012
New Revision: 56279
URL:
http://svn.reactos.org/svn/reactos?rev=56279&view=rev
Log:
[CMAKE]
Cleanup *idl-support.cmake files a bit more
Modified:
trunk/reactos/cmake/midl-support.cmake
trunk/reactos/cmake/widl-support.cmake
Modified: trunk/reactos/cmake/midl-support.cmake
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/cmake/midl-support.cmake?r…
==============================================================================
--- trunk/reactos/cmake/midl-support.cmake [iso-8859-1] (original)
+++ trunk/reactos/cmake/midl-support.cmake [iso-8859-1] Thu Mar 29 15:57:55 2012
@@ -1,21 +1,12 @@
#idl files support
- set(IDL_COMPILER midl)
- set(IDL_HEADER_ARG /h) #.h
- set(IDL_HEADER_ARG2 /h) #.h
- set(IDL_TYPELIB_ARG /tlb) #.tlb
- set(IDL_SERVER_ARG /sstub) #.c for stub server library
- set(IDL_CLIENT_ARG /cstub) #.c for stub client library
- set(IDL_PROXY_ARG /proxy)
- set(IDL_INTERFACE_ARG /iid)
- if(ARCH MATCHES i386)
- set(IDL_FLAGS /nologo /win32 /no_def_idir)
- elseif(ARCH MATCHES amd64)
- set(IDL_FLAGS /nologo /amd64 /no_def_idir)
- else()
- set(IDL_FLAGS /nologo /no_def_idir)
- endif()
- set(IDL_DEPENDS "")
+if(ARCH MATCHES i386)
+ set(IDL_FLAGS /nologo /win32 /no_def_idir)
+elseif(ARCH MATCHES amd64)
+ set(IDL_FLAGS /nologo /amd64 /no_def_idir)
+else()
+ set(IDL_FLAGS /nologo /no_def_idir)
+endif()
function(add_typelib)
get_includes(INCLUDES)
@@ -24,9 +15,8 @@
get_filename_component(NAME ${FILE} NAME_WE)
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${NAME}.tlb
- COMMAND ${IDL_COMPILER} ${INCLUDES} ${DEFINES} ${IDL_FLAGS}
${IDL_TYPELIB_ARG} ${CMAKE_CURRENT_BINARY_DIR}/${NAME}.tlb
${CMAKE_CURRENT_SOURCE_DIR}/${FILE}
- DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${FILE} ${IDL_DEPENDS})
- list(APPEND OBJECTS ${CMAKE_CURRENT_BINARY_DIR}/${NAME}.tlb)
+ COMMAND midl ${INCLUDES} ${DEFINES} ${IDL_FLAGS} /tlb
${CMAKE_CURRENT_BINARY_DIR}/${NAME}.tlb ${CMAKE_CURRENT_SOURCE_DIR}/${FILE}
+ DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${FILE})
endforeach()
endfunction()
@@ -38,8 +28,8 @@
set(HEADER ${CMAKE_CURRENT_BINARY_DIR}/${NAME}.h)
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${NAME}.h
- COMMAND ${IDL_COMPILER} ${INCLUDES} ${DEFINES} ${IDL_FLAGS} ${IDL_HEADER_ARG}
${CMAKE_CURRENT_BINARY_DIR}/${NAME}.h ${CMAKE_CURRENT_SOURCE_DIR}/${FILE}
- DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${FILE} ${IDL_DEPENDS})
+ COMMAND midl ${INCLUDES} ${DEFINES} ${IDL_FLAGS} /h
${CMAKE_CURRENT_BINARY_DIR}/${NAME}.h ${CMAKE_CURRENT_SOURCE_DIR}/${FILE}
+ DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${FILE})
list(APPEND HEADERS ${HEADER})
endforeach()
add_custom_target(${TARGET} DEPENDS ${HEADERS})
@@ -48,38 +38,17 @@
function(add_rpcproxy_files)
get_includes(INCLUDES)
get_defines(DEFINES)
-
- if(MSVC)
- set(DLLDATA_ARG /dlldata ${CMAKE_CURRENT_BINARY_DIR}/proxy.dlldata.c)
- set(OUTPUT_FILES "")
- endif()
+ set(OUTPUT_FILES "")
foreach(FILE ${ARGN})
get_filename_component(NAME ${FILE} NAME_WE)
- if(MSVC)
- add_custom_command(
- OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${NAME}_p.c
${CMAKE_CURRENT_BINARY_DIR}/${NAME}_p.h ${CMAKE_CURRENT_BINARY_DIR}/proxy.dlldata.c
- COMMAND midl ${INCLUDES} ${DEFINES} ${IDL_FLAGS} /proxy
${CMAKE_CURRENT_BINARY_DIR}/${NAME}_p.c /h ${NAME}_p.h ${CMAKE_CURRENT_SOURCE_DIR}/${FILE}
/dlldata ${CMAKE_CURRENT_BINARY_DIR}/proxy.dlldata.c
- DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${FILE} ${OUTPUT_FILES})
- list(APPEND OUTPUT_FILES ${CMAKE_CURRENT_BINARY_DIR}/${NAME}_p.c)
- list(APPEND OUTPUT_FILES ${CMAKE_CURRENT_BINARY_DIR}/${NAME}_p.h)
- else()
- list(APPEND IDLS ${CMAKE_CURRENT_SOURCE_DIR}/${FILE})
- add_custom_command(
- OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${NAME}_p.c
${CMAKE_CURRENT_BINARY_DIR}/${NAME}_p.h
- COMMAND native-widl ${INCLUDES} ${DEFINES} ${IDL_FLAGS} -p -o
${CMAKE_CURRENT_BINARY_DIR}/${NAME}_p.c -h -H ${NAME}_p.h
${CMAKE_CURRENT_SOURCE_DIR}/${FILE}
- DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${FILE} native-widl)
- endif()
+ add_custom_command(
+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${NAME}_p.c
${CMAKE_CURRENT_BINARY_DIR}/${NAME}_p.h ${CMAKE_CURRENT_BINARY_DIR}/proxy.dlldata.c
+ COMMAND midl ${INCLUDES} ${DEFINES} ${IDL_FLAGS} /proxy
${CMAKE_CURRENT_BINARY_DIR}/${NAME}_p.c /h ${NAME}_p.h ${CMAKE_CURRENT_SOURCE_DIR}/${FILE}
/dlldata ${CMAKE_CURRENT_BINARY_DIR}/proxy.dlldata.c
+ DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${FILE} ${OUTPUT_FILES})
+ list(APPEND OUTPUT_FILES ${CMAKE_CURRENT_BINARY_DIR}/${NAME}_p.c)
+ list(APPEND OUTPUT_FILES ${CMAKE_CURRENT_BINARY_DIR}/${NAME}_p.h)
endforeach()
-
- # Extra pass to generate dlldata
- if(MSVC)
- set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/proxy.dlldata.c
PROPERTIES GENERATED TRUE)
- else()
- add_custom_command(
- OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/proxy.dlldata.c
- COMMAND ${IDL_COMPILER} ${INCLUDES} ${DEFINES} ${IDL_FLAGS} --dlldata-only -o
${CMAKE_CURRENT_BINARY_DIR}/proxy.dlldata.c ${IDLS}
- DEPENDS ${IDLS} ${IDL_DEPENDS})
- endif()
+ set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/proxy.dlldata.c PROPERTIES
GENERATED TRUE)
endfunction()
function(add_rpc_files __type)
@@ -87,24 +56,24 @@
get_defines(DEFINES)
# Is it a client or server module?
if(__type STREQUAL server)
- set(__server_client ${IDL_SERVER_ARG})
+ set(__server_client /sstub)
set(__suffix _s)
elseif(__type STREQUAL client)
- set(__server_client ${IDL_CLIENT_ARG})
+ set(__server_client /cstub)
set(__suffix _c)
else()
message(FATAL_ERROR "Please pass either server or client as argument to
add_rpc_files")
endif()
foreach(FILE ${ARGN})
get_filename_component(__name ${FILE} NAME_WE)
- set(__name ${__name}${__suffix})
+ set(__name ${CMAKE_CURRENT_BINARY_DIR}/${__name}${__suffix})
if(NOT IS_ABSOLUTE ${FILE})
set(FILE ${CMAKE_CURRENT_SOURCE_DIR}/${FILE})
endif()
add_custom_command(
- OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${__name}.c
${CMAKE_CURRENT_BINARY_DIR}/${__name}.h
- COMMAND ${IDL_COMPILER} ${INCLUDES} ${DEFINES} ${IDL_FLAGS}
${IDL_HEADER_ARG2} ${CMAKE_CURRENT_BINARY_DIR}/${__name}.h ${__server_client}
${CMAKE_CURRENT_BINARY_DIR}/${__name}.c ${FILE}
- DEPENDS ${FILE} ${IDL_DEPENDS})
+ OUTPUT ${__name}.c ${__name}.h
+ COMMAND midl ${INCLUDES} ${DEFINES} ${IDL_FLAGS} /h ${__name}.h
${__server_client} ${__name}.c ${FILE}
+ DEPENDS ${FILE})
endforeach()
endfunction()
@@ -120,8 +89,8 @@
get_filename_component(NAME ${IDL_FILE} NAME_WE)
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${NAME}_i.c
- COMMAND ${IDL_COMPILER} ${INCLUDES} ${DEFINES} ${IDL_FLAGS} ${IDL_INTERFACE_ARG}
${CMAKE_CURRENT_BINARY_DIR}/${NAME}_i.c ${IDL_FILE_FULL}
- DEPENDS ${IDL_FILE_FULL} ${IDL_DEPENDS})
+ COMMAND midl ${INCLUDES} ${DEFINES} ${IDL_FLAGS} /iid
${CMAKE_CURRENT_BINARY_DIR}/${NAME}_i.c ${IDL_FILE_FULL}
+ DEPENDS ${IDL_FILE_FULL})
set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/${NAME}_i.c PROPERTIES
GENERATED TRUE)
endfunction()
Modified: trunk/reactos/cmake/widl-support.cmake
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/cmake/widl-support.cmake?r…
==============================================================================
--- trunk/reactos/cmake/widl-support.cmake [iso-8859-1] (original)
+++ trunk/reactos/cmake/widl-support.cmake [iso-8859-1] Thu Mar 29 15:57:55 2012
@@ -1,21 +1,12 @@
#idl files support
- set(IDL_COMPILER native-widl)
- set(IDL_HEADER_ARG -h -o) #.h
- set(IDL_HEADER_ARG2 -h -H) #.h
- set(IDL_TYPELIB_ARG -t -o) #.tlb
- set(IDL_SERVER_ARG -Oif -s -o) #.c for server library
- set(IDL_CLIENT_ARG -Oif -c -o) #.c for stub client library
- set(IDL_PROXY_ARG -p -o)
- set(IDL_INTERFACE_ARG -u -o)
- if(ARCH MATCHES i386)
- set(IDL_FLAGS -m32 --win32)
- elseif(ARCH MATCHES amd64)
- set(IDL_FLAGS -m64 --win64)
- else()
- set(IDL_FLAGS "")
- endif()
- set(IDL_DEPENDS native-widl)
+if(ARCH MATCHES i386)
+ set(IDL_FLAGS -m32 --win32)
+elseif(ARCH MATCHES amd64)
+ set(IDL_FLAGS -m64 --win64)
+else()
+ set(IDL_FLAGS "")
+endif()
function(add_typelib)
get_includes(INCLUDES)
@@ -24,8 +15,8 @@
get_filename_component(NAME ${FILE} NAME_WE)
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${NAME}.tlb
- COMMAND ${IDL_COMPILER} ${INCLUDES} ${DEFINES} ${IDL_FLAGS}
${IDL_TYPELIB_ARG} ${CMAKE_CURRENT_BINARY_DIR}/${NAME}.tlb
${CMAKE_CURRENT_SOURCE_DIR}/${FILE}
- DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${FILE} ${IDL_DEPENDS})
+ COMMAND native-widl ${INCLUDES} ${DEFINES} ${IDL_FLAGS} -t -o
${CMAKE_CURRENT_BINARY_DIR}/${NAME}.tlb ${CMAKE_CURRENT_SOURCE_DIR}/${FILE}
+ DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${FILE} native-widl)
list(APPEND OBJECTS ${CMAKE_CURRENT_BINARY_DIR}/${NAME}.tlb)
endforeach()
endfunction()
@@ -38,8 +29,8 @@
set(HEADER ${CMAKE_CURRENT_BINARY_DIR}/${NAME}.h)
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${NAME}.h
- COMMAND ${IDL_COMPILER} ${INCLUDES} ${DEFINES} ${IDL_FLAGS} ${IDL_HEADER_ARG}
${CMAKE_CURRENT_BINARY_DIR}/${NAME}.h ${CMAKE_CURRENT_SOURCE_DIR}/${FILE}
- DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${FILE} ${IDL_DEPENDS})
+ COMMAND native-widl ${INCLUDES} ${DEFINES} ${IDL_FLAGS} -h -o
${CMAKE_CURRENT_BINARY_DIR}/${NAME}.h ${CMAKE_CURRENT_SOURCE_DIR}/${FILE}
+ DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${FILE} native-widl)
list(APPEND HEADERS ${HEADER})
endforeach()
add_custom_target(${TARGET} DEPENDS ${HEADERS})
@@ -49,37 +40,20 @@
get_includes(INCLUDES)
get_defines(DEFINES)
- if(MSVC)
- set(DLLDATA_ARG /dlldata ${CMAKE_CURRENT_BINARY_DIR}/proxy.dlldata.c)
- set(OUTPUT_FILES "")
- endif()
foreach(FILE ${ARGN})
get_filename_component(NAME ${FILE} NAME_WE)
- if(MSVC)
- add_custom_command(
- OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${NAME}_p.c
${CMAKE_CURRENT_BINARY_DIR}/${NAME}_p.h ${CMAKE_CURRENT_BINARY_DIR}/proxy.dlldata.c
- COMMAND midl ${INCLUDES} ${DEFINES} ${IDL_FLAGS} /proxy
${CMAKE_CURRENT_BINARY_DIR}/${NAME}_p.c /h ${NAME}_p.h ${CMAKE_CURRENT_SOURCE_DIR}/${FILE}
/dlldata ${CMAKE_CURRENT_BINARY_DIR}/proxy.dlldata.c
- DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${FILE} ${OUTPUT_FILES})
- list(APPEND OUTPUT_FILES ${CMAKE_CURRENT_BINARY_DIR}/${NAME}_p.c)
- list(APPEND OUTPUT_FILES ${CMAKE_CURRENT_BINARY_DIR}/${NAME}_p.h)
- else()
list(APPEND IDLS ${CMAKE_CURRENT_SOURCE_DIR}/${FILE})
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${NAME}_p.c
${CMAKE_CURRENT_BINARY_DIR}/${NAME}_p.h
COMMAND native-widl ${INCLUDES} ${DEFINES} ${IDL_FLAGS} -p -o
${CMAKE_CURRENT_BINARY_DIR}/${NAME}_p.c -h -H ${NAME}_p.h
${CMAKE_CURRENT_SOURCE_DIR}/${FILE}
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${FILE} native-widl)
- endif()
endforeach()
# Extra pass to generate dlldata
- if(MSVC)
- set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/proxy.dlldata.c
PROPERTIES GENERATED TRUE)
- else()
- add_custom_command(
- OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/proxy.dlldata.c
- COMMAND ${IDL_COMPILER} ${INCLUDES} ${DEFINES} ${IDL_FLAGS} --dlldata-only -o
${CMAKE_CURRENT_BINARY_DIR}/proxy.dlldata.c ${IDLS}
- DEPENDS ${IDLS} ${IDL_DEPENDS})
- endif()
+ add_custom_command(
+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/proxy.dlldata.c
+ COMMAND native-widl ${INCLUDES} ${DEFINES} ${IDL_FLAGS} --dlldata-only -o
${CMAKE_CURRENT_BINARY_DIR}/proxy.dlldata.c ${IDLS}
+ DEPENDS ${IDLS} native-widl)
endfunction()
function(add_rpc_files __type)
@@ -87,24 +61,24 @@
get_defines(DEFINES)
# Is it a client or server module?
if(__type STREQUAL server)
- set(__server_client ${IDL_SERVER_ARG})
+ set(__server_client -Oif -s -o)
set(__suffix _s)
elseif(__type STREQUAL client)
- set(__server_client ${IDL_CLIENT_ARG})
+ set(__server_client -Oif -c -o)
set(__suffix _c)
else()
message(FATAL_ERROR "Please pass either server or client as argument to
add_rpc_files")
endif()
foreach(FILE ${ARGN})
get_filename_component(__name ${FILE} NAME_WE)
- set(__name ${__name}${__suffix})
+ set(__name ${CMAKE_CURRENT_BINARY_DIR}/${__name}${__suffix})
if(NOT IS_ABSOLUTE ${FILE})
set(FILE ${CMAKE_CURRENT_SOURCE_DIR}/${FILE})
endif()
add_custom_command(
- OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${__name}.c
${CMAKE_CURRENT_BINARY_DIR}/${__name}.h
- COMMAND ${IDL_COMPILER} ${INCLUDES} ${DEFINES} ${IDL_FLAGS}
${IDL_HEADER_ARG2} ${CMAKE_CURRENT_BINARY_DIR}/${__name}.h ${__server_client}
${CMAKE_CURRENT_BINARY_DIR}/${__name}.c ${FILE}
- DEPENDS ${FILE} ${IDL_DEPENDS})
+ OUTPUT ${__name}.c ${__name}.h
+ COMMAND native-widl ${INCLUDES} ${DEFINES} ${IDL_FLAGS} -h -H ${__name}.h
${__server_client} ${__name}.c ${FILE}
+ DEPENDS ${FILE} native-widl)
endforeach()
endfunction()
@@ -120,8 +94,8 @@
get_filename_component(NAME ${IDL_FILE} NAME_WE)
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${NAME}_i.c
- COMMAND ${IDL_COMPILER} ${INCLUDES} ${DEFINES} ${IDL_FLAGS} ${IDL_INTERFACE_ARG}
${CMAKE_CURRENT_BINARY_DIR}/${NAME}_i.c ${IDL_FILE_FULL}
- DEPENDS ${IDL_FILE_FULL} ${IDL_DEPENDS})
+ COMMAND native-widl ${INCLUDES} ${DEFINES} ${IDL_FLAGS} -u -o
${CMAKE_CURRENT_BINARY_DIR}/${NAME}_i.c ${IDL_FILE_FULL}
+ DEPENDS ${IDL_FILE_FULL} native-widl)
set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/${NAME}_i.c PROPERTIES
GENERATED TRUE)
endfunction()