Author: jgardou
Date: Tue Oct 26 17:42:02 2010
New Revision: 49289
URL:
http://svn.reactos.org/svn/reactos?rev=49289&view=rev
Log:
[CMAKE]
- midl support for building rpc server/client libraries
Modified:
branches/cmake-bringup/CMakeMacros.cmake
branches/cmake-bringup/gcc.cmake
branches/cmake-bringup/msc.cmake
Modified: branches/cmake-bringup/CMakeMacros.cmake
URL:
http://svn.reactos.org/svn/reactos/branches/cmake-bringup/CMakeMacros.cmake…
==============================================================================
--- branches/cmake-bringup/CMakeMacros.cmake [iso-8859-1] (original)
+++ branches/cmake-bringup/CMakeMacros.cmake [iso-8859-1] Tue Oct 26 17:42:02 2010
@@ -150,109 +150,122 @@
include_directories(BEFORE ${REACTOS_SOURCE_DIR}/lib/3rdparty/stlport/stlport)
set(IS_CPP 1)
endmacro()
-
-MACRO(add_livecd_target _targetname _dir )# optional parameter : _nameoncd
-
- get_target_property(FILENAME ${_targetname} LOCATION)
-
- if("${ARGN}" STREQUAL "")
- get_filename_component(_nameoncd ${FILENAME} NAME)
- else()
- set(_nameoncd ${ARGN})
- endif()
-
- add_custom_command(
- OUTPUT ${LIVECD_DIR}/${_dir}/${_nameoncd}
- COMMAND ${CMAKE_COMMAND} -E copy ${FILENAME} ${LIVECD_DIR}/${_dir}/${_nameoncd})
-
- add_custom_target(${_targetname}_livecd DEPENDS ${LIVECD_DIR}/${_dir}/${_nameoncd})
-
- add_dependencies(${_targetname}_livecd ${_targetname})
- add_dependencies(livecd ${_targetname}_livecd)
-ENDMACRO(add_livecd_target _targetname _dir _nameoncd)
-
-MACRO(add_livecd FILENAME _dir _nameoncd)
- add_custom_command(
- OUTPUT ${LIVECD_DIR}/${_dir}/${_nameoncd}
- DEPENDS ${FILENAME}
- COMMAND ${CMAKE_COMMAND} -E copy ${FILENAME} ${LIVECD_DIR}/${_dir}/${_nameoncd})
-
- add_custom_target(${_nameoncd}_livecd DEPENDS ${LIVECD_DIR}/${_dir}/${_nameoncd})
-
- add_dependencies(livecd ${_nameoncd}_livecd)
-ENDMACRO(add_livecd)
-
-macro(custom_incdefs)
- if(NOT DEFINED result_incs) #rpc_defines
- get_directory_property(rpc_defines COMPILE_DEFINITIONS)
- get_directory_property(rpc_includes INCLUDE_DIRECTORIES)
-
- foreach(arg ${rpc_defines})
- set(result_defs ${result_defs} -D${arg})
- endforeach(arg ${defines})
-
- foreach(arg ${rpc_includes})
- set(result_incs -I${arg} ${result_incs})
- endforeach(arg ${includes})
- endif()
-endmacro(custom_incdefs)
-
-macro(rpcproxy TARGET)
- custom_incdefs()
- list(APPEND SOURCE ${CMAKE_CURRENT_BINARY_DIR}/${TARGET}_proxy.dlldata.c)
-
- foreach(_in_FILE ${ARGN})
- get_filename_component(FILE ${_in_FILE} NAME_WE)
- add_custom_command(
- OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_p.h
${CMAKE_CURRENT_BINARY_DIR}/${FILE}_p.c
- COMMAND native-widl ${result_incs} ${result_defs} -m32 --win32 -h -H
${CMAKE_CURRENT_BINARY_DIR}/${FILE}_p.h -p -P ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_p.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}_p.c
- PROPERTIES GENERATED TRUE)
- list(APPEND SOURCE ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_p.c)
- list(APPEND IDLS ${CMAKE_CURRENT_SOURCE_DIR}/${FILE}.idl)
- list(APPEND PROXY_DEPENDS ${TARGET}_${FILE}_p)
- add_custom_target(${TARGET}_${FILE}_p
- DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_p.c)
- #add_dependencies(${TARGET}_proxy ${TARGET}_${FILE}_p)
- endforeach(_in_FILE ${ARGN})
-
- add_custom_command(
- OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${TARGET}_proxy.dlldata.c
- COMMAND native-widl ${result_incs} ${result_defs} -m32 --win32 --dlldata-only
--dlldata=${CMAKE_CURRENT_BINARY_DIR}/${TARGET}_proxy.dlldata.c ${IDLS}
- DEPENDS native-widl)
- set_source_files_properties(
- ${CMAKE_CURRENT_BINARY_DIR}/${TARGET}_proxy.dlldata.c
- PROPERTIES GENERATED TRUE)
-
- add_library(${TARGET}_proxy ${SOURCE})
- add_dependencies(${TARGET}_proxy psdk ${PROXY_DEPENDS})
-endmacro(rpcproxy)
-
-macro (MACRO_IDL_FILES)
- custom_incdefs()
- 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_dependencies(${FILE}_client psdk)
- endforeach(_in_FILE ${ARGN})
-
-endmacro (MACRO_IDL_FILES)
+
+MACRO(add_livecd_target _targetname _dir )# optional parameter : _nameoncd
+
+ get_target_property(FILENAME ${_targetname} LOCATION)
+
+ if("${ARGN}" STREQUAL "")
+ get_filename_component(_nameoncd ${FILENAME} NAME)
+ else()
+ set(_nameoncd ${ARGN})
+ endif()
+
+ add_custom_command(
+ OUTPUT ${LIVECD_DIR}/${_dir}/${_nameoncd}
+ COMMAND ${CMAKE_COMMAND} -E copy ${FILENAME} ${LIVECD_DIR}/${_dir}/${_nameoncd})
+
+ add_custom_target(${_targetname}_livecd DEPENDS ${LIVECD_DIR}/${_dir}/${_nameoncd})
+
+ add_dependencies(${_targetname}_livecd ${_targetname})
+ add_dependencies(livecd ${_targetname}_livecd)
+ENDMACRO(add_livecd_target _targetname _dir _nameoncd)
+
+MACRO(add_livecd FILENAME _dir _nameoncd)
+ add_custom_command(
+ OUTPUT ${LIVECD_DIR}/${_dir}/${_nameoncd}
+ DEPENDS ${FILENAME}
+ COMMAND ${CMAKE_COMMAND} -E copy ${FILENAME} ${LIVECD_DIR}/${_dir}/${_nameoncd})
+
+ add_custom_target(${_nameoncd}_livecd DEPENDS ${LIVECD_DIR}/${_dir}/${_nameoncd})
+
+ add_dependencies(livecd ${_nameoncd}_livecd)
+ENDMACRO(add_livecd)
+
+macro(custom_incdefs)
+ if(NOT DEFINED result_incs) #rpc_defines
+ get_directory_property(rpc_defines COMPILE_DEFINITIONS)
+ get_directory_property(rpc_includes INCLUDE_DIRECTORIES)
+
+ foreach(arg ${rpc_defines})
+ set(result_defs ${result_defs} -D${arg})
+ endforeach(arg ${defines})
+
+ foreach(arg ${rpc_includes})
+ set(result_incs -I${arg} ${result_incs})
+ endforeach(arg ${includes})
+ endif()
+endmacro(custom_incdefs)
+
+macro(rpcproxy TARGET)
+ custom_incdefs()
+ list(APPEND SOURCE ${CMAKE_CURRENT_BINARY_DIR}/${TARGET}_proxy.dlldata.c)
+
+ foreach(_in_FILE ${ARGN})
+ get_filename_component(FILE ${_in_FILE} NAME_WE)
+ add_custom_command(
+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_p.h
${CMAKE_CURRENT_BINARY_DIR}/${FILE}_p.c
+ COMMAND native-widl ${result_incs} ${result_defs} -m32 --win32 -h -H
${CMAKE_CURRENT_BINARY_DIR}/${FILE}_p.h -p -P ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_p.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}_p.c
+ PROPERTIES GENERATED TRUE)
+ list(APPEND SOURCE ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_p.c)
+ list(APPEND IDLS ${CMAKE_CURRENT_SOURCE_DIR}/${FILE}.idl)
+ list(APPEND PROXY_DEPENDS ${TARGET}_${FILE}_p)
+ add_custom_target(${TARGET}_${FILE}_p
+ DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_p.c)
+ #add_dependencies(${TARGET}_proxy ${TARGET}_${FILE}_p)
+ endforeach(_in_FILE ${ARGN})
+
+ add_custom_command(
+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${TARGET}_proxy.dlldata.c
+ COMMAND native-widl ${result_incs} ${result_defs} -m32 --win32 --dlldata-only
--dlldata=${CMAKE_CURRENT_BINARY_DIR}/${TARGET}_proxy.dlldata.c ${IDLS}
+ DEPENDS native-widl)
+ set_source_files_properties(
+ ${CMAKE_CURRENT_BINARY_DIR}/${TARGET}_proxy.dlldata.c
+ PROPERTIES GENERATED TRUE)
+
+ add_library(${TARGET}_proxy ${SOURCE})
+ add_dependencies(${TARGET}_proxy psdk ${PROXY_DEPENDS})
+endmacro(rpcproxy)
+
+macro (MACRO_IDL_FILES)
+ custom_incdefs()
+ 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 ${IDL_COMPILER} ${result_incs} ${result_defs} ${IDL_FLAGS}
${IDL_HEADER_ARG} ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_s.h ${IDL_SERVER_ARG}
${CMAKE_CURRENT_BINARY_DIR}/${FILE}_s.c ${CMAKE_CURRENT_SOURCE_DIR}/${FILE}.idl
+ DEPENDS ${_in_file})
+ 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 ${IDL_COMPILER} ${result_incs} ${result_defs} ${IDL_FLAGS}
${IDL_HEADER_ARG} ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_c.h ${IDL_CLIENT_ARG}
${CMAKE_CURRENT_BINARY_DIR}/${FILE}_c.c ${CMAKE_CURRENT_SOURCE_DIR}/${FILE}.idl
+ DEPENDS ${_in_file})
+ 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})
+
+endmacro (MACRO_IDL_FILES)
+
+macro(ADD_TYPELIB TARGET)
+ custom_incdefs()
+ foreach(SOURCE ${ARGN})
+ get_filename_component(FILE ${SOURCE} NAME_WE)
+ set(OBJECT ${CMAKE_CURRENT_BINARY_DIR}/${FILE}.tlb)
+ add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${FILE}.tlb
+ COMMAND ${IDL_COMPILER} ${result_incs} ${IDL_FLAGS}
${IDL_TYPELIB_ARG} ${CMAKE_CURRENT_BINARY_DIR}/${FILE}.tlb
${CMAKE_CURRENT_SOURCE_DIR}/${SOURCE}
+ DEPENDS ${SOURCE})
+ list(APPEND OBJECTS ${OBJECT})
+ endforeach()
+ add_custom_target(${TARGET} ALL DEPENDS ${OBJECTS})
+endmacro()
Modified: branches/cmake-bringup/gcc.cmake
URL:
http://svn.reactos.org/svn/reactos/branches/cmake-bringup/gcc.cmake?rev=492…
==============================================================================
--- branches/cmake-bringup/gcc.cmake [iso-8859-1] (original)
+++ branches/cmake-bringup/gcc.cmake [iso-8859-1] Tue Oct 26 17:42:02 2010
@@ -123,8 +123,6 @@
endif()
endmacro()
-endif()
-
macro(set_unicode)
add_definitions(-DUNICODE -D_UNICODE)
set(IS_UNICODE 1)
@@ -146,15 +144,14 @@
set(CMAKE_RC_COMPILE_OBJECT "<CMAKE_RC_COMPILER> ${result_defs}
${result_incs} -i <SOURCE> -O coff -o <OBJECT>")
endmacro()
-#typelib support
-macro(ADD_TYPELIB TARGET)
- foreach(SOURCE ${ARGN})
- get_filename_component(FILE ${SOURCE} NAME_WE)
- set(OBJECT ${CMAKE_CURRENT_BINARY_DIR}/${FILE}.tlb)
- add_custom_command(OUTPUT ${OBJECT}
- COMMAND native-widl -I${REACTOS_SOURCE_DIR}/include/dxsdk -I.
-I${REACTOS_SOURCE_DIR}/include -I${REACTOS_SOURCE_DIR}/include/psdk -m32 --win32 -t -T
${OBJECT} ${CMAKE_CURRENT_SOURCE_DIR}/${SOURCE}
- DEPENDS native-widl)
- list(APPEND OBJECTS ${OBJECT})
- endforeach()
- add_custom_target(${TARGET} ALL DEPENDS ${OBJECTS})
+#idl files support
+set(IDL_COMPILER native-widl)
+set(IDL_FLAGS -m32 --win32)
+set(IDL_HEADER_ARG -h -H) #.h
+set(IDL_TYPELIB_ARG -t -T) #.tlb
+set(IDL_SERVER_ARG -s -S) #.c for server library
+set(IDL_CLIENT_ARG -c -C) #.c for stub client library
+
endmacro()
+
+endif()
Modified: branches/cmake-bringup/msc.cmake
URL:
http://svn.reactos.org/svn/reactos/branches/cmake-bringup/msc.cmake?rev=492…
==============================================================================
--- branches/cmake-bringup/msc.cmake [iso-8859-1] (original)
+++ branches/cmake-bringup/msc.cmake [iso-8859-1] Tue Oct 26 17:42:02 2010
@@ -72,8 +72,6 @@
add_definitions(-DUNICODE -D_UNICODE)
endmacro()
-endif()
-
set(CMAKE_C_FLAGS_DEBUG_INIT "/D_DEBUG /MDd /Zi /Ob0 /Od")
set(CMAKE_CXX_FLAGS_DEBUG_INIT "/D_DEBUG /MDd /Zi /Ob0 /Od")
@@ -81,14 +79,12 @@
# dummy, this workaround is only needed in mingw due to lack of RC support in cmake
endmacro()
-#typelib support
-macro(ADD_TYPELIB TARGET)
- foreach(SOURCE ${ARGN})
- get_filename_component(FILE ${SOURCE} NAME_WE)
- set(OBJECT ${CMAKE_CURRENT_BINARY_DIR}/${FILE}.tlb)
- add_custom_command(OUTPUT ${OBJECT}
- COMMAND midl /I ${REACTOS_SOURCE_DIR}/include/dxsdk /I . /I
${REACTOS_SOURCE_DIR}/include /I ${REACTOS_SOURCE_DIR}/include/psdk /win32 /tlb ${OBJECT}
${CMAKE_CURRENT_SOURCE_DIR}/${SOURCE})
- list(APPEND OBJECTS ${OBJECT})
- endforeach()
- add_custom_target(${TARGET} ALL DEPENDS ${OBJECTS})
-endmacro()
+#idl files support
+set(IDL_COMPILER midl)
+set(IDL_FLAGS /win32)
+set(IDL_HEADER_ARG /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
+
+endif()