Author: akhaldi
Date: Sat Jan 8 20:44:41 2011
New Revision: 50334
URL:
http://svn.reactos.org/svn/reactos?rev=50334&view=rev
Log:
[CMAKE]
- Improve message headers handling.
Modified:
branches/cmake-bringup/CMakeMacros.cmake
branches/cmake-bringup/base/applications/rapps/CMakeLists.txt
branches/cmake-bringup/gcc.cmake
branches/cmake-bringup/include/reactos/mc/CMakeLists.txt
branches/cmake-bringup/msc.cmake
Modified: branches/cmake-bringup/CMakeMacros.cmake
URL:
http://svn.reactos.org/svn/reactos/branches/cmake-bringup/CMakeMacros.cmake…
==============================================================================
--- branches/cmake-bringup/CMakeMacros.cmake [iso-8859-1] (original)
+++ branches/cmake-bringup/CMakeMacros.cmake [iso-8859-1] Sat Jan 8 20:44:41 2011
@@ -268,3 +268,19 @@
macro(add_dependency_footer)
file(APPEND ${REACTOS_BINARY_DIR}/dependencies.graphml "
</graph>\n</graphml>\n")
endmacro()
+
+macro(add_message_headers)
+ foreach(_in_FILE ${ARGN})
+ get_filename_component(FILE ${_in_FILE} NAME_WE)
+ macro_mc(${FILE})
+ add_custom_command(
+ OUTPUT ${REACTOS_BINARY_DIR}/include/reactos/${FILE}.rc
${REACTOS_BINARY_DIR}/include/reactos/${FILE}.h
+ COMMAND ${COMMAND_MC}
+ DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${FILE}.mc)
+ set_source_files_properties(
+ ${REACTOS_BINARY_DIR}/include/reactos/${FILE}.h
${REACTOS_BINARY_DIR}/include/reactos/${FILE}.rc
+ PROPERTIES GENERATED TRUE)
+ add_custom_target(${FILE} ALL DEPENDS
${REACTOS_BINARY_DIR}/include/reactos/${FILE}.h
${REACTOS_BINARY_DIR}/include/reactos/${FILE}.rc)
+ endforeach()
+endmacro()
+
Modified: branches/cmake-bringup/base/applications/rapps/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/branches/cmake-bringup/base/applications…
==============================================================================
--- branches/cmake-bringup/base/applications/rapps/CMakeLists.txt [iso-8859-1] (original)
+++ branches/cmake-bringup/base/applications/rapps/CMakeLists.txt [iso-8859-1] Sat Jan 8
20:44:41 2011
@@ -19,8 +19,10 @@
winmain.c
rapps.rc)
-include_directories(${CMAKE_CURRENT_BINARY_DIR})
-include_directories(${REACTOS_BINARY_DIR}/include/reactos)
+include_directories(
+ ${CMAKE_CURRENT_BINARY_DIR}
+ ${REACTOS_BINARY_DIR}/include/reactos)
+
set_rc_compiler()
add_executable(rapps ${SOURCE})
@@ -29,40 +31,5 @@
add_importlibs(rapps advapi32 comctl32 gdi32 urlmon user32 shell32 shlwapi kernel32
msvcrt ntdll)
add_dependencies(rapps rappsmsg)
-
-#FIXME : move this to cmakemacros + gcc/msvc.cmake
-
-if(MSVC)
-MACRO(MACRO_MC FILE)
- set (COMMAND_MC mc -r ${REACTOS_BINARY_DIR}/include/reactos -h
${REACTOS_BINARY_DIR}/include/reactos ${CMAKE_CURRENT_SOURCE_DIR}/${FILE}.mc)
-ENDMACRO()
-else()
-MACRO(MACRO_MC FILE)
- set(COMMAND_MC ${MINGW_PREFIX}windmc -A -b ${CMAKE_CURRENT_SOURCE_DIR}/${FILE}.mc -r
${REACTOS_BINARY_DIR}/include/reactos -h ${REACTOS_BINARY_DIR}/include/reactos)
-ENDMACRO()
-endif()
-
-MACRO (MACRO_ADD_MESSAGE_HEADERS)
-
- FOREACH(_in_FILE ${ARGN})
-
- get_filename_component(FILE ${_in_FILE} NAME_WE)
- MACRO_MC(${FILE})
- add_custom_command(
- OUTPUT ${REACTOS_BINARY_DIR}/include/reactos/${FILE}.rc
${REACTOS_BINARY_DIR}/include/reactos/${FILE}.h
- COMMAND ${COMMAND_MC}
- DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${FILE}.mc
- )
- set_source_files_properties(
- ${REACTOS_BINARY_DIR}/include/reactos/${FILE}.h
${REACTOS_BINARY_DIR}/include/reactos/${FILE}.rc
- PROPERTIES GENERATED TRUE
- )
- add_custom_target(${FILE} ALL DEPENDS ${REACTOS_BINARY_DIR}/include/reactos/${FILE}.h
${REACTOS_BINARY_DIR}/include/reactos/${FILE}.rc)
-
- ENDFOREACH(_in_FILE ${ARGN})
-
-ENDMACRO (MACRO_ADD_MESSAGE_HEADERS)
-
-MACRO_ADD_MESSAGE_HEADERS(rappsmsg.mc)
-
+add_message_headers(rappsmsg.mc)
add_cab_target(rapps 1)
Modified: branches/cmake-bringup/gcc.cmake
URL:
http://svn.reactos.org/svn/reactos/branches/cmake-bringup/gcc.cmake?rev=503…
==============================================================================
--- branches/cmake-bringup/gcc.cmake [iso-8859-1] (original)
+++ branches/cmake-bringup/gcc.cmake [iso-8859-1] Sat Jan 8 20:44:41 2011
@@ -273,6 +273,10 @@
list(APPEND SOURCE ${CMAKE_CURRENT_BINARY_DIR}/${_file}_stubs.c)
endmacro()
+macro(macro_mc FILE)
+ set(COMMAND_MC ${MINGW_PREFIX}windmc -A -b ${CMAKE_CURRENT_SOURCE_DIR}/${FILE}.mc -r
${REACTOS_BINARY_DIR}/include/reactos -h ${REACTOS_BINARY_DIR}/include/reactos)
+endmacro()
+
#pseh lib, needed with mingw
set(PSEH_LIB "pseh")
Modified: branches/cmake-bringup/include/reactos/mc/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/branches/cmake-bringup/include/reactos/m…
==============================================================================
--- branches/cmake-bringup/include/reactos/mc/CMakeLists.txt [iso-8859-1] (original)
+++ branches/cmake-bringup/include/reactos/mc/CMakeLists.txt [iso-8859-1] Sat Jan 8
20:44:41 2011
@@ -1,34 +1,3 @@
-
-if(MSVC)
-macro(MACRO_MC FILE)
- set (COMMAND_MC mc -r ${REACTOS_BINARY_DIR}/include/reactos -h
${REACTOS_BINARY_DIR}/include/reactos
${REACTOS_SOURCE_DIR}/include/reactos/mc/${FILE}.mc)
-endmacro()
-else()
-macro(MACRO_MC FILE)
- set(COMMAND_MC ${MINGW_PREFIX}windmc -A -b
${REACTOS_SOURCE_DIR}/include/reactos/mc/${FILE}.mc -r
${REACTOS_BINARY_DIR}/include/reactos -h ${REACTOS_BINARY_DIR}/include/reactos)
-endmacro()
-endif()
-
-macro (MACRO_ADD_MESSAGE_HEADERS)
-
- foreach(_in_FILE ${ARGN})
-
- get_filename_component(FILE ${_in_FILE} NAME_WE)
- MACRO_MC(${FILE})
- add_custom_command(
- OUTPUT ${REACTOS_BINARY_DIR}/include/reactos/${FILE}.rc
${REACTOS_BINARY_DIR}/include/reactos/${FILE}.h
- COMMAND ${COMMAND_MC}
- DEPENDS ${REACTOS_SOURCE_DIR}/include/reactos/mc/${FILE}.mc
- )
- set_source_files_properties(
- ${REACTOS_BINARY_DIR}/include/reactos/${FILE}.h
${REACTOS_BINARY_DIR}/include/reactos/${FILE}.rc
- PROPERTIES GENERATED TRUE
- )
- add_custom_target(${FILE} ALL DEPENDS ${REACTOS_BINARY_DIR}/include/reactos/${FILE}.h
${REACTOS_BINARY_DIR}/include/reactos/${FILE}.rc)
-
- endforeach(_in_FILE ${ARGN})
-
-endmacro (MACRO_ADD_MESSAGE_HEADERS)
list(APPEND SOURCE
bugcodes.mc
@@ -36,4 +5,5 @@
neteventmsg.mc
ntstatus.mc
pciclass.mc)
-MACRO_ADD_MESSAGE_HEADERS(${SOURCE})
+
+add_message_headers(${SOURCE})
Modified: branches/cmake-bringup/msc.cmake
URL:
http://svn.reactos.org/svn/reactos/branches/cmake-bringup/msc.cmake?rev=503…
==============================================================================
--- branches/cmake-bringup/msc.cmake [iso-8859-1] (original)
+++ branches/cmake-bringup/msc.cmake [iso-8859-1] Sat Jan 8 20:44:41 2011
@@ -204,6 +204,10 @@
spec2def(${_dllname} ${_spec_file})
endmacro()
+macro(macro_mc FILE)
+ set(COMMAND_MC mc -r ${REACTOS_BINARY_DIR}/include/reactos -h
${REACTOS_BINARY_DIR}/include/reactos
${REACTOS_SOURCE_DIR}/include/reactos/mc/${FILE}.mc)
+endmacro()
+
file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/importlibs)
#pseh workaround