Author: akhaldi
Date: Mon Aug 8 11:54:20 2011
New Revision: 53137
URL:
http://svn.reactos.org/svn/reactos?rev=53137&view=rev
Log:
[CMAKE]
* Convert some macros to functions.
Modified:
trunk/reactos/cmake/msvc.cmake
Modified: trunk/reactos/cmake/msvc.cmake
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/cmake/msvc.cmake?rev=53137…
==============================================================================
--- trunk/reactos/cmake/msvc.cmake [iso-8859-1] (original)
+++ trunk/reactos/cmake/msvc.cmake [iso-8859-1] Mon Aug 8 11:54:20 2011
@@ -59,23 +59,23 @@
macro(add_pch _target_name _FILE)
endmacro()
-macro(set_entrypoint MODULE ENTRYPOINT)
+function(set_entrypoint MODULE ENTRYPOINT)
if(${ENTRYPOINT} STREQUAL "0")
add_linkerflag(${MODULE} "/NOENTRY")
else()
add_linkerflag(${MODULE} "/ENTRY:${ENTRYPOINT}")
endif()
-endmacro()
-
-macro(set_subsystem MODULE SUBSYSTEM)
+endfunction()
+
+function(set_subsystem MODULE SUBSYSTEM)
add_linkerflag(${MODULE} "/subsystem:${SUBSYSTEM}")
-endmacro()
-
-macro(set_image_base MODULE IMAGE_BASE)
+endfunction()
+
+function(set_image_base MODULE IMAGE_BASE)
add_linkerflag(${MODULE} "/BASE:${IMAGE_BASE}")
-endmacro()
-
-macro(set_module_type MODULE TYPE)
+endfunction()
+
+function(set_module_type MODULE TYPE)
add_dependencies(${MODULE} psdk)
if(${TYPE} MATCHES nativecui)
set_subsystem(${MODULE} native)
@@ -123,14 +123,14 @@
else()
message(FATAL_ERROR "Unknown module type : ${TYPE}")
endif()
-endmacro()
-
-macro(set_rc_compiler)
+endfunction()
+
+function(set_rc_compiler)
# dummy, this workaround is only needed in mingw due to lack of RC support in cmake
-endmacro()
+endfunction()
# Thanks MS for creating a stupid linker
-macro(add_importlib_target _exports_file)
+function(add_importlib_target _exports_file)
get_filename_component(_name ${_exports_file} NAME_WE)
get_target_property(_suffix ${_name} SUFFIX)
if(${_suffix} STREQUAL "_suffix-NOTFOUND")
@@ -174,14 +174,14 @@
DEPENDS ${CMAKE_BINARY_DIR}/importlibs/lib${_name}.lib)
add_dependencies(lib${_name} asm ${_dependencies})
-endmacro()
+endfunction()
macro(add_delay_importlibs MODULE)
# TODO. For now forward to normal import libs
add_importlibs(${MODULE} ${ARGN})
endmacro()
-macro(spec2def _dllname _spec_file)
+function(spec2def _dllname _spec_file)
get_filename_component(_file ${_spec_file} NAME_WE)
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_file}.def
${CMAKE_CURRENT_BINARY_DIR}/${_file}_stubs.c
@@ -189,7 +189,7 @@
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${_spec_file} native-spec2def)
set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/${_file}.def
${CMAKE_CURRENT_BINARY_DIR}/${_file}_stubs.c
PROPERTIES GENERATED TRUE)
-endmacro()
+endfunction()
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)
@@ -200,7 +200,7 @@
#pseh workaround
set(PSEH_LIB "pseh")
-macro(CreateBootSectorTarget2 _target_name _asm_file _binary_file _base_address)
+function(CreateBootSectorTarget2 _target_name _asm_file _binary_file _base_address)
set(_object_file ${_binary_file}.obj)
set(_temp_file ${_binary_file}.tmp)
@@ -223,4 +223,4 @@
set_source_files_properties(${_object_file} ${_temp_file} ${_binary_file} PROPERTIES
GENERATED TRUE)
add_custom_target(${_target_name} ALL DEPENDS ${_binary_file})
-endmacro()
+endfunction()