[ros-diffs] [tkreuzer] 49629: [CMAKE] Add a new macro set_export_spec(), that replaces the use of spec2def + adding the generated def file to the sources Remove EXTERNAL_OBJECT TRUE property for the generated ...

tkreuzer at svn.reactos.org tkreuzer at svn.reactos.org
Fri Nov 19 14:21:19 UTC 2010


Author: tkreuzer
Date: Fri Nov 19 14:21:18 2010
New Revision: 49629

URL: http://svn.reactos.org/svn/reactos?rev=49629&view=rev
Log:
[CMAKE]
Add a new macro set_export_spec(), that replaces the use of spec2def + adding the generated def file to the sources
Remove EXTERNAL_OBJECT TRUE property for the generated def files.

Modified:
    branches/cmake-bringup/dll/win32/acledit/CMakeLists.txt
    branches/cmake-bringup/dll/win32/aclui/CMakeLists.txt
    branches/cmake-bringup/dll/win32/avicap32/CMakeLists.txt
    branches/cmake-bringup/dll/win32/batt/CMakeLists.txt
    branches/cmake-bringup/dll/win32/beepmidi/CMakeLists.txt
    branches/cmake-bringup/dll/win32/cards/CMakeLists.txt
    branches/cmake-bringup/dll/win32/compstui/CMakeLists.txt
    branches/cmake-bringup/dll/win32/gdi32/CMakeLists.txt
    branches/cmake-bringup/dll/win32/getuname/CMakeLists.txt
    branches/cmake-bringup/dll/win32/localui/CMakeLists.txt
    branches/cmake-bringup/dll/win32/lpk/CMakeLists.txt
    branches/cmake-bringup/gcc.cmake
    branches/cmake-bringup/msc.cmake

Modified: branches/cmake-bringup/dll/win32/acledit/CMakeLists.txt
URL: http://svn.reactos.org/svn/reactos/branches/cmake-bringup/dll/win32/acledit/CMakeLists.txt?rev=49629&r1=49628&r2=49629&view=diff
==============================================================================
--- branches/cmake-bringup/dll/win32/acledit/CMakeLists.txt [iso-8859-1] (original)
+++ branches/cmake-bringup/dll/win32/acledit/CMakeLists.txt [iso-8859-1] Fri Nov 19 14:21:18 2010
@@ -1,18 +1,16 @@
 
 set_unicode()
-
-spec2def(acledit.dll acledit.spec)
 
 list(APPEND SOURCE
     acledit.c
     stubs.c
-    acledit.rc
-    ${CMAKE_CURRENT_BINARY_DIR}/acledit.def)
-
+    acledit.rc)
 
 add_library(acledit SHARED ${SOURCE})
 
 set_module_type(acledit win32dll)
+
+set_export_spec(acledit acledit.spec)
 
 add_importlibs(acledit ntdll)
 

Modified: branches/cmake-bringup/dll/win32/aclui/CMakeLists.txt
URL: http://svn.reactos.org/svn/reactos/branches/cmake-bringup/dll/win32/aclui/CMakeLists.txt?rev=49629&r1=49628&r2=49629&view=diff
==============================================================================
--- branches/cmake-bringup/dll/win32/aclui/CMakeLists.txt [iso-8859-1] (original)
+++ branches/cmake-bringup/dll/win32/aclui/CMakeLists.txt [iso-8859-1] Fri Nov 19 14:21:18 2010
@@ -17,7 +17,8 @@
 
 set_module_type(aclui win32dll)
 
-set_pdef_file(aclui aclui.pdef)
+set_export_spec(aclui aclui.spec aclui.dll)
+
 add_importlib_target(${CMAKE_CURRENT_BINARY_DIR}/aclui.def)
 
 add_importlibs(aclui user32 gdi32 comctl32 ole32 oleaut32 advapi32 uxtheme kernel32 ntdll)

Modified: branches/cmake-bringup/dll/win32/avicap32/CMakeLists.txt
URL: http://svn.reactos.org/svn/reactos/branches/cmake-bringup/dll/win32/avicap32/CMakeLists.txt?rev=49629&r1=49628&r2=49629&view=diff
==============================================================================
--- branches/cmake-bringup/dll/win32/avicap32/CMakeLists.txt [iso-8859-1] (original)
+++ branches/cmake-bringup/dll/win32/avicap32/CMakeLists.txt [iso-8859-1] Fri Nov 19 14:21:18 2010
@@ -5,7 +5,8 @@
 
 set_module_type(avicap32 win32dll)
 
