[CMAKE]
authorSylvain Petreolle <spetreolle@yahoo.fr>
Mon, 27 Sep 2010 09:14:54 +0000 (09:14 +0000)
committerSylvain Petreolle <spetreolle@yahoo.fr>
Mon, 27 Sep 2010 09:14:54 +0000 (09:14 +0000)
Add a set_rc_compiler macro,
its a workaround for lack of mingw RC support in cmake.
Enable winemine build.
Improve user32 CMakeLists.txt.

Thanks to AmineKhaldi for initial support of resources in user32.

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

base/applications/games/CMakeLists.txt
base/applications/games/winemine/CMakeLists.txt
dll/win32/user32/CMakeLists.txt
gcc.cmake
msc.cmake

index bde2267..f82ff81 100644 (file)
@@ -1,4 +1,4 @@
 
 add_subdirectory(solitaire)
 #add_subdirectory(spider)
-#add_subdirectory(winemine)
+add_subdirectory(winemine)
index 4016e48..67fc9ae 100644 (file)
@@ -1,11 +1,14 @@
 
+
 add_executable(winemine
     main.c
     dialog.c
     rsrc.rc)
 
+include_directories(${CMAKE_CURRENT_SOURCE_DIR})
 set_unicode(winemine yes)
 
 set_module_type(winemine win32gui)
+set_rc_compiler()
 
 add_importlibs(winemine user32 gdi32 advapi32 shell32 msvcrt)
\ No newline at end of file
index 466437c..e596388 100644 (file)
@@ -8,20 +8,61 @@ include_directories(BEFORE ${REACTOS_SOURCE_DIR}/include/reactos/wine)
 include_directories(${REACTOS_SOURCE_DIR}/include/reactos/subsys)
 include_directories(include)
 
-get_directory_property(defines COMPILE_DEFINITIONS)
-get_directory_property(includes INCLUDE_DIRECTORIES)
+set_rc_compiler()
 
-foreach(arg ${defines})
-  set(result_defs "${result_defs} -D${arg}")
-endforeach(arg ${defines})
-
-foreach(arg ${includes})
-  set(result_incs "-I${arg} ${result_incs}")
-endforeach(arg ${includes})
-
-SET(CMAKE_RC_COMPILE_OBJECT "<CMAKE_RC_COMPILER> ${result_defs} ${result_incs} -i <SOURCE> -O coff -o <OBJECT>")
-
-file(GLOB_RECURSE SOURCE *.c)
+list(APPEND SOURCE
+    user32_stubs.c
+    controls/button.c
+    controls/combo.c
+    controls/edit.c
+    controls/icontitle.c
+    controls/listbox.c
+    controls/regcontrol.c
+    controls/scrollbar.c
+    controls/static.c
+    misc/dde.c
+    misc/ddeclient.c
+    misc/ddeserver.c
+    misc/desktop.c
+    misc/display.c
+    misc/dllmain.c
+    misc/exit.c
+    misc/exticon.c
+    misc/imm.c
+    misc/misc.c
+    misc/object.c
+    misc/resources.c
+    misc/rtlstr.c
+    misc/stubs.c
+    misc/timer.c
+    misc/usrapihk.c
+    misc/winhelp.c
+    misc/winsta.c
+    misc/wsprintf.c
+    windows/accel.c
+    windows/caret.c
+    windows/class.c
+    windows/clipboard.c
+    windows/cursoricon.c
+    windows/dc.c
+    windows/defwnd.c
+    windows/dialog.c
+    windows/draw.c
+    windows/font.c
+    windows/hook.c
+    windows/input.c
+    windows/mdi.c
+    windows/menu.c
+    windows/messagebox.c
+    windows/message.c
+    windows/nonclient.c
+    windows/paint.c
+    windows/prop.c
+    windows/rect.c
+    windows/spy.c
+    windows/text.c
+    windows/window.c
+    windows/winpos.c)
 
 add_library(user32 SHARED
     ${SOURCE}
index 3c5f35d..1819531 100644 (file)
--- a/gcc.cmake
+++ b/gcc.cmake
@@ -93,4 +93,18 @@ macro(set_unicode MODULE STATE)
   target_link_libraries(${MODULE} mingw_common)\r
 endmacro()\r
 \r
-  
\ No newline at end of file
+# Workaround lack of mingw RC support in cmake\r
+macro(set_rc_compiler)\r
+    get_directory_property(defines COMPILE_DEFINITIONS)\r
+    get_directory_property(includes INCLUDE_DIRECTORIES)\r
+\r
+    foreach(arg ${defines})\r
+        set(result_defs "${result_defs} -D${arg}")\r
+    endforeach(arg ${defines})\r
+\r
+    foreach(arg ${includes})\r
+        set(result_incs "-I${arg} ${result_incs}")\r
+    endforeach(arg ${includes})\r
+\r
+    SET(CMAKE_RC_COMPILE_OBJECT "<CMAKE_RC_COMPILER> ${result_defs} ${result_incs} -i <SOURCE> -O coff -o <OBJECT>")\r
+endmacro()\r
index cc7565c..6df3473 100644 (file)
--- a/msc.cmake
+++ b/msc.cmake
@@ -62,3 +62,6 @@ endif()
 set(CMAKE_C_FLAGS_DEBUG_INIT "/D_DEBUG /MDd /Zi  /Ob0 /Od")\r
 SET(CMAKE_CXX_FLAGS_DEBUG_INIT "/D_DEBUG /MDd /Zi /Ob0 /Od")\r
 \r
+macro(set_rc_compiler)\r
+# dummy, this workaround is only needed in mingw due to lack of RC support in cmake\r
+endmacro()
\ No newline at end of file