[ros-diffs] [jgardou] 54813: [CMAKE] - add module module type, which is basically a DLL without entry point and use it for typelibs - get rid of custom targets for generating .tlb files and use source file dep...

jgardou at svn.reactos.org jgardou at svn.reactos.org
Tue Jan 3 00:17:19 UTC 2012


Author: jgardou
Date: Tue Jan  3 00:17:18 2012
New Revision: 54813

URL: http://svn.reactos.org/svn/reactos?rev=54813&view=rev
Log:
[CMAKE]
- add module module type, which is basically a DLL without entry point and use it for typelibs
- get rid of custom targets for generating .tlb files and use source file dependencies instead

Modified:
    trunk/reactos/cmake/CMakeMacros.cmake
    trunk/reactos/cmake/idl-support.cmake
    trunk/reactos/dll/win32/jscript/CMakeLists.txt
    trunk/reactos/dll/win32/mshtml.tlb/CMakeLists.txt
    trunk/reactos/dll/win32/msi/CMakeLists.txt
    trunk/reactos/dll/win32/msxml3/CMakeLists.txt
    trunk/reactos/dll/win32/pstorec/CMakeLists.txt
    trunk/reactos/dll/win32/shdocvw/CMakeLists.txt
    trunk/reactos/dll/win32/stdole2.tlb/CMakeLists.txt
    trunk/reactos/dll/win32/stdole32.tlb/CMakeLists.txt
    trunk/reactos/include/psdk/CMakeLists.txt

Modified: trunk/reactos/cmake/CMakeMacros.cmake
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/cmake/CMakeMacros.cmake?rev=54813&r1=54812&r2=54813&view=diff
==============================================================================
--- trunk/reactos/cmake/CMakeMacros.cmake [iso-8859-1] (original)
+++ trunk/reactos/cmake/CMakeMacros.cmake [iso-8859-1] Tue Jan  3 00:17:18 2012
@@ -294,7 +294,8 @@
         set(__subsystem console)
     elseif(${TYPE} STREQUAL win32gui)
         set(__subsystem windows)
-    elseif(NOT ((${TYPE} STREQUAL win32dll) OR (${TYPE} STREQUAL win32ocx) OR (${TYPE} STREQUAL cpl)))
+    elseif(NOT ((${TYPE} STREQUAL win32dll) OR (${TYPE} STREQUAL win32ocx)
+            OR (${TYPE} STREQUAL cpl) OR (${TYPE} STREQUAL module)))
         message(FATAL_ERROR "Unknown type ${TYPE} for module ${MODULE}")
     endif()
 
@@ -336,6 +337,8 @@
     elseif(${TYPE} STREQUAL nativedll)
         set(__entrypoint DllMain)
         set(__entrystack 12)
+    elseif(${TYPE} STREQUAL module)
+        set(__entrypoint 0)
     endif()
 
     if(DEFINED __entrypoint)

Modified: trunk/reactos/cmake/idl-support.cmake
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/cmake/idl-support.cmake?rev=54813&r1=54812&r2=54813&view=diff
==============================================================================
--- trunk/reactos/cmake/idl-support.cmake [iso-8859-1] (original)
+++ trunk/reactos/cmake/idl-support.cmake [iso-8859-1] Tue Jan  3 00:17:18 2012
@@ -53,7 +53,7 @@
     set(${OUTPUT_VAR} ${__tmp_var} PARENT_SCOPE)
 endfunction()
 
-function(add_typelib TARGET)
+function(add_typelib)
     get_includes(INCLUDES)
     get_defines(DEFINES)
     foreach(FILE ${ARGN})
@@ -64,7 +64,6 @@
             DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${FILE} ${IDL_DEPENDS})
         list(APPEND OBJECTS ${CMAKE_CURRENT_BINARY_DIR}/${NAME}.tlb)
     endforeach()
-    add_custom_target(${TARGET} ALL DEPENDS ${OBJECTS})
 endfunction()
 
 function(add_idl_headers TARGET)