-set_pdef_file(avicap32 avicap32.pdef)
+set_export_spec(avicap32 avicap32.spec)
+
 add_importlib_target(${CMAKE_CURRENT_BINARY_DIR}/avicap32.def)
 
 target_link_libraries(avicap32 wine)

Modified: branches/cmake-bringup/dll/win32/batt/CMakeLists.txt
URL: http://svn.reactos.org/svn/reactos/branches/cmake-bringup/dll/win32/batt/CMakeLists.txt?rev=49629&r1=49628&r2=49629&view=diff
==============================================================================
--- branches/cmake-bringup/dll/win32/batt/CMakeLists.txt [iso-8859-1] (original)
+++ branches/cmake-bringup/dll/win32/batt/CMakeLists.txt [iso-8859-1] Fri Nov 19 14:21:18 2010
@@ -5,7 +5,8 @@
 
 set_module_type(batt win32dll)
 
-set_pdef_file(batt batt.pdef)
+set_export_spec(batt batt.spec)
+
 add_importlib_target(${CMAKE_CURRENT_BINARY_DIR}/batt.def)
 
 add_importlibs(batt kernel32)

Modified: branches/cmake-bringup/dll/win32/beepmidi/CMakeLists.txt
URL: http://svn.reactos.org/svn/reactos/branches/cmake-bringup/dll/win32/beepmidi/CMakeLists.txt?rev=49629&r1=49628&r2=49629&view=diff
==============================================================================
--- branches/cmake-bringup/dll/win32/beepmidi/CMakeLists.txt [iso-8859-1] (original)
+++ branches/cmake-bringup/dll/win32/beepmidi/CMakeLists.txt [iso-8859-1] Fri Nov 19 14:21:18 2010
@@ -3,11 +3,13 @@
 
 add_library(beepmidi SHARED beepmidi.c)
 
-set_pdef_file(beepmidi beepmidi.pdef)
+set_export_spec(beepmidi beepmidi.spec)
+
 add_importlib_target(${CMAKE_CURRENT_BINARY_DIR}/beepmidi.def)
 
 set_entrypoint(beepmidi 0)
 
 add_importlibs(beepmidi winmm kernel32 ntdll)
 add_dependencies(beepmidi psdk)
-add_cab_target(beepmidi 1)
+add_cab_target(beepmidi 1)
+

Modified: branches/cmake-bringup/dll/win32/cards/CMakeLists.txt
URL: http://svn.reactos.org/svn/reactos/branches/cmake-bringup/dll/win32/cards/CMakeLists.txt?rev=49629&r1=49628&r2=49629&view=diff
==============================================================================
--- branches/cmake-bringup/dll/win32/cards/CMakeLists.txt [iso-8859-1] (original)
+++ branches/cmake-bringup/dll/win32/cards/CMakeLists.txt [iso-8859-1] Fri Nov 19 14:21:18 2010
@@ -6,7 +6,8 @@
 
 add_library(cards SHARED cards.c cards.rc)
 
-set_pdef_file(cards cards.pdef)
+set_export_spec(cards cards.spec)
+
 add_importlib_target(${CMAKE_CURRENT_BINARY_DIR}/cards.def)
 
 set_module_type(cards win32dll)

Modified: branches/cmake-bringup/dll/win32/compstui/CMakeLists.txt
URL: http://svn.reactos.org/svn/reactos/branches/cmake-bringup/dll/win32/compstui/CMakeLists.txt?rev=49629&r1=49628&r2=49629&view=diff
==============================================================================
--- branches/cmake-bringup/dll/win32/compstui/CMakeLists.txt [iso-8859-1] (original)
+++ branches/cmake-bringup/dll/win32/compstui/CMakeLists.txt [iso-8859-1] Fri Nov 19 14:21:18 2010
@@ -4,13 +4,14 @@
 
 add_library(compstui SHARED compstui_main.c)
 
-set_pdef_file(compstui compstui.pdef)
-add_importlib_target(${CMAKE_CURRENT_BINARY_DIR}/compstui.def)
+set_module_type(compstui win32dll)
 
-set_module_type(compstui win32dll)
+set_export_spec(compstui compstui.spec)
 
 target_link_libraries(compstui wine)
 
 add_importlibs(compstui kernel32 ntdll)
 
 add_cab_target(compstui 1)
