Author: jgardou
Date: Wed Mar 14 18:38:19 2012
New Revision: 56149
URL:
http://svn.reactos.org/svn/reactos?rev=56149&view=rev
Log:
[CMAKE]
- add a small functions for preprocessing files with C compiler.
unused/untested
Modified:
trunk/reactos/cmake/CMakeMacros.cmake
Modified: trunk/reactos/cmake/CMakeMacros.cmake
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/cmake/CMakeMacros.cmake?re…
==============================================================================
--- trunk/reactos/cmake/CMakeMacros.cmake [iso-8859-1] (original)
+++ trunk/reactos/cmake/CMakeMacros.cmake [iso-8859-1] Wed Mar 14 18:38:19 2012
@@ -377,3 +377,19 @@
# do compiler specific stuff
set_module_type_toolchain(${MODULE} ${TYPE})
endfunction()
+
+function(preprocess_file __in __out)
+ set(__arg ${__in})
+ foreach(__def in ${ARGN})
+ list(APPEND __arg -D${__def})
+ endforeach()
+ if(MSVC)
+ add_custom_command(OUTPUT ${_out}
+ COMMAND ${CMAKE_C_COMPILER} /EP ${__arg}
+ DEPENDS ${__in})
+ else()
+ add_custom_command(OUTPUT ${_out}
+ COMMAND ${CMAKE_C_COMPILER} -E ${__arg}
+ DEPENDS ${__in})
+ endif()
+endfunction()