[CMAKE]
authorAmine Khaldi <amine.khaldi@reactos.org>
Sat, 2 Oct 2010 19:08:06 +0000 (19:08 +0000)
committerAmine Khaldi <amine.khaldi@reactos.org>
Sat, 2 Oct 2010 19:08:06 +0000 (19:08 +0000)
- Introduce the case where entry point is 0.
- Improve some dlls.

svn path=/branches/cmake-bringup/; revision=48966

12 files changed:
dll/win32/aclui/CMakeLists.txt
dll/win32/activeds/CMakeLists.txt
dll/win32/advapi32/CMakeLists.txt
dll/win32/advpack/CMakeLists.txt
dll/win32/authz/CMakeLists.txt
dll/win32/avicap32/CMakeLists.txt
dll/win32/batt/CMakeLists.txt
dll/win32/beepmidi/CMakeLists.txt
dll/win32/cabinet/CMakeLists.txt
dll/win32/cards/CMakeLists.txt
gcc.cmake
msc.cmake

index 3887d58..3dcabb4 100644 (file)
@@ -3,28 +3,24 @@ set_unicode()
 
 add_definitions(-DSUPPORT_UXTHEME)
 
-file(GLOB_RECURSE SOURCE *.c)
+list(APPEND SOURCE
+    aclui.c
+    checklist.c
+    guid.c
+    misc.c
+    sidcache.c
+    aclui.rc)
 
 spec2def(aclui ${CMAKE_CURRENT_SOURCE_DIR}/aclui.spec ${CMAKE_CURRENT_BINARY_DIR}/aclui.def)
 
 add_library(aclui SHARED
-    ${SOURCE}
-    ${CMAKE_CURRENT_SOURCE_DIR}/aclui.rc
-    ${CMAKE_CURRENT_BINARY_DIR}/aclui_precomp.h.gch)
-
-set_target_properties(aclui PROPERTIES LINK_FLAGS "-Wl,-entry,_DllMain@12")
-
-target_link_libraries(aclui
-    ${CMAKE_CURRENT_BINARY_DIR}/aclui.def
-    -luser32
-    -lgdi32
-    -lcomctl32
-    -lole32
-    -loleaut32
-    -ladvapi32
-    -luxtheme
-    -lkernel32
-    -lntdll)
+    ${CMAKE_CURRENT_BINARY_DIR}/aclui_precomp.h.gch
+    ${SOURCE})
+
+set_module_type(aclui win32dll)
+
+target_link_libraries(aclui ${CMAKE_CURRENT_BINARY_DIR}/aclui.def)
+add_importlibs(aclui user32 gdi32 comctl32 ole32 oleaut32 advapi32 uxtheme kernel32 ntdll)
 
 add_pch(aclui ${CMAKE_CURRENT_SOURCE_DIR}/precomp.h ${SOURCE})
-add_dependencies(aclui aclui_def psdk buildno_header)
+add_dependencies(aclui aclui_def)
index 059ac2b..3ff192a 100644 (file)
@@ -1,6 +1,4 @@
 
-
-
 add_definitions(-D__WINESRC__)
 
 include_directories(${REACTOS_SOURCE_DIR}/include/reactos/wine)