+add_importlib_target(compstui.spec)
+

Modified: branches/cmake-bringup/dll/win32/gdi32/CMakeLists.txt
URL: http://svn.reactos.org/svn/reactos/branches/cmake-bringup/dll/win32/gdi32/CMakeLists.txt?rev=49629&r1=49628&r2=49629&view=diff
==============================================================================
--- branches/cmake-bringup/dll/win32/gdi32/CMakeLists.txt [iso-8859-1] (original)
+++ branches/cmake-bringup/dll/win32/gdi32/CMakeLists.txt [iso-8859-1] Fri Nov 19 14:21:18 2010
@@ -49,7 +49,7 @@
     dxguid
     ${PSEH_LIB})
 
-set_pdef_file(gdi32 gdi32.pdef)
+set_export_spec(gdi32 gdi32.spec)
 
 add_importlibs(gdi32 user32 advapi32 kernel32 ntdll)
 add_pch(gdi32 ${CMAKE_CURRENT_SOURCE_DIR}/include/precomp.h ${SOURCE})

Modified: branches/cmake-bringup/dll/win32/getuname/CMakeLists.txt
URL: http://svn.reactos.org/svn/reactos/branches/cmake-bringup/dll/win32/getuname/CMakeLists.txt?rev=49629&r1=49628&r2=49629&view=diff
==============================================================================
--- branches/cmake-bringup/dll/win32/getuname/CMakeLists.txt [iso-8859-1] (original)
+++ branches/cmake-bringup/dll/win32/getuname/CMakeLists.txt [iso-8859-1] Fri Nov 19 14:21:18 2010
@@ -5,7 +5,8 @@
 
 add_library(getuname SHARED getuname.c getuname.rc)
 
-set_pdef_file(getuname getuname.pdef)
+set_export_spec(getuname getuname.spec)
+
 add_importlib_target(${CMAKE_CURRENT_BINARY_DIR}/getuname.def)
 
 set_module_type(getuname win32dll)

Modified: branches/cmake-bringup/dll/win32/localui/CMakeLists.txt
URL: http://svn.reactos.org/svn/reactos/branches/cmake-bringup/dll/win32/localui/CMakeLists.txt?rev=49629&r1=49628&r2=49629&view=diff
==============================================================================
--- branches/cmake-bringup/dll/win32/localui/CMakeLists.txt [iso-8859-1] (original)
+++ branches/cmake-bringup/dll/win32/localui/CMakeLists.txt [iso-8859-1] Fri Nov 19 14:21:18 2010
@@ -4,7 +4,8 @@
 
 add_library(localui SHARED localui.c localui.rc)
 
-set_pdef_file(localui localui.pdef)
+set_export_spec(localui localui.spec)
+
 add_importlib_target(${CMAKE_CURRENT_BINARY_DIR}/localui.def)
 
 set_module_type(localui win32dll)

Modified: branches/cmake-bringup/dll/win32/lpk/CMakeLists.txt
URL: http://svn.reactos.org/svn/reactos/branches/cmake-bringup/dll/win32/lpk/CMakeLists.txt?rev=49629&r1=49628&r2=49629&view=diff
==============================================================================
--- branches/cmake-bringup/dll/win32/lpk/CMakeLists.txt [iso-8859-1] (original)
+++ branches/cmake-bringup/dll/win32/lpk/CMakeLists.txt [iso-8859-1] Fri Nov 19 14:21:18 2010
@@ -6,7 +6,8 @@
 
 add_library(lpk SHARED dllmain.c stub.c lpk.rc)
 
-set_pdef_file(lpk lpk.pdef)
+set_export_spec(lpk lpk.spec)
+
 add_importlib_target(${CMAKE_CURRENT_BINARY_DIR}/lpk.def)
 
 set_module_type(lpk win32dll)

Modified: branches/cmake-bringup/gcc.cmake
URL: http://svn.reactos.org/svn/reactos/branches/cmake-bringup/gcc.cmake?rev=49629&r1=49628&r2=49629&view=diff
==============================================================================
--- branches/cmake-bringup/gcc.cmake [iso-8859-1] (original)
+++ branches/cmake-bringup/gcc.cmake [iso-8859-1] Fri Nov 19 14:21:18 2010
@@ -161,27 +161,20 @@
         COMMAND native-winebuild -o ${CMAKE_CURRENT_BINARY_DIR}/${_file}.def --def -E ${CMAKE_CURRENT_SOURCE_DIR}/${_spec_file} --filename ${_dllname}
         DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${_spec_file})
     set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/${_file}.def
