Author: akhaldi
Date: Tue Sep 28 13:32:41 2010
New Revision: 48914
URL:
http://svn.reactos.org/svn/reactos?rev=48914&view=rev
Log:
[CMAKE]
- Add typelib support macro and use it with stdole2. By Jerome Gardou.
Modified:
branches/cmake-bringup/gcc.cmake
branches/cmake-bringup/include/psdk/CMakeLists.txt
branches/cmake-bringup/include/psdk/stdole2.idl
branches/cmake-bringup/msc.cmake
Modified: branches/cmake-bringup/gcc.cmake
URL:
http://svn.reactos.org/svn/reactos/branches/cmake-bringup/gcc.cmake?rev=489…
==============================================================================
--- branches/cmake-bringup/gcc.cmake [iso-8859-1] (original)
+++ branches/cmake-bringup/gcc.cmake [iso-8859-1] Tue Sep 28 13:32:41 2010
@@ -108,3 +108,18 @@
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})
+ENDMACRO()
Modified: branches/cmake-bringup/include/psdk/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/branches/cmake-bringup/include/psdk/CMak…
==============================================================================
--- branches/cmake-bringup/include/psdk/CMakeLists.txt [iso-8859-1] (original)
+++ branches/cmake-bringup/include/psdk/CMakeLists.txt [iso-8859-1] Tue Sep 28 13:32:41
2010
@@ -109,12 +109,4 @@
ADD_INTERFACE_DEFINITIONS(psdk ${SOURCE})
-ADD_CUSTOM_COMMAND(
- OUTPUT ${REACTOS_BINARY_DIR}/include/psdk/stdole2.tlb
- 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
${REACTOS_BINARY_DIR}/include/psdk/stdole2.tlb
${REACTOS_SOURCE_DIR}/include/psdk/stdole2.idl
- DEPENDS native-widl
-)
-
-SET_SOURCE_FILES_PROPERTIES(${REACTOS_BINARY_DIR}/include/psdk/stdole2.tlb PROPERTIES
GENERATED TRUE)
-
-ADD_CUSTOM_TARGET(stdole2 ALL DEPENDS ${REACTOS_BINARY_DIR}/include/psdk/stdole2.tlb)
+ADD_TYPELIB(stdole2 stdole2.idl)
Modified: branches/cmake-bringup/include/psdk/stdole2.idl
URL:
http://svn.reactos.org/svn/reactos/branches/cmake-bringup/include/psdk/stdo…
==============================================================================
--- branches/cmake-bringup/include/psdk/stdole2.idl [iso-8859-1] (original)
+++ branches/cmake-bringup/include/psdk/stdole2.idl [iso-8859-1] Tue Sep 28 13:32:41 2010
@@ -61,7 +61,7 @@
void *pfnDeferredFillIn;
SCODE scode;
} EXCEPINFO;
-
+#ifndef __midl
[
odl,
uuid(00000000-0000-0000-C000-000000000046),
@@ -139,7 +139,7 @@
HRESULT Clone(
[out] IEnumVARIANT **ppenum);
}
-
+#endif /* !__midl */
typedef [uuid(66504301-BE0F-101A-8BBB-00AA00300CAB), public]
unsigned long OLE_COLOR;
Modified: branches/cmake-bringup/msc.cmake
URL:
http://svn.reactos.org/svn/reactos/branches/cmake-bringup/msc.cmake?rev=489…
==============================================================================
--- branches/cmake-bringup/msc.cmake [iso-8859-1] (original)
+++ branches/cmake-bringup/msc.cmake [iso-8859-1] Tue Sep 28 13:32:41 2010
@@ -64,4 +64,18 @@
macro(set_rc_compiler)
# dummy, this workaround is only needed in mingw due to lack of RC support in cmake
-endmacro()
+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()