@@ -9,11 +7,12 @@ spec2def(activeds ${CMAKE_CURRENT_SOURCE_DIR}/activeds.spec ${CMAKE_CURRENT_BINA
 
 add_library(activeds SHARED activeds_main.c)
 
-set_target_properties(activeds PROPERTIES LINK_FLAGS "-Wl,-entry,_DllMain@12")
+set_module_type(activeds win32dll)
 
 target_link_libraries(activeds 
      ${CMAKE_CURRENT_BINARY_DIR}/activeds.def
-     wine
-     mingw_common)
+     wine)
+
+add_importlibs(activeds kernel32 ntdll)
 
-add_dependencies(activeds activeds_def psdk buildno_header)
+add_dependencies(activeds activeds_def)
index a6d25ff..c7fd3a5 100644 (file)
@@ -1,7 +1,6 @@
 
+set_unicode()
 
-
-add_definitions(-DUNICODE -D_UNICODE)
 add_definitions(-D_ADVAPI32_)
 
 remove_definitions(-D_WIN32_WINNT=0x502)
@@ -9,29 +8,53 @@ add_definitions(-D_WIN32_WINNT=0x600)
 
 include_directories(${REACTOS_BINARY_DIR}/include/reactos/idl)
 
-file(GLOB_RECURSE SOURCE *.c)
-
-set_source_files_properties(${REACTOS_BINARY_DIR}/include/reactos/idl/svcctl_c.c
-    ${REACTOS_BINARY_DIR}/include/reactos/idl/lsa_c.c
-    ${REACTOS_BINARY_DIR}/include/reactos/idl/eventlogrpc_c.c
-    PROPERTIES GENERATED TRUE)
+list(APPEND SOURCE
+    crypt/crypt.c
+    crypt/crypt_arc4.c
+    crypt/crypt_des.c
+    crypt/crypt_lmhash.c
+    crypt/crypt_md4.c
+    crypt/crypt_md5.c
+    crypt/crypt_sha.c
+    misc/dllmain.c
+    misc/hwprofiles.c
+    misc/logon.c
+    misc/msi.c
+    misc/shutdown.c
+    misc/sysfunc.c
+    misc/trace.c
+    reg/reg.c
+    sec/ac.c
+    sec/audit.c
+    sec/cred.c
+    sec/lsa.c
+    sec/misc.c
+    sec/sec.c
+    sec/sid.c
+    sec/trustee.c
+    service/eventlog.c
+    service/rpc.c
+    service/scm.c
+    service/sctrl.c
+    token/privilege.c
+    token/token.c
+    advapi32_stubs.c
+    advapi32.rc)
 
 add_library(advapi32 SHARED
-    ${SOURCE}
-    ${CMAKE_CURRENT_SOURCE_DIR}/advapi32.rc
     ${CMAKE_CURRENT_BINARY_DIR}/advapi32_advapi32.h.gch
-    ${REACTOS_BINARY_DIR}/include/reactos/idl/svcctl_c.c
-    ${REACTOS_BINARY_DIR}/include/reactos/idl/lsa_c.c
-    ${REACTOS_BINARY_DIR}/include/reactos/idl/eventlogrpc_c.c)
+    ${SOURCE})
 
-set_target_properties(advapi32 PROPERTIES LINK_FLAGS "-Wl,-entry,_DllMain@12")
+set_module_type(advapi32 win32dll)
 
-target_link_libraries(advapi32 ${CMAKE_CURRENT_SOURCE_DIR}/advapi32.def
+target_link_libraries(advapi32
+    ${CMAKE_CURRENT_SOURCE_DIR}/advapi32.def
+    svcctl_client
+    lsa_client
+    eventlogrpc_client
     wine
-    pseh
-    rpcrt4
-    -lkernel32
-    -lntdll)
+    pseh)
+
+add_importlibs(advapi32 rpcrt4 kernel32 ntdll)
 
 add_pch(advapi32 ${CMAKE_CURRENT_SOURCE_DIR}/advapi32.h ${SOURCE})
-add_dependencies(advapi32 svcctl_client lsa_client eventlogrpc_client version)
index b903ece..de5205a 100644 (file)
@@ -1,25 +1,23 @@
 
-
-
 add_definitions(-D__WINESRC__)
 
 include_directories(${REACTOS_SOURCE_DIR}/include/reactos/wine)
 
-file(GLOB_RECURSE SOURCE *.c)
+list(APPEND SOURCE
+    advpack.c
+    files.c
+    install.c
+    reg.c)
 
 spec2def(advpack ${CMAKE_CURRENT_SOURCE_DIR}/advpack.spec ${CMAKE_CURRENT_BINARY_DIR}/advpack.def)
 
 add_library(advpack SHARED ${SOURCE})
 
-set_target_properties(advpack PROPERTIES LINK_FLAGS "-Wl,-entry,_DllMain@12")
+set_module_type(advpack win32dll)
 
 target_link_libraries(advpack
     ${CMAKE_CURRENT_BINARY_DIR}/advpack.def
-    wine
-    mingw_common
-    -lole32
-    -lsetupapi
-    -lversion
-    -ladvapi32)
-
-add_dependencies(advpack advpack_def psdk buildno_header)
+    wine)
+
+add_importlibs(advpack ole32 setupapi version advapi32 kernel32 ntdll)
+add_dependencies(advpack advpack_def)
index aab7f59..cfcb235 100644 (file)
@@ -1,24 +1,22 @@
 
+set_unicode()
 
-
-add_definitions(-DUNICODE -D_UNICODE)
-
-file(GLOB_RECURSE SOURCE *.c)
+list(APPEND SOURCE
+    authz.c
+    clictx.c
+    resman.c
+    authz.rc)
 
 spec2def(authz ${CMAKE_CURRENT_SOURCE_DIR}/authz.spec ${CMAKE_CURRENT_BINARY_DIR}/authz.def)
 
 add_library(authz SHARED
-    ${SOURCE}
-    ${CMAKE_CURRENT_SOURCE_DIR}/authz.rc
-    ${CMAKE_CURRENT_BINARY_DIR}/authz_precomp.h.gch)
+    ${CMAKE_CURRENT_BINARY_DIR}/authz_precomp.h.gch
+    ${SOURCE})
 