-        PROPERTIES GENERATED TRUE EXTERNAL_OBJECT TRUE)
+        PROPERTIES GENERATED TRUE)
 ENDMACRO(spec2def _dllname _spec_file)
 
-macro(pdef2def _pdef_file)
-    get_filename_component(_file ${_pdef_file} NAME_WE)
-    add_custom_command(
-        OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_file}.def
-        COMMAND ${MINGW_PREFIX}cpp -o ${CMAKE_CURRENT_BINARY_DIR}/${_file}.def -P -E ${CMAKE_CURRENT_SOURCE_DIR}/${_pdef_file}
-        DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${_pdef_file})
-    set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/${_file}.def
-        PROPERTIES GENERATED TRUE EXTERNAL_OBJECT TRUE)
-    add_custom_target(
-        ${_file}_def
-        DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${_file}.def)
-endmacro(pdef2def _pdef_file)
-
-macro(set_pdef_file _module _pdef_file)
-    pdef2def(${_pdef_file})
-    get_filename_component(_file ${_pdef_file} NAME_WE)
+# Optional 3rd parameter: dllname
+macro(set_export_spec _module _spec_file)
+    get_filename_component(_file ${_spec_file} NAME_WE)
+    if (${ARGC} GREATER 2)
+        set(_dllname ${ARGV2})
+    else()
+        set(_dllname ${_file}.dll)
+    endif()
+    spec2def(${_dllname} ${_spec_file})
     target_link_libraries(${_module} "${CMAKE_CURRENT_BINARY_DIR}/${_file}.def")
-    add_dependencies(${_module} ${_file}_def)
+    add_dependencies(${_module} ${CMAKE_CURRENT_BINARY_DIR}/${_file}.def)
 endmacro()
 
 #pseh lib, needed with mingw

Modified: branches/cmake-bringup/msc.cmake
URL: http://svn.reactos.org/svn/reactos/branches/cmake-bringup/msc.cmake?rev=49629&r1=49628&r2=49629&view=diff
==============================================================================
--- branches/cmake-bringup/msc.cmake [iso-8859-1] (original)
+++ branches/cmake-bringup/msc.cmake [iso-8859-1] Fri Nov 19 14:21:18 2010
@@ -155,25 +155,20 @@
         COMMAND native-spec2pdef -n  --dll ${_dllname} ${CMAKE_CURRENT_SOURCE_DIR}/${_spec_file} ${CMAKE_CURRENT_BINARY_DIR}/${_file}.def
         DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${_spec_file})
     set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/${_file}.def
-        PROPERTIES GENERATED TRUE EXTERNAL_OBJECT TRUE)
+        PROPERTIES GENERATED TRUE)
 ENDMACRO(spec2def _dllname _spec_file)
 
-macro(pdef2def _pdef_file)
-    get_filename_component(_file ${_pdef_file} NAME_WE)
-    add_custom_command(
-        OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_file}.def
-        COMMAND ${CMAKE_C_COMPILER} /EP /c ${CMAKE_CURRENT_SOURCE_DIR}/${_pdef_file} > ${CMAKE_CURRENT_BINARY_DIR}/${_file}.def
-        DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${_pdef_file})
-    add_custom_target(
-        ${_file}_def
-        DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${_file}.def)
-endmacro(pdef2def _pdef_file)
-
-macro(set_pdef_file _module _pdef_file)
-    pdef2def(${_pdef_file})
-    get_filename_component(_file ${_pdef_file} NAME_WE)
+# Optional 3rd parameter: dllname
+macro(set_export_spec _module _spec_file)
+    get_filename_component(_file ${_spec_file} NAME_WE)
+    if (${ARGC} GREATER 2)
+        set(_dllname ${ARGV2})
+    else()
+        set(_dllname ${_file}.dll)
+    endif()
+    spec2def(${_dllname} ${_spec_file})
     add_linkerflag(${_module} "/DEF:${CMAKE_CURRENT_BINARY_DIR}/${_file}.def")
-    add_dependencies(${_module} ${_file}_def)
+    add_dependencies(${_module} ${CMAKE_CURRENT_BINARY_DIR}/${_file}.def)
 endmacro()
 
 file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/importlibs)




More information about the Ros-diffs mailing list