summaryrefslogtreecommitdiff
path: root/cmake/ProcessM4.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'cmake/ProcessM4.cmake')
-rw-r--r--cmake/ProcessM4.cmake11
1 files changed, 11 insertions, 0 deletions
diff --git a/cmake/ProcessM4.cmake b/cmake/ProcessM4.cmake
new file mode 100644
index 0000000..09ba1c9
--- /dev/null
+++ b/cmake/ProcessM4.cmake
@@ -0,0 +1,11 @@
+MACRO(PROCESS_M4 _defines _input _output)
+ GET_FILENAME_COMPONENT(_name ${_output} NAME)
+ ADD_CUSTOM_COMMAND(
+ OUTPUT ${_output}
+ COMMAND m4
+ ARGS -P ${_defines} ${_input} > ${_output}
+ DEPENDS ${_input}
+ VERBATIM)
+ ADD_CUSTOM_TARGET(M4_${_name} DEPENDS ${_output})
+ ADD_DEPENDENCIES(${PROJECT_NAME} M4_${_name})
+ENDMACRO(PROCESS_M4)