-set_target_properties(authz PROPERTIES LINK_FLAGS "-Wl,-entry,_DllMain@12")
+set_module_type(authz win32dll)
 
-target_link_libraries(authz
-    ${CMAKE_CURRENT_BINARY_DIR}/authz.def
-    -ladvapi32
-    -lkernel32
-    -lntdll)
+target_link_libraries(authz ${CMAKE_CURRENT_BINARY_DIR}/authz.def)
 
 add_pch(authz ${CMAKE_CURRENT_SOURCE_DIR}/precomp.h ${SOURCE})
-add_dependencies(authz authz_def psdk buildno_header)
+add_importlibs(authz advapi32 kernel32 ntdll)
+add_dependencies(authz authz_def)
index 8cfce5c..dd20d85 100644 (file)
@@ -1,22 +1,15 @@
 
-
-
-add_definitions(-DUNICODE -D_UNICODE)
+set_unicode()
 
 spec2def(avicap32 ${CMAKE_CURRENT_SOURCE_DIR}/avicap32.spec ${CMAKE_CURRENT_BINARY_DIR}/avicap32.def)
 
-add_library(avicap32 SHARED
-    ${CMAKE_CURRENT_SOURCE_DIR}/avicap32.c
-    ${CMAKE_CURRENT_SOURCE_DIR}/avicap32.rc)
+add_library(avicap32 SHARED avicap32.c avicap32.rc)
 
-set_target_properties(avicap32 PROPERTIES LINK_FLAGS "-Wl,-entry,_DllMain@12")
+set_module_type(avicap32 win32dll)
 
 target_link_libraries(avicap32
     ${CMAKE_CURRENT_BINARY_DIR}/avicap32.def
-    -ladvapi32
-    -luser32
-    wine
-    mingw_common
-    -lversion)
+    wine)
 
-add_dependencies(avicap32 avicap32_def psdk)
+add_importlibs(avicap32 advapi32 user32 version kernel32 ntdll)
+add_dependencies(avicap32 avicap32_def)
index f10b053..e28756a 100644 (file)
@@ -1,18 +1,13 @@
 
-
-
-add_definitions(-DUNICODE -D_UNICODE)
+set_unicode()
 
 spec2def(batt ${CMAKE_CURRENT_SOURCE_DIR}/batt.spec ${CMAKE_CURRENT_BINARY_DIR}/batt.def)
 
-add_library(batt SHARED
-    ${CMAKE_CURRENT_SOURCE_DIR}/batt.c
-    ${CMAKE_CURRENT_SOURCE_DIR}/batt.rc)
+add_library(batt SHARED batt.c batt.rc)
 
-set_target_properties(batt PROPERTIES LINK_FLAGS "-Wl,-entry,_DllMain@12")
+set_module_type(batt win32dll)
 
-target_link_libraries(batt
-    ${CMAKE_CURRENT_BINARY_DIR}/batt.def
-    -lkernel32)
+target_link_libraries(batt ${CMAKE_CURRENT_BINARY_DIR}/batt.def)
 
-add_dependencies(batt batt_def psdk)
+add_importlibs(batt kernel32)
+add_dependencies(batt batt_def)
index 9382be6..cf85284 100644 (file)
@@ -1,18 +1,13 @@
 
-
-
-add_definitions(-DUNICODE -D_UNICODE)
+set_unicode()
 
 spec2def(beepmidi ${CMAKE_CURRENT_SOURCE_DIR}/beepmidi.spec ${CMAKE_CURRENT_BINARY_DIR}/beepmidi.def)
 
 add_library(beepmidi SHARED beepmidi.c)
 
-set_target_properties(beepmidi PROPERTIES LINK_FLAGS "-Wl,-entry,0")
+set_entrypoint(beepmidi 0)
 
-target_link_libraries(beepmidi
-    ${CMAKE_CURRENT_BINARY_DIR}/beepmidi.def
-    -lwinmm
-    -lkernel32
-    -lntdll)
+target_link_libraries(beepmidi ${CMAKE_CURRENT_BINARY_DIR}/beepmidi.def)
 
+add_importlibs(beepmidi winmm kernel32 ntdll)
 add_dependencies(beepmidi beepmidi_def psdk)
