[CMAKE]
[reactos.git] / gcc.cmake
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