[ros-diffs] [jgardou] 53110: [CMAKE] - turn most macros in function 1/x. This avoids defining a truckload of variables in the global space, and some of these variables would collapse themselves in certain cases.

jgardou at svn.reactos.org jgardou at svn.reactos.org
Sun Aug 7 00:45:24 UTC 2011


Author: jgardou
Date: Sun Aug  7 00:45:23 2011
New Revision: 53110

URL: http://svn.reactos.org/svn/reactos?rev=53110&view=rev
Log:
[CMAKE]
- turn most macros in function 1/x.
This avoids defining a truckload of variables in the global space, and some of these variables would collapse themselves in certain cases.

Modified:
    trunk/reactos/cmake/CMakeMacros.cmake

Modified: trunk/reactos/cmake/CMakeMacros.cmake
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/cmake/CMakeMacros.cmake?rev=53110&r1=53109&r2=53110&view=diff
==============================================================================
--- trunk/reactos/cmake/CMakeMacros.cmake [iso-8859-1] (original)
+++ trunk/reactos/cmake/CMakeMacros.cmake [iso-8859-1] Sun Aug  7 00:45:23 2011
@@ -7,34 +7,34 @@
         -DNATIVE_C_INCLUDE=${REACTOS_SOURCE_DIR}/include/crt)
 endmacro()
 
-macro(add_dependency_node _node)
+function(add_dependency_node _node)
     if(GENERATE_DEPENDENCY_GRAPH)
         get_target_property(_type ${_node} TYPE)
         if(_type MATCHES SHARED_LIBRARY OR ${_node} MATCHES ntoskrnl)
             file(APPEND ${REACTOS_BINARY_DIR}/dependencies.graphml "    <node id=\"${_node}\"/>\n")
         endif()
      endif()
-endmacro()
-
-macro(add_dependency_edge _source _target)
+endfunction()
+
+function(add_dependency_edge _source _target)
     if(GENERATE_DEPENDENCY_GRAPH)
         get_target_property(_type ${_source} TYPE)
         if(_type MATCHES SHARED_LIBRARY)
             file(APPEND ${REACTOS_BINARY_DIR}/dependencies.graphml "    <edge source=\"${_source}\" target=\"${_target}\"/>\n")
         endif()
     endif()
-endmacro()
-
-macro(add_dependency_header)
+endfunction()
+
+function(add_dependency_header)
     file(APPEND ${REACTOS_BINARY_DIR}/dependencies.graphml "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<graphml>\n  <graph id=\"ReactOS dependencies\" edgedefault=\"directed\">\n")
-endmacro()
-
-macro(add_dependency_footer)
+endfunction()
+
+function(add_dependency_footer)
     add_dependency_node(ntdll)
     file(APPEND ${REACTOS_BINARY_DIR}/dependencies.graphml "  </graph>\n</graphml>\n")
-endmacro()
-
-macro(add_message_headers)
+endfunction()
+
+function(add_message_headers)
     foreach(_in_FILE ${ARGN})
         get_filename_component(FILE ${_in_FILE} NAME_WE)
         macro_mc(${FILE})
@@ -47,7 +47,7 @@
             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()
+endfunction()
 
 macro(dir_to_num dir var)
     if(${dir} STREQUAL reactos/system32)
@@ -207,7 +207,7 @@
         string(REPLACE "/" "\\" ${_native_path} "${_cmake_path}")
     endmacro()
 
-    macro(concatenate_files _file1 _file2 _output)
+    function(concatenate_files _file1 _file2 _output)
         to_win_path("${_file1}" _real_file1)
         to_win_path("${_file2}" _real_file2)
         to_win_path("${_output}" _real_output)
@@ -216,7 +216,7 @@
             COMMAND cmd.exe /C "copy /Y /B ${_real_file1} + ${_real_file2} ${_real_output} > nul"
             DEPENDS ${_file1}
             DEPENDS ${_file2})
-    endmacro()
+    endfunction()
 else()
     macro(concatenate_files _file1 _file2 _output)
         add_custom_command(




More information about the Ros-diffs mailing list