index f2b0af9..a57785f 100644 (file)
@@ -1,23 +1,23 @@
 
-
-
 add_definitions(-D__WINESRC__)
 
 include_directories(${REACTOS_SOURCE_DIR}/include/reactos/wine)
 
 spec2def(cabinet ${CMAKE_CURRENT_SOURCE_DIR}/cabinet.spec ${CMAKE_CURRENT_BINARY_DIR}/cabinet.def)
 
-file(GLOB_RECURSE SOURCE *.c)
+list(APPEND SOURCE
+    cabinet_main.c
+    fci.c
+    fdi.c
+    cabinet.rc)
 
-add_library(cabinet SHARED
-    ${SOURCE}
-    ${CMAKE_CURRENT_SOURCE_DIR}/cabinet.rc)
+add_library(cabinet SHARED ${SOURCE})
 
-set_target_properties(cabinet PROPERTIES LINK_FLAGS "-Wl,-entry,0")
+set_entrypoint(cabinet 0)
 
 target_link_libraries(cabinet
     ${CMAKE_CURRENT_BINARY_DIR}/cabinet.def
-    wine
-    mingw_common)
+    wine)
 
-add_dependencies(cabinet cabinet_def psdk)
+add_importlibs(cabinet kernel32 ntdll)
+add_dependencies(cabinet cabinet_def psdk buildno_header)
index 6849880..0ee0b5f 100644 (file)
@@ -1,20 +1,16 @@
 
-
-
-add_definitions(-DUNICODE -D_UNICODE)
+set_unicode()
 
 # Possible definitions: CARDSTYLE_DEFAULT or CARDSTYLE_BAVARIAN
 add_definitions(-DCARDSTYLE_DEFAULT)
 
 spec2def(cards ${CMAKE_CURRENT_SOURCE_DIR}/cards.spec ${CMAKE_CURRENT_BINARY_DIR}/cards.def)
 
-add_library(cards SHARED ${CMAKE_CURRENT_SOURCE_DIR}/cards.c ${CMAKE_CURRENT_SOURCE_DIR}/cards.rc)
+add_library(cards SHARED cards.c cards.rc)
 
-set_target_properties(cards PROPERTIES LINK_FLAGS "-Wl,-entry,_DllMain@12")
+set_module_type(cards win32dll)
 
-target_link_libraries(cards
-    ${CMAKE_CURRENT_BINARY_DIR}/cards.def
-    -luser32
-    -lgdi32)
+target_link_libraries(cards ${CMAKE_CURRENT_BINARY_DIR}/cards.def)
 
-add_dependencies(cards cards_def psdk)
+add_importlibs(cards user32 gdi32)
+add_dependencies(cards cards_def)
index 62c6fda..cca492f 100644 (file)
--- a/gcc.cmake
+++ b/gcc.cmake
@@ -35,7 +35,11 @@ add_definitions(-Os -fno-strict-aliasing -ftracer -momit-leaf-frame-pointer -mpr
 \r
 # Macros\r
 macro(set_entrypoint MODULE ENTRYPOINT)\r
+    if(${ENTRYPOINT} STREQUAL "0")\r
+    set(NEW_LINKER_FLAGS "-Wl,-entry,0")\r
+    else()\r
     set(NEW_LINKER_FLAGS "-Wl,-entry,_${ENTRYPOINT}")\r
+    endif()\r
     get_target_property(LINKER_FLAGS ${MODULE} LINK_FLAGS)\r
     if(LINKER_FLAGS)\r
         set(NEW_LINKER_FLAGS "${LINKER_FLAGS} ${NEW_LINKER_FLAGS}")\r
index a83a607..42754e4 100644 (file)
--- a/msc.cmake
+++ b/msc.cmake
@@ -15,7 +15,11 @@ add_definitions(/GS- /Zl /Zi)
 add_definitions(-Dinline=__inline -D__STDC__=1)\r
 \r
 macro(set_entrypoint MODULE ENTRYPOINT)\r
+    if(${ENTRYPOINT} STREQUAL "0")\r
+    set(NEW_LINKER_FLAGS "/ENTRY:0")\r
+    else()\r
     set(NEW_LINKER_FLAGS "/ENTRY:${ENTRYPOINT}")\r
+    endif()\r
     get_target_property(LINKER_FLAGS ${MODULE} LINK_FLAGS)\r
     if(LINKER_FLAGS)\r
         set(NEW_LINKER_FLAGS "${LINKER_FLAGS} ${NEW_LINKER_FLAGS}")\r