Modified: trunk/reactos/dll/win32/jscript/CMakeLists.txt
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/CMakeLists.txt?rev=54813&r1=54812&r2=54813&view=diff
==============================================================================
--- trunk/reactos/dll/win32/jscript/CMakeLists.txt [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/jscript/CMakeLists.txt [iso-8859-1] Tue Jan  3 00:17:18 2012
@@ -1,7 +1,5 @@
 
-add_typelib(jsglobal jsglobal.idl)
-
-add_dependencies(jsglobal stdole2)
+add_typelib(jsglobal.idl)
 
 remove_definitions(-D_WIN32_WINNT=0x502)
 add_definitions(-D_WIN32_WINNT=0x600)
@@ -60,9 +58,12 @@
     ntdll)
 
 add_pch(jscript jscript.h)
-add_dependencies(jscript jsglobal)
+# jsglobal.tlb needs stdole2.tlb
+add_dependencies(jscript stdole2)
 add_cd_file(TARGET jscript DESTINATION reactos/system32 FOR all)
 
 if(NOT MSVC)
     allow_warnings(jscript)
 endif()
+
+set_source_files_properties(rsrc.rc PROPERTIES OBJECT_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/jsglobal.tlb)

Modified: trunk/reactos/dll/win32/mshtml.tlb/CMakeLists.txt
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mshtml.tlb/CMakeLists.txt?rev=54813&r1=54812&r2=54813&view=diff
==============================================================================
--- trunk/reactos/dll/win32/mshtml.tlb/CMakeLists.txt [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/mshtml.tlb/CMakeLists.txt [iso-8859-1] Tue Jan  3 00:17:18 2012
@@ -1,6 +1,5 @@
 
-add_typelib(mshtml__tlb mshtml_tlb.idl)
-add_dependencies(mshtml__tlb stdole2)
+add_typelib(mshtml_tlb.idl)
 
 add_definitions(-D__WINESRC__)
 
@@ -8,7 +7,9 @@
 
 add_library(mshtml.tlb SHARED rsrc.rc)
 
-set_module_type(mshtml.tlb win32dll ENTRYPOINT 0 )
+set_source_files_properties(rsrc.rc PROPERTIES OBJECT_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/mshtml_tlb.tlb)
+
+set_module_type(mshtml.tlb module)
 set_target_properties(mshtml.tlb PROPERTIES SUFFIX "")
-add_dependencies(mshtml.tlb mshtml__tlb)
+add_dependencies(mshtml.tlb stdole2)
 add_cd_file(TARGET mshtml.tlb DESTINATION reactos/system32 FOR all)

Modified: trunk/reactos/dll/win32/msi/CMakeLists.txt
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msi/CMakeLists.txt?rev=54813&r1=54812&r2=54813&view=diff
==============================================================================
--- trunk/reactos/dll/win32/msi/CMakeLists.txt [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/msi/CMakeLists.txt [iso-8859-1] Tue Jan  3 00:17:18 2012
@@ -70,10 +70,13 @@
 add_library(msi SHARED ${SOURCE})
 
 add_idl_headers(msi_idlheader msiserver.idl)
-add_typelib(msi_tlb msiserver.idl)
+add_typelib(msiserver.idl)
+
+set_source_files_properties(msi.rc PROPERTIES OBJECT_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/msiserver.tlb)
+
 set_module_type(msi win32dll)
 target_link_libraries(msi uuid ${PSEH_LIB} wine)
-add_dependencies(msi msi_idlheader msi_tlb)
+add_dependencies(msi msi_idlheader)
 add_delay_importlibs(msi odbccp32)
 
 add_importlibs(msi

Modified: trunk/reactos/dll/win32/msxml3/CMakeLists.txt
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msxml3/CMakeLists.txt?rev=54813&r1=54812&r2=54813&view=diff
==============================================================================
--- trunk/reactos/dll/win32/msxml3/CMakeLists.txt [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/msxml3/CMakeLists.txt [iso-8859-1] Tue Jan  3 00:17:18 2012
@@ -1,6 +1,3 @@
-
-add_typelib(msxml3_v1 msxml3_v1.idl)
-add_dependencies(msxml3_v1 stdole2)
 
 remove_definitions(-D_WIN32_WINNT=0x502)
 add_definitions(-D_WIN32_WINNT=0x601)
@@ -19,6 +16,8 @@
 set_rc_compiler()
 
 spec2def(msxml3.dll msxml3.spec)
+
+add_typelib(msxml3_v1.idl)
 
 list(APPEND SOURCE
     attribute.c
@@ -59,6 +58,8 @@
 
 set_module_type(msxml3 win32dll)
 
+set_source_files_properties(version.rc PROPERTIES OBJECT_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/msxml3_v1.tlb)
+
 target_link_libraries(msxml3
     libxml2
     uuid
@@ -87,5 +88,7 @@
     kernel32
     ntdll)
 
-add_dependencies(msxml3 msxml3_v1)
+# msxml3_v1.tlb needs stdole2.tlb
+add_dependencies(msxml3 stdole2)
+
 add_cd_file(TARGET msxml3 DESTINATION reactos/system32 FOR all)

Modified: trunk/reactos/dll/win32/pstorec/CMakeLists.txt
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/pstorec/CMakeLists.txt?rev=54813&r1=54812&r2=54813&view=diff
==============================================================================
--- trunk/reactos/dll/win32/pstorec/CMakeLists.txt [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/pstorec/CMakeLists.txt [iso-8859-1] Tue Jan  3 00:17:18 2012
@@ -1,6 +1,5 @@
 
-add_typelib(pstorec_tlb pstorec_tlb.idl)
-add_dependencies(pstorec_tlb stdole2)
+add_typelib(pstorec_tlb.idl)
 
 add_definitions(-D__WINESRC__)
 
@@ -13,10 +12,13 @@
     ${CMAKE_CURRENT_BINARY_DIR}/pstorec_stubs.c
     ${CMAKE_CURRENT_BINARY_DIR}/pstorec.def)
 
+set_source_files_properties(rsrc.rc PROPERTIES OBJECT_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/pstorec_tlb.tlb)
+
 add_library(pstorec SHARED ${SOURCE})
 
 set_module_type(pstorec win32dll)
 target_link_libraries(pstorec uuid wine)
 add_importlibs(pstorec msvcrt kernel32 ntdll)
-add_dependencies(pstorec pstorec_tlb)
+# pstorec_tlb.tlb needs stdole2.tlb
+add_dependencies(pstorec stdole2)
 add_cd_file(TARGET pstorec DESTINATION reactos/system32 FOR all)

Modified: trunk/reactos/dll/win32/shdocvw/CMakeLists.txt
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shdocvw/CMakeLists.txt?rev=54813&r1=54812&r2=54813&view=diff
==============================================================================
--- trunk/reactos/dll/win32/shdocvw/CMakeLists.txt [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shdocvw/CMakeLists.txt [iso-8859-1] Tue Jan  3 00:17:18 2012
@@ -1,6 +1,5 @@
 
-add_typelib(shdocvw_v1 shdocvw_v1.idl)
-add_dependencies(shdocvw_v1 stdole2)
+add_typelib(shdocvw_v1.idl)
 
 add_definitions(-D_SHDOCVW_)
 include_directories(${REACTOS_SOURCE_DIR}/include/reactos/wine)
@@ -32,6 +31,8 @@
     ${CMAKE_CURRENT_BINARY_DIR}/shdocvw_stubs.c
     ${CMAKE_CURRENT_BINARY_DIR}/shdocvw.def)
 
+set_source_files_properties(shdocvw.rc PROPERTIES OBJECT_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/shdocvw_v1.tlb)
+
 add_library(shdocvw SHARED ${SOURCE})
 set_module_type(shdocvw win32dll)
 target_link_libraries(shdocvw uuid wine)
@@ -49,7 +50,9 @@
     kernel32
     ntdll)
 
-add_dependencies(shdocvw shdocvw_v1)
+# shdocvw_v1.tlb needs stdole2.tlb
+add_dependencies(shdocvw stdole2)
+
 add_pch(shdocvw shdocvw.h)
 add_cd_file(TARGET shdocvw DESTINATION reactos/system32 FOR all)
 add_importlib_target(shdocvw.spec)

Modified: trunk/reactos/dll/win32/stdole2.tlb/CMakeLists.txt
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/stdole2.tlb/CMakeLists.txt?rev=54813&r1=54812&r2=54813&view=diff
==============================================================================
--- trunk/reactos/dll/win32/stdole2.tlb/CMakeLists.txt [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/stdole2.tlb/CMakeLists.txt [iso-8859-1] Tue Jan  3 00:17:18 2012
@@ -2,17 +2,19 @@
 add_definitions(-D__WINESRC__)
 include_directories(${REACTOS_SOURCE_DIR}/include/reactos/wine)
 
-add_typelib(std_ole_v2 std_ole_v2.idl)
+add_typelib(std_ole_v2.idl)
 
 spec2def(stdole2.tlb stdole2.tlb.spec)
 
 list(APPEND SOURCE
     rsrc.rc
     ${CMAKE_CURRENT_BINARY_DIR}/stdole2.def)
+    
+set_source_files_properties(rsrc.rc PROPERTIES OBJECT_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/std_ole_v2.tlb)
 
 add_library(stdole2.tlb SHARED ${SOURCE})
 
-set_module_type(stdole2.tlb win32dll ENTRYPOINT 0 )
+set_module_type(stdole2.tlb module)
 set_target_properties(stdole2.tlb PROPERTIES SUFFIX "")
-add_dependencies(stdole2.tlb std_ole_v2)
+
 add_cd_file(TARGET stdole2.tlb DESTINATION reactos/system32 FOR all)

Modified: trunk/reactos/dll/win32/stdole32.tlb/CMakeLists.txt
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/stdole32.tlb/CMakeLists.txt?rev=54813&r1=54812&r2=54813&view=diff
==============================================================================
--- trunk/reactos/dll/win32/stdole32.tlb/CMakeLists.txt [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/stdole32.tlb/CMakeLists.txt [iso-8859-1] Tue Jan  3 00:17:18 2012
@@ -2,18 +2,19 @@
 add_definitions(-D__WINESRC__)
 include_directories(${REACTOS_SOURCE_DIR}/include/reactos/wine)
 
-add_typelib(std_ole_v1 std_ole_v1.idl)
+add_typelib(std_ole_v1.idl)
 
 spec2def(stdole32.tlb stdole32.tlb.spec)
 
 list(APPEND SOURCE
     rsrc.rc
     ${CMAKE_CURRENT_BINARY_DIR}/stdole32.def)
+    
+set_source_files_properties(rsrc.rc PROPERTIES OBJECT_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/std_ole_v1.tlb)
 
 add_library(stdole32.tlb SHARED ${SOURCE})
 
-set_module_type(stdole32.tlb win32dll ENTRYPOINT 0 )
+set_module_type(stdole32.tlb module)
 set_target_properties(stdole32.tlb PROPERTIES SUFFIX "")
 
-add_dependencies(stdole32.tlb std_ole_v1)
 add_cd_file(TARGET stdole32.tlb DESTINATION reactos/system32 FOR all)

Modified: trunk/reactos/include/psdk/CMakeLists.txt
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/CMakeLists.txt?rev=54813&r1=54812&r2=54813&view=diff
==============================================================================
--- trunk/reactos/include/psdk/CMakeLists.txt [iso-8859-1] (original)
+++ trunk/reactos/include/psdk/CMakeLists.txt [iso-8859-1] Tue Jan  3 00:17:18 2012
@@ -116,7 +116,8 @@
 
 add_idl_headers(psdk ${SOURCE})
 
-add_typelib(stdole2 stdole2.idl)
+add_typelib(stdole2.idl)
+add_custom_target(stdole2 DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/stdole2.tlb)
 
 add_iid_library(wuguid wuapi.idl)
 add_iid_library(xml_uuids msxml2.idl)




More information about the Ros-diffs